// 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_hdfs", locationHDFSResourceType) } // locationHDFSResourceType returns the Terraform awscc_datasync_location_hdfs resource type. // This Terraform resource type corresponds to the CloudFormation AWS::DataSync::LocationHDFS resource type. func locationHDFSResourceType(ctx context.Context) (tfsdk.ResourceType, error) { attributes := map[string]tfsdk.Attribute{ "agent_arns": { // Property: AgentArns // CloudFormation resource type schema: // { // "description": "ARN(s) of the agent(s) to use for an HDFS 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: "ARN(s) of the agent(s) to use for an HDFS 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(), }, }, "authentication_type": { // Property: AuthenticationType // CloudFormation resource type schema: // { // "description": "The authentication mode used to determine identity of user.", // "enum": [ // "SIMPLE", // "KERBEROS" // ], // "type": "string" // } Description: "The authentication mode used to determine identity of user.", Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringInSlice([]string{ "SIMPLE", "KERBEROS", }), }, }, "block_size": { // Property: BlockSize // CloudFormation resource type schema: // { // "description": "Size of chunks (blocks) in bytes that the data is divided into when stored in the HDFS cluster.", // "format": "int64", // "maximum": 1073741824, // "minimum": 1048576, // "type": "integer" // } Description: "Size of chunks (blocks) in bytes that the data is divided into when stored in the HDFS cluster.", Type: types.Int64Type, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.IntBetween(1048576, 1073741824), }, }, "kerberos_keytab": { // Property: KerberosKeytab // CloudFormation resource type schema: // { // "description": "The Base64 string representation of the Keytab file.", // "type": "string" // } Description: "The Base64 string representation of the Keytab file.", Type: types.StringType, Optional: true, // KerberosKeytab is a write-only property. }, "kerberos_krb_5_conf": { // Property: KerberosKrb5Conf // CloudFormation resource type schema: // { // "description": "The string representation of the Krb5Conf file, or the presigned URL to access the Krb5.conf file within an S3 bucket.", // "type": "string" // } Description: "The string representation of the Krb5Conf file, or the presigned URL to access the Krb5.conf file within an S3 bucket.", Type: types.StringType, Optional: true, // KerberosKrb5Conf is a write-only property. }, "kerberos_principal": { // Property: KerberosPrincipal // CloudFormation resource type schema: // { // "description": "The unique identity, or principal, to which Kerberos can assign tickets.", // "maxLength": 256, // "minLength": 1, // "pattern": "^.+$", // "type": "string" // } Description: "The unique identity, or principal, to which Kerberos can assign tickets.", Type: types.StringType, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), validate.StringMatch(regexp.MustCompile("^.+$"), ""), }, }, "kms_key_provider_uri": { // Property: KmsKeyProviderUri // CloudFormation resource type schema: // { // "description": "The identifier for the Key Management Server where the encryption keys that encrypt data inside HDFS clusters are stored.", // "maxLength": 255, // "minLength": 1, // "pattern": "^kms:\\/\\/http[s]?@(([a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9\\-]*[A-Za-z0-9])(;(([a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9\\-]*[A-Za-z0-9]))*:[0-9]{1,5}\\/kms$", // "type": "string" // } Description: "The identifier for the Key Management Server where the encryption keys that encrypt data inside HDFS clusters are stored.", Type: types.StringType, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 255), validate.StringMatch(regexp.MustCompile("^kms:\\/\\/http[s]?@(([a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9\\-]*[A-Za-z0-9])(;(([a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9\\-]*[A-Za-z0-9]))*:[0-9]{1,5}\\/kms$"), ""), }, }, "location_arn": { // Property: LocationArn // CloudFormation resource type schema: // { // "description": "The Amazon Resource Name (ARN) of the HDFS location.", // "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 HDFS location.", Type: types.StringType, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), }, }, "location_uri": { // Property: LocationUri // CloudFormation resource type schema: // { // "description": "The URL of the HDFS location that was described.", // "maxLength": 4356, // "pattern": "^(efs|nfs|s3|smb|fsxw|hdfs)://[a-zA-Z0-9.:/\\-]+$", // "type": "string" // } Description: "The URL of the HDFS location that was described.", Type: types.StringType, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), }, }, "name_nodes": { // Property: NameNodes // CloudFormation resource type schema: // { // "description": "An array of Name Node(s) of the HDFS location.", // "insertionOrder": false, // "items": { // "additionalProperties": false, // "description": "HDFS Name Node IP and port information.", // "properties": { // "Hostname": { // "description": "The DNS name or IP address of the Name Node in the customer's on premises HDFS cluster.", // "maxLength": 255, // "pattern": "^(([a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9\\-]*[A-Za-z0-9])$", // "type": "string" // }, // "Port": { // "description": "The port on which the Name Node is listening on for client requests.", // "maximum": 65536, // "minimum": 1, // "type": "integer" // } // }, // "required": [ // "Hostname", // "Port" // ], // "type": "object" // }, // "minItems": 1, // "type": "array" // } Description: "An array of Name Node(s) of the HDFS location.", Attributes: tfsdk.ListNestedAttributes( map[string]tfsdk.Attribute{ "hostname": { // Property: Hostname Description: "The DNS name or IP address of the Name Node in the customer's on premises HDFS cluster.", 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])$"), ""), }, }, "port": { // Property: Port Description: "The port on which the Name Node is listening on for client requests.", Type: types.Int64Type, Required: true, Validators: []tfsdk.AttributeValidator{ validate.IntBetween(1, 65536), }, }, }, tfsdk.ListNestedAttributesOptions{}, ), Required: true, Validators: []tfsdk.AttributeValidator{ validate.ArrayLenAtLeast(1), }, PlanModifiers: []tfsdk.AttributePlanModifier{ Multiset(), }, }, "qop_configuration": { // Property: QopConfiguration // CloudFormation resource type schema: // { // "additionalProperties": false, // "description": "Configuration information for RPC Protection and Data Transfer Protection. These parameters can be set to AUTHENTICATION, INTEGRITY, or PRIVACY. The default value is PRIVACY.", // "properties": { // "DataTransferProtection": { // "default": "PRIVACY", // "description": "Configuration for Data Transfer Protection.", // "enum": [ // "AUTHENTICATION", // "INTEGRITY", // "PRIVACY", // "DISABLED" // ], // "type": "string" // }, // "RpcProtection": { // "default": "PRIVACY", // "description": "Configuration for RPC Protection.", // "enum": [ // "AUTHENTICATION", // "INTEGRITY", // "PRIVACY", // "DISABLED" // ], // "type": "string" // } // }, // "type": "object" // } Description: "Configuration information for RPC Protection and Data Transfer Protection. These parameters can be set to AUTHENTICATION, INTEGRITY, or PRIVACY. The default value is PRIVACY.", Attributes: tfsdk.SingleNestedAttributes( map[string]tfsdk.Attribute{ "data_transfer_protection": { // Property: DataTransferProtection Description: "Configuration for Data Transfer Protection.", Type: types.StringType, Optional: true, Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringInSlice([]string{ "AUTHENTICATION", "INTEGRITY", "PRIVACY", "DISABLED", }), }, PlanModifiers: []tfsdk.AttributePlanModifier{ DefaultValue(types.String{Value: "PRIVACY"}), tfsdk.UseStateForUnknown(), }, }, "rpc_protection": { // Property: RpcProtection Description: "Configuration for RPC Protection.", Type: types.StringType, Optional: true, Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringInSlice([]string{ "AUTHENTICATION", "INTEGRITY", "PRIVACY", "DISABLED", }), }, PlanModifiers: []tfsdk.AttributePlanModifier{ DefaultValue(types.String{Value: "PRIVACY"}), tfsdk.UseStateForUnknown(), }, }, }, ), Optional: true, }, "replication_factor": { // Property: ReplicationFactor // CloudFormation resource type schema: // { // "default": 3, // "description": "Number of copies of each block that exists inside the HDFS cluster.", // "format": "int64", // "maximum": 512, // "minimum": 1, // "type": "integer" // } Description: "Number of copies of each block that exists inside the HDFS cluster.", Type: types.Int64Type, Optional: true, Computed: true, Validators: []tfsdk.AttributeValidator{ validate.IntBetween(1, 512), }, PlanModifiers: []tfsdk.AttributePlanModifier{ DefaultValue(types.Int64{Value: 3}), tfsdk.UseStateForUnknown(), }, }, "simple_user": { // Property: SimpleUser // CloudFormation resource type schema: // { // "description": "The user name that has read and write permissions on the specified HDFS cluster.", // "maxLength": 256, // "minLength": 1, // "pattern": "^[_.A-Za-z0-9][-_.A-Za-z0-9]*$", // "type": "string" // } Description: "The user name that has read and write permissions on the specified HDFS cluster.", Type: types.StringType, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), validate.StringMatch(regexp.MustCompile("^[_.A-Za-z0-9][-_.A-Za-z0-9]*$"), ""), }, }, "subdirectory": { // Property: Subdirectory // CloudFormation resource type schema: // { // "description": "The subdirectory in HDFS that is used to read data from the HDFS source location or write data to the HDFS destination.", // "maxLength": 4096, // "pattern": "^[a-zA-Z0-9_\\-\\+\\./\\(\\)\\$\\p{Zs}]+$", // "type": "string" // } Description: "The subdirectory in HDFS that is used to read data from the HDFS source location or write data to the HDFS destination.", 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 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", // "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 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, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 256), }, }, }, 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::LocationHDFS.", Version: 1, Attributes: attributes, } var opts ResourceTypeOptions opts = opts.WithCloudFormationTypeName("AWS::DataSync::LocationHDFS").WithTerraformTypeName("awscc_datasync_location_hdfs") opts = opts.WithTerraformSchema(schema) opts = opts.WithSyntheticIDAttribute(true) opts = opts.WithAttributeNameMap(map[string]string{ "agent_arns": "AgentArns", "authentication_type": "AuthenticationType", "block_size": "BlockSize", "data_transfer_protection": "DataTransferProtection", "hostname": "Hostname", "kerberos_keytab": "KerberosKeytab", "kerberos_krb_5_conf": "KerberosKrb5Conf", "kerberos_principal": "KerberosPrincipal", "key": "Key", "kms_key_provider_uri": "KmsKeyProviderUri", "location_arn": "LocationArn", "location_uri": "LocationUri", "name_nodes": "NameNodes", "port": "Port", "qop_configuration": "QopConfiguration", "replication_factor": "ReplicationFactor", "rpc_protection": "RpcProtection", "simple_user": "SimpleUser", "subdirectory": "Subdirectory", "tags": "Tags", "value": "Value", }) opts = opts.WithWriteOnlyPropertyPaths([]string{ "/properties/Subdirectory", "/properties/KerberosKeytab", "/properties/KerberosKrb5Conf", }) opts = opts.WithCreateTimeoutInMinutes(0).WithDeleteTimeoutInMinutes(0) opts = opts.WithUpdateTimeoutInMinutes(0) resourceType, err := NewResourceType(ctx, opts...) if err != nil { return nil, err } return resourceType, nil }