// Code generated by generators/resource/main.go; DO NOT EDIT. package personalize 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_personalize_schema", schemaResourceType) } // schemaResourceType returns the Terraform awscc_personalize_schema resource type. // This Terraform resource type corresponds to the CloudFormation AWS::Personalize::Schema resource type. func schemaResourceType(ctx context.Context) (tfsdk.ResourceType, error) { attributes := map[string]tfsdk.Attribute{ "domain": { // Property: Domain // CloudFormation resource type schema: // { // "description": "The domain of a Domain dataset group.", // "enum": [ // "ECOMMERCE", // "VIDEO_ON_DEMAND" // ], // "type": "string" // } Description: "The domain of a Domain dataset group.", Type: types.StringType, Optional: true, Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringInSlice([]string{ "ECOMMERCE", "VIDEO_ON_DEMAND", }), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), tfsdk.RequiresReplace(), }, }, "name": { // Property: Name // CloudFormation resource type schema: // { // "description": "Name for the schema.", // "maxLength": 63, // "minLength": 1, // "pattern": "^[a-zA-Z0-9][a-zA-Z0-9\\-_]*", // "type": "string" // } Description: "Name for the schema.", Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 63), validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9][a-zA-Z0-9\\-_]*"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, }, "schema": { // Property: Schema // CloudFormation resource type schema: // { // "description": "A schema in Avro JSON format.", // "maxLength": 10000, // "type": "string" // } Description: "A schema in Avro JSON format.", Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(10000), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, }, "schema_arn": { // Property: SchemaArn // CloudFormation resource type schema: // { // "description": "Arn for the schema.", // "maxLength": 256, // "pattern": "arn:([a-z\\d-]+):personalize:.*:.*:.+", // "type": "string" // } Description: "Arn for the schema.", Type: types.StringType, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), }, }, } 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::Personalize::Schema.", Version: 1, Attributes: attributes, } var opts ResourceTypeOptions opts = opts.WithCloudFormationTypeName("AWS::Personalize::Schema").WithTerraformTypeName("awscc_personalize_schema") opts = opts.WithTerraformSchema(schema) opts = opts.WithSyntheticIDAttribute(true) opts = opts.WithAttributeNameMap(map[string]string{ "domain": "Domain", "name": "Name", "schema": "Schema", "schema_arn": "SchemaArn", }) opts = opts.IsImmutableType(true) opts = opts.WithCreateTimeoutInMinutes(0).WithDeleteTimeoutInMinutes(0) resourceType, err := NewResourceType(ctx, opts...) if err != nil { return nil, err } return resourceType, nil }