// Code generated by generators/resource/main.go; DO NOT EDIT. package lightsail import ( "context" "regexp" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" . "github.com/hashicorp/terraform-provider-awscc/internal/generic" "github.com/hashicorp/terraform-provider-awscc/internal/registry" "github.com/hashicorp/terraform-provider-awscc/internal/validate" ) func init() { registry.AddResourceTypeFactory("awscc_lightsail_disk", diskResourceType) } // diskResourceType returns the Terraform awscc_lightsail_disk resource type. // This Terraform resource type corresponds to the CloudFormation AWS::Lightsail::Disk resource type. func diskResourceType(ctx context.Context) (tfsdk.ResourceType, error) { attributes := map[string]tfsdk.Attribute{ "add_ons": { // Property: AddOns // CloudFormation resource type schema: // { // "description": "An array of objects representing the add-ons to enable for the new instance.", // "insertionOrder": false, // "items": { // "additionalProperties": false, // "description": "A addon associate with a resource.", // "properties": { // "AddOnType": { // "description": "The add-on type", // "maxLength": 128, // "minLength": 1, // "type": "string" // }, // "AutoSnapshotAddOnRequest": { // "additionalProperties": false, // "description": "An object that represents additional parameters when enabling or modifying the automatic snapshot add-on", // "properties": { // "SnapshotTimeOfDay": { // "description": "The daily time when an automatic snapshot will be created.", // "pattern": "^[0-9]{2}:00$", // "type": "string" // } // }, // "type": "object" // }, // "Status": { // "description": "Status of the Addon", // "enum": [ // "Enabling", // "Disabling", // "Enabled", // "Terminating", // "Terminated", // "Disabled", // "Failed" // ], // "type": "string" // } // }, // "required": [ // "AddOnType" // ], // "type": "object" // }, // "type": "array" // } Description: "An array of objects representing the add-ons to enable for the new instance.", Attributes: tfsdk.ListNestedAttributes( map[string]tfsdk.Attribute{ "add_on_type": { // Property: AddOnType Description: "The add-on type", Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), }, }, "auto_snapshot_add_on_request": { // Property: AutoSnapshotAddOnRequest Description: "An object that represents additional parameters when enabling or modifying the automatic snapshot add-on", Attributes: tfsdk.SingleNestedAttributes( map[string]tfsdk.Attribute{ "snapshot_time_of_day": { // Property: SnapshotTimeOfDay Description: "The daily time when an automatic snapshot will be created.", Type: types.StringType, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringMatch(regexp.MustCompile("^[0-9]{2}:00$"), ""), }, }, }, ), Optional: true, }, "status": { // Property: Status Description: "Status of the Addon", Type: types.StringType, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringInSlice([]string{ "Enabling", "Disabling", "Enabled", "Terminating", "Terminated", "Disabled", "Failed", }), }, }, }, tfsdk.ListNestedAttributesOptions{}, ), Optional: true, PlanModifiers: []tfsdk.AttributePlanModifier{ Multiset(), }, }, "attached_to": { // Property: AttachedTo // CloudFormation resource type schema: // { // "description": "Name of the attached Lightsail Instance", // "type": "string" // } Description: "Name of the attached Lightsail Instance", Type: types.StringType, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), }, }, "attachment_state": { // Property: AttachmentState // CloudFormation resource type schema: // { // "description": "Attachment State of the Lightsail disk", // "type": "string" // } Description: "Attachment State of the Lightsail disk", Type: types.StringType, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), }, }, "availability_zone": { // Property: AvailabilityZone // CloudFormation resource type schema: // { // "description": "The Availability Zone in which to create your instance. Use the following format: us-east-2a (case sensitive). Be sure to add the include Availability Zones parameter to your request.", // "maxLength": 255, // "minLength": 1, // "type": "string" // } Description: "The Availability Zone in which to create your instance. Use the following format: us-east-2a (case sensitive). Be sure to add the include Availability Zones parameter to your request.", Type: types.StringType, Optional: true, Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 255), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), tfsdk.RequiresReplace(), }, }, "disk_arn": { // Property: DiskArn // CloudFormation resource type schema: // { // "type": "string" // } Type: types.StringType, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), }, }, "disk_name": { // Property: DiskName // CloudFormation resource type schema: // { // "description": "The names to use for your new Lightsail disk.", // "maxLength": 254, // "minLength": 1, // "pattern": "^[a-zA-Z0-9][\\w\\-.]*[a-zA-Z0-9]$", // "type": "string" // } Description: "The names to use for your new Lightsail disk.", Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 254), validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9][\\w\\-.]*[a-zA-Z0-9]$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, }, "iops": { // Property: Iops // CloudFormation resource type schema: // { // "description": "Iops of the Lightsail disk", // "type": "integer" // } Description: "Iops of the Lightsail disk", Type: types.Int64Type, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), }, }, "is_attached": { // Property: IsAttached // CloudFormation resource type schema: // { // "description": "Check is Disk is attached state", // "type": "boolean" // } Description: "Check is Disk is attached state", Type: types.BoolType, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), }, }, "location": { // Property: Location // CloudFormation resource type schema: // { // "additionalProperties": false, // "description": "Location of a resource.", // "properties": { // "AvailabilityZone": { // "description": "The Availability Zone in which to create your disk. Use the following format: us-east-2a (case sensitive). Be sure to add the include Availability Zones parameter to your request.", // "type": "string" // }, // "RegionName": { // "description": "The Region Name in which to create your disk.", // "type": "string" // } // }, // "type": "object" // } Description: "Location of a resource.", Attributes: tfsdk.SingleNestedAttributes( map[string]tfsdk.Attribute{ "availability_zone": { // Property: AvailabilityZone Description: "The Availability Zone in which to create your disk. Use the following format: us-east-2a (case sensitive). Be sure to add the include Availability Zones parameter to your request.", Type: types.StringType, Optional: true, }, "region_name": { // Property: RegionName Description: "The Region Name in which to create your disk.", Type: types.StringType, Optional: true, }, }, ), Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), }, }, "path": { // Property: Path // CloudFormation resource type schema: // { // "description": "Path of the attached Disk", // "type": "string" // } Description: "Path of the attached Disk", Type: types.StringType, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), }, }, "resource_type": { // Property: ResourceType // CloudFormation resource type schema: // { // "description": "Resource type of Lightsail instance.", // "type": "string" // } Description: "Resource type of Lightsail instance.", Type: types.StringType, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), }, }, "size_in_gb": { // Property: SizeInGb // CloudFormation resource type schema: // { // "description": "Size of the Lightsail disk", // "type": "integer" // } Description: "Size of the Lightsail disk", Type: types.Int64Type, Required: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, }, "state": { // Property: State // CloudFormation resource type schema: // { // "description": "State of the Lightsail disk", // "type": "string" // } Description: "State of the Lightsail disk", Type: types.StringType, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), }, }, "support_code": { // Property: SupportCode // CloudFormation resource type schema: // { // "description": "Support code to help identify any issues", // "type": "string" // } Description: "Support code to help identify any issues", Type: types.StringType, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), }, }, "tags": { // Property: Tags // CloudFormation resource type schema: // { // "description": "An array of key-value pairs to apply to this resource.", // "insertionOrder": false, // "items": { // "additionalProperties": false, // "description": "A key-value pair to associate with a resource.", // "properties": { // "Key": { // "description": "The key name of the tag. You can specify a value that is 1 to 128 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -.", // "maxLength": 128, // "minLength": 1, // "type": "string" // }, // "Value": { // "description": "The value for the tag. You can specify a value that is 0 to 256 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -.", // "maxLength": 256, // "minLength": 0, // "type": "string" // } // }, // "required": [ // "Key" // ], // "type": "object" // }, // "type": "array", // "uniqueItems": true // } Description: "An array of key-value pairs to apply to this resource.", Attributes: tfsdk.SetNestedAttributes( map[string]tfsdk.Attribute{ "key": { // Property: Key Description: "The key name of the tag. You can specify a value that is 1 to 128 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -.", Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), }, }, "value": { // Property: Value Description: "The value for the tag. You can specify a value that is 0 to 256 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -.", Type: types.StringType, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 256), }, }, }, tfsdk.SetNestedAttributesOptions{}, ), Optional: true, }, } attributes["id"] = tfsdk.Attribute{ Description: "Uniquely identifies the resource.", Type: types.StringType, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), }, } schema := tfsdk.Schema{ Description: "Resource Type definition for AWS::Lightsail::Disk", Version: 1, Attributes: attributes, } var opts ResourceTypeOptions opts = opts.WithCloudFormationTypeName("AWS::Lightsail::Disk").WithTerraformTypeName("awscc_lightsail_disk") opts = opts.WithTerraformSchema(schema) opts = opts.WithSyntheticIDAttribute(true) opts = opts.WithAttributeNameMap(map[string]string{ "add_on_type": "AddOnType", "add_ons": "AddOns", "attached_to": "AttachedTo", "attachment_state": "AttachmentState", "auto_snapshot_add_on_request": "AutoSnapshotAddOnRequest", "availability_zone": "AvailabilityZone", "disk_arn": "DiskArn", "disk_name": "DiskName", "iops": "Iops", "is_attached": "IsAttached", "key": "Key", "location": "Location", "path": "Path", "region_name": "RegionName", "resource_type": "ResourceType", "size_in_gb": "SizeInGb", "snapshot_time_of_day": "SnapshotTimeOfDay", "state": "State", "status": "Status", "support_code": "SupportCode", "tags": "Tags", "value": "Value", }) opts = opts.WithCreateTimeoutInMinutes(0).WithDeleteTimeoutInMinutes(0) opts = opts.WithUpdateTimeoutInMinutes(2160) resourceType, err := NewResourceType(ctx, opts...) if err != nil { return nil, err } return resourceType, nil }