// Code generated by generators/resource/main.go; DO NOT EDIT. package datasync 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_datasync_location_object_storage", locationObjectStorageResourceType) } // locationObjectStorageResourceType returns the Terraform awscc_datasync_location_object_storage resource type. // This Terraform resource type corresponds to the CloudFormation AWS::DataSync::LocationObjectStorage resource type. func locationObjectStorageResourceType(ctx context.Context) (tfsdk.ResourceType, error) { attributes := map[string]tfsdk.Attribute{ "access_key": { // Property: AccessKey // CloudFormation resource type schema: // { // "description": "Optional. The access key is used if credentials are required to access the self-managed object storage server.", // "maxLength": 200, // "minLength": 8, // "pattern": "^.+$", // "type": "string" // } Description: "Optional. The access key is used if credentials are required to access the self-managed object storage server.", Type: types.StringType, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(8, 200), validate.StringMatch(regexp.MustCompile("^.+$"), ""), }, }, "agent_arns": { // Property: AgentArns // CloudFormation resource type schema: // { // "description": "The Amazon Resource Name (ARN) of the agents associated with the self-managed object storage server location.", // "insertionOrder": false, // "items": { // "maxLength": 128, // "pattern": "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):datasync:[a-z\\-0-9]+:[0-9]{12}:agent/agent-[0-9a-z]{17}$", // "type": "string" // }, // "maxItems": 4, // "minItems": 1, // "type": "array" // } Description: "The Amazon Resource Name (ARN) of the agents associated with the self-managed object storage server location.", Type: types.ListType{ElemType: types.StringType}, Required: true, Validators: []tfsdk.AttributeValidator{ validate.ArrayLenBetween(1, 4), validate.ArrayForEach(validate.StringLenAtMost(128)), validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):datasync:[a-z\\-0-9]+:[0-9]{12}:agent/agent-[0-9a-z]{17}$"), "")), }, PlanModifiers: []tfsdk.AttributePlanModifier{ Multiset(), }, }, "bucket_name": { // Property: BucketName // CloudFormation resource type schema: // { // "description": "The name of the bucket on the self-managed object storage server.", // "maxLength": 63, // "minLength": 3, // "pattern": "^[a-zA-Z0-9_\\-\\+\\./\\(\\)\\$\\p{Zs}]+$", // "type": "string" // } Description: "The name of the bucket on the self-managed object storage server.", Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(3, 63), validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9_\\-\\+\\./\\(\\)\\$\\p{Zs}]+$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, // BucketName is a write-only property. }, "location_arn": { // Property: LocationArn // CloudFormation resource type schema: // { // "description": "The Amazon Resource Name (ARN) of the location that is created.", // "maxLength": 128, // "pattern": "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):datasync:[a-z\\-0-9]+:[0-9]{12}:location/loc-[0-9a-z]{17}$", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of the location that is created.", Type: types.StringType, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), }, }, "location_uri": { // Property: LocationUri // CloudFormation resource type schema: // { // "description": "The URL of the object storage location that was described.", // "maxLength": 4356, // "pattern": "^(efs|nfs|s3|smb|fsxw|object-storage)://[a-zA-Z0-9./\\-]+$", // "type": "string" // } Description: "The URL of the object storage location that was described.", Type: types.StringType, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), }, }, "secret_key": { // Property: SecretKey // CloudFormation resource type schema: // { // "description": "Optional. The secret key is used if credentials are required to access the self-managed object storage server.", // "maxLength": 200, // "minLength": 8, // "pattern": "^.+$", // "type": "string" // } Description: "Optional. The secret key is used if credentials are required to access the self-managed object storage server.", Type: types.StringType, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(8, 200), validate.StringMatch(regexp.MustCompile("^.+$"), ""), }, // SecretKey is a write-only property. }, "server_hostname": { // Property: ServerHostname // CloudFormation resource type schema: // { // "description": "The name of the self-managed object storage server. This value is the IP address or Domain Name Service (DNS) name of the object storage server.", // "maxLength": 255, // "pattern": "^(([a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9\\-]*[A-Za-z0-9])$", // "type": "string" // } Description: "The name of the self-managed object storage server. This value is the IP address or Domain Name Service (DNS) name of the object storage server.", Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(255), validate.StringMatch(regexp.MustCompile("^(([a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9\\-]*[A-Za-z0-9])$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, // ServerHostname is a write-only property. }, "server_port": { // Property: ServerPort // CloudFormation resource type schema: // { // "description": "The port that your self-managed server accepts inbound network traffic on.", // "maximum": 65536, // "minimum": 1, // "type": "integer" // } Description: "The port that your self-managed server accepts inbound network traffic on.", Type: types.Int64Type, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.IntBetween(1, 65536), }, }, "server_protocol": { // Property: ServerProtocol // CloudFormation resource type schema: // { // "description": "The protocol that the object storage server uses to communicate.", // "enum": [ // "HTTPS", // "HTTP" // ], // "type": "string" // } Description: "The protocol that the object storage server uses to communicate.", Type: types.StringType, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringInSlice([]string{ "HTTPS", "HTTP", }), }, }, "subdirectory": { // Property: Subdirectory // CloudFormation resource type schema: // { // "description": "The subdirectory in the self-managed object storage server that is used to read data from.", // "maxLength": 4096, // "pattern": "^[a-zA-Z0-9_\\-\\+\\./\\(\\)\\p{Zs}]*$", // "type": "string" // } Description: "The subdirectory in the self-managed object storage server that is used to read data from.", Type: types.StringType, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(4096), validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9_\\-\\+\\./\\(\\)\\p{Zs}]*$"), ""), }, // Subdirectory is a write-only property. }, "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 for an AWS resource tag.", // "maxLength": 256, // "minLength": 1, // "pattern": "^[a-zA-Z0-9\\s+=._:/-]+$", // "type": "string" // }, // "Value": { // "description": "The value for an AWS resource tag.", // "maxLength": 256, // "minLength": 1, // "pattern": "^[a-zA-Z0-9\\s+=._:@/-]+$", // "type": "string" // } // }, // "required": [ // "Key", // "Value" // ], // "type": "object" // }, // "maxItems": 50, // "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 for an AWS resource tag.", Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9\\s+=._:/-]+$"), ""), }, }, "value": { // Property: Value Description: "The value for an AWS resource tag.", Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9\\s+=._:@/-]+$"), ""), }, }, }, tfsdk.SetNestedAttributesOptions{}, ), Optional: true, Validators: []tfsdk.AttributeValidator{ validate.ArrayLenAtMost(50), }, }, } attributes["id"] = tfsdk.Attribute{ Description: "Uniquely identifies the resource.", Type: types.StringType, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), }, } schema := tfsdk.Schema{ Description: "Resource schema for AWS::DataSync::LocationObjectStorage.", Version: 1, Attributes: attributes, } var opts ResourceTypeOptions opts = opts.WithCloudFormationTypeName("AWS::DataSync::LocationObjectStorage").WithTerraformTypeName("awscc_datasync_location_object_storage") opts = opts.WithTerraformSchema(schema) opts = opts.WithSyntheticIDAttribute(true) opts = opts.WithAttributeNameMap(map[string]string{ "access_key": "AccessKey", "agent_arns": "AgentArns", "bucket_name": "BucketName", "key": "Key", "location_arn": "LocationArn", "location_uri": "LocationUri", "secret_key": "SecretKey", "server_hostname": "ServerHostname", "server_port": "ServerPort", "server_protocol": "ServerProtocol", "subdirectory": "Subdirectory", "tags": "Tags", "value": "Value", }) opts = opts.WithWriteOnlyPropertyPaths([]string{ "/properties/SecretKey", "/properties/BucketName", "/properties/ServerHostname", "/properties/Subdirectory", }) opts = opts.WithCreateTimeoutInMinutes(0).WithDeleteTimeoutInMinutes(0) opts = opts.WithUpdateTimeoutInMinutes(0) resourceType, err := NewResourceType(ctx, opts...) if err != nil { return nil, err } return resourceType, nil }