// 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_agent", agentResourceType) } // agentResourceType returns the Terraform awscc_datasync_agent resource type. // This Terraform resource type corresponds to the CloudFormation AWS::DataSync::Agent resource type. func agentResourceType(ctx context.Context) (tfsdk.ResourceType, error) { attributes := map[string]tfsdk.Attribute{ "activation_key": { // Property: ActivationKey // CloudFormation resource type schema: // { // "description": "Activation key of the Agent.", // "maxLength": 29, // "pattern": "[A-Z0-9]{5}(-[A-Z0-9]{5}){4}", // "type": "string" // } Description: "Activation key of the Agent.", Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(29), validate.StringMatch(regexp.MustCompile("[A-Z0-9]{5}(-[A-Z0-9]{5}){4}"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, // ActivationKey is a write-only property. }, "agent_arn": { // Property: AgentArn // CloudFormation resource type schema: // { // "description": "The DataSync Agent ARN.", // "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" // } Description: "The DataSync Agent ARN.", Type: types.StringType, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), }, }, "agent_name": { // Property: AgentName // CloudFormation resource type schema: // { // "description": "The name configured for the agent. Text reference used to identify the agent in the console.", // "maxLength": 256, // "minLength": 1, // "pattern": "^[a-zA-Z0-9\\s+=._:@/-]+$", // "type": "string" // } Description: "The name configured for the agent. Text reference used to identify the agent in the console.", Type: types.StringType, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9\\s+=._:@/-]+$"), ""), }, }, "endpoint_type": { // Property: EndpointType // CloudFormation resource type schema: // { // "description": "The service endpoints that the agent will connect to.", // "enum": [ // "FIPS", // "PUBLIC", // "PRIVATE_LINK" // ], // "type": "string" // } Description: "The service endpoints that the agent will connect to.", Type: types.StringType, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), }, }, "security_group_arns": { // Property: SecurityGroupArns // CloudFormation resource type schema: // { // "description": "The ARNs of the security group used to protect your data transfer task subnets.", // "insertionOrder": false, // "items": { // "maxLength": 128, // "pattern": "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):ec2:[a-z\\-0-9]*:[0-9]{12}:security-group/.*$", // "type": "string" // }, // "type": "array" // } Description: "The ARNs of the security group used to protect your data transfer task subnets.", Type: types.ListType{ElemType: types.StringType}, Optional: true, Computed: true, Validators: []tfsdk.AttributeValidator{ validate.ArrayForEach(validate.StringLenAtMost(128)), validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):ec2:[a-z\\-0-9]*:[0-9]{12}:security-group/.*$"), "")), }, PlanModifiers: []tfsdk.AttributePlanModifier{ Multiset(), tfsdk.UseStateForUnknown(), tfsdk.RequiresReplace(), }, }, "subnet_arns": { // Property: SubnetArns // CloudFormation resource type schema: // { // "description": "The ARNs of the subnets in which DataSync will create elastic network interfaces for each data transfer task.", // "insertionOrder": false, // "items": { // "maxLength": 128, // "pattern": "^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):ec2:[a-z\\-0-9]*:[0-9]{12}:subnet/.*$", // "type": "string" // }, // "type": "array" // } Description: "The ARNs of the subnets in which DataSync will create elastic network interfaces for each data transfer task.", Type: types.ListType{ElemType: types.StringType}, Optional: true, Computed: true, Validators: []tfsdk.AttributeValidator{ validate.ArrayForEach(validate.StringLenAtMost(128)), validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):ec2:[a-z\\-0-9]*:[0-9]{12}:subnet/.*$"), "")), }, PlanModifiers: []tfsdk.AttributePlanModifier{ Multiset(), tfsdk.UseStateForUnknown(), tfsdk.RequiresReplace(), }, }, "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), }, }, "vpc_endpoint_id": { // Property: VpcEndpointId // CloudFormation resource type schema: // { // "description": "The ID of the VPC endpoint that the agent has access to.", // "pattern": "^vpce-[0-9a-f]{17}$", // "type": "string" // } Description: "The ID of the VPC endpoint that the agent has access to.", Type: types.StringType, Optional: true, Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringMatch(regexp.MustCompile("^vpce-[0-9a-f]{17}$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), tfsdk.RequiresReplace(), }, }, } 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::Agent.", Version: 1, Attributes: attributes, } var opts ResourceTypeOptions opts = opts.WithCloudFormationTypeName("AWS::DataSync::Agent").WithTerraformTypeName("awscc_datasync_agent") opts = opts.WithTerraformSchema(schema) opts = opts.WithSyntheticIDAttribute(true) opts = opts.WithAttributeNameMap(map[string]string{ "activation_key": "ActivationKey", "agent_arn": "AgentArn", "agent_name": "AgentName", "endpoint_type": "EndpointType", "key": "Key", "security_group_arns": "SecurityGroupArns", "subnet_arns": "SubnetArns", "tags": "Tags", "value": "Value", "vpc_endpoint_id": "VpcEndpointId", }) opts = opts.WithWriteOnlyPropertyPaths([]string{ "/properties/ActivationKey", }) opts = opts.WithCreateTimeoutInMinutes(0).WithDeleteTimeoutInMinutes(0) opts = opts.WithUpdateTimeoutInMinutes(0) resourceType, err := NewResourceType(ctx, opts...) if err != nil { return nil, err } return resourceType, nil }