// Code generated by generators/resource/main.go; DO NOT EDIT. package memorydb 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_memorydb_user", userResourceType) } // userResourceType returns the Terraform awscc_memorydb_user resource type. // This Terraform resource type corresponds to the CloudFormation AWS::MemoryDB::User resource type. func userResourceType(ctx context.Context) (tfsdk.ResourceType, error) { attributes := map[string]tfsdk.Attribute{ "access_string": { // Property: AccessString // CloudFormation resource type schema: // { // "description": "Access permissions string used for this user account.", // "type": "string" // } Description: "Access permissions string used for this user account.", Type: types.StringType, Required: true, // AccessString is a write-only property. }, "arn": { // Property: Arn // CloudFormation resource type schema: // { // "description": "The Amazon Resource Name (ARN) of the user account.", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of the user account.", Type: types.StringType, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), }, }, "authentication_mode": { // Property: AuthenticationMode // CloudFormation resource type schema: // { // "additionalProperties": false, // "properties": { // "Passwords": { // "$comment": "List of passwords.", // "description": "Passwords used for this user account. You can create up to two passwords for each user.", // "insertionOrder": true, // "items": { // "type": "string" // }, // "maxItems": 2, // "minItems": 1, // "type": "array", // "uniqueItems": true // }, // "Type": { // "description": "Type of authentication strategy for this user.", // "enum": [ // "password" // ], // "type": "string" // } // }, // "type": "object" // } Attributes: tfsdk.SingleNestedAttributes( map[string]tfsdk.Attribute{ "passwords": { // Property: Passwords Description: "Passwords used for this user account. You can create up to two passwords for each user.", Type: types.ListType{ElemType: types.StringType}, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.ArrayLenBetween(1, 2), validate.UniqueItems(), }, }, "type": { // Property: Type Description: "Type of authentication strategy for this user.", Type: types.StringType, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringInSlice([]string{ "password", }), }, }, }, ), Required: true, // AuthenticationMode is a write-only property. }, "status": { // Property: Status // CloudFormation resource type schema: // { // "description": "Indicates the user status. Can be \"active\", \"modifying\" or \"deleting\".", // "type": "string" // } Description: "Indicates the user status. Can be \"active\", \"modifying\" or \"deleting\".", 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 user.", // "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: or memorydb:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -.", // "maxLength": 128, // "minLength": 1, // "pattern": "", // "type": "string" // }, // "Value": { // "description": "The value for the tag. You can specify a value that is 1 to 256 Unicode characters in length and cannot be prefixed with aws: or memorydb:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -.", // "maxLength": 256, // "minLength": 1, // "pattern": "", // "type": "string" // } // }, // "required": [ // "Value", // "Key" // ], // "type": "object" // }, // "maxItems": 50, // "type": "array", // "uniqueItems": true // } Description: "An array of key-value pairs to apply to this user.", 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: or memorydb:. 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 1 to 256 Unicode characters in length and cannot be prefixed with aws: or memorydb:. 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, 256), }, }, }, tfsdk.SetNestedAttributesOptions{}, ), Optional: true, Validators: []tfsdk.AttributeValidator{ validate.ArrayLenAtMost(50), }, }, "user_name": { // Property: UserName // CloudFormation resource type schema: // { // "description": "The name of the user.", // "pattern": "[a-z][a-z0-9\\\\-]*", // "type": "string" // } Description: "The name of the user.", Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringMatch(regexp.MustCompile("[a-z][a-z0-9\\\\-]*"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ 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 Type definition for AWS::MemoryDB::User", Version: 1, Attributes: attributes, } var opts ResourceTypeOptions opts = opts.WithCloudFormationTypeName("AWS::MemoryDB::User").WithTerraformTypeName("awscc_memorydb_user") opts = opts.WithTerraformSchema(schema) opts = opts.WithSyntheticIDAttribute(true) opts = opts.WithAttributeNameMap(map[string]string{ "access_string": "AccessString", "arn": "Arn", "authentication_mode": "AuthenticationMode", "key": "Key", "passwords": "Passwords", "status": "Status", "tags": "Tags", "type": "Type", "user_name": "UserName", "value": "Value", }) opts = opts.WithWriteOnlyPropertyPaths([]string{ "/properties/AuthenticationMode", "/properties/AccessString", }) opts = opts.WithCreateTimeoutInMinutes(0).WithDeleteTimeoutInMinutes(0) opts = opts.WithUpdateTimeoutInMinutes(0) resourceType, err := NewResourceType(ctx, opts...) if err != nil { return nil, err } return resourceType, nil }