// Code generated by generators/resource/main.go; DO NOT EDIT. package forecast 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_forecast_dataset", datasetResourceType) } // datasetResourceType returns the Terraform awscc_forecast_dataset resource type. // This Terraform resource type corresponds to the CloudFormation AWS::Forecast::Dataset resource type. func datasetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { attributes := map[string]tfsdk.Attribute{ "arn": { // Property: Arn // CloudFormation resource type schema: // { // "maxLength": 256, // "pattern": "^[a-zA-Z0-9\\-\\_\\.\\/\\:]+$", // "type": "string" // } Type: types.StringType, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), }, }, "data_frequency": { // Property: DataFrequency // CloudFormation resource type schema: // { // "description": "Frequency of data collection. This parameter is required for RELATED_TIME_SERIES", // "pattern": "^Y|M|W|D|H|30min|15min|10min|5min|1min$", // "type": "string" // } Description: "Frequency of data collection. This parameter is required for RELATED_TIME_SERIES", Type: types.StringType, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringMatch(regexp.MustCompile("^Y|M|W|D|H|30min|15min|10min|5min|1min$"), ""), }, }, "dataset_name": { // Property: DatasetName // CloudFormation resource type schema: // { // "description": "A name for the dataset", // "maxLength": 63, // "minLength": 1, // "pattern": "^[a-zA-Z][a-zA-Z0-9_]*", // "type": "string" // } Description: "A name for the dataset", Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 63), validate.StringMatch(regexp.MustCompile("^[a-zA-Z][a-zA-Z0-9_]*"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, }, "dataset_type": { // Property: DatasetType // CloudFormation resource type schema: // { // "description": "The dataset type", // "enum": [ // "TARGET_TIME_SERIES", // "RELATED_TIME_SERIES", // "ITEM_METADATA" // ], // "type": "string" // } Description: "The dataset type", Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringInSlice([]string{ "TARGET_TIME_SERIES", "RELATED_TIME_SERIES", "ITEM_METADATA", }), }, }, "domain": { // Property: Domain // CloudFormation resource type schema: // { // "description": "The domain associated with the dataset", // "enum": [ // "RETAIL", // "CUSTOM", // "INVENTORY_PLANNING", // "EC2_CAPACITY", // "WORK_FORCE", // "WEB_TRAFFIC", // "METRICS" // ], // "type": "string" // } Description: "The domain associated with the dataset", Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringInSlice([]string{ "RETAIL", "CUSTOM", "INVENTORY_PLANNING", "EC2_CAPACITY", "WORK_FORCE", "WEB_TRAFFIC", "METRICS", }), }, }, "encryption_config": { // Property: EncryptionConfig // CloudFormation resource type schema: // { // "additionalProperties": false, // "properties": { // "KmsKeyArn": { // "description": "KMS key used to encrypt the Dataset data", // "maxLength": 256, // "pattern": "arn:aws[-a-z]*:kms:.*:key/.*", // "type": "string" // }, // "RoleArn": { // "description": "The ARN of the IAM role that Amazon Forecast can assume to access the AWS KMS key.", // "maxLength": 256, // "pattern": "^[a-zA-Z0-9\\-\\_\\.\\/\\:]+$", // "type": "string" // } // }, // "type": "object" // } Attributes: tfsdk.SingleNestedAttributes( map[string]tfsdk.Attribute{ "kms_key_arn": { // Property: KmsKeyArn Description: "KMS key used to encrypt the Dataset data", Type: types.StringType, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), validate.StringMatch(regexp.MustCompile("arn:aws[-a-z]*:kms:.*:key/.*"), ""), }, }, "role_arn": { // Property: RoleArn Description: "The ARN of the IAM role that Amazon Forecast can assume to access the AWS KMS key.", Type: types.StringType, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9\\-\\_\\.\\/\\:]+$"), ""), }, }, }, ), Optional: true, }, "schema": { // Property: Schema // CloudFormation resource type schema: // { // "additionalProperties": false, // "properties": { // "Attributes": { // "insertionOrder": true, // "items": { // "additionalProperties": false, // "properties": { // "AttributeName": { // "description": "Name of the dataset field", // "pattern": "^[a-zA-Z][a-zA-Z0-9_]*", // "type": "string" // }, // "AttributeType": { // "description": "Data type of the field", // "enum": [ // "string", // "integer", // "float", // "timestamp", // "geolocation" // ], // "type": "string" // } // }, // "type": "object" // }, // "maxItems": 100, // "minItems": 1, // "type": "array" // } // }, // "type": "object" // } Attributes: tfsdk.SingleNestedAttributes( map[string]tfsdk.Attribute{ "attributes": { // Property: Attributes Attributes: tfsdk.ListNestedAttributes( map[string]tfsdk.Attribute{ "attribute_name": { // Property: AttributeName Description: "Name of the dataset field", Type: types.StringType, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringMatch(regexp.MustCompile("^[a-zA-Z][a-zA-Z0-9_]*"), ""), }, }, "attribute_type": { // Property: AttributeType Description: "Data type of the field", Type: types.StringType, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringInSlice([]string{ "string", "integer", "float", "timestamp", "geolocation", }), }, }, }, tfsdk.ListNestedAttributesOptions{}, ), Optional: true, Validators: []tfsdk.AttributeValidator{ validate.ArrayLenBetween(1, 100), }, }, }, ), Required: true, }, "tags": { // Property: Tags // CloudFormation resource type schema: // { // "insertionOrder": true, // "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": 200, // "minItems": 0, // "type": "array" // } Attributes: tfsdk.ListNestedAttributes( 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.ListNestedAttributesOptions{}, ), Optional: true, Validators: []tfsdk.AttributeValidator{ validate.ArrayLenBetween(0, 200), }, }, } 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::Forecast::Dataset", Version: 1, Attributes: attributes, } var opts ResourceTypeOptions opts = opts.WithCloudFormationTypeName("AWS::Forecast::Dataset").WithTerraformTypeName("awscc_forecast_dataset") opts = opts.WithTerraformSchema(schema) opts = opts.WithSyntheticIDAttribute(true) opts = opts.WithAttributeNameMap(map[string]string{ "arn": "Arn", "attribute_name": "AttributeName", "attribute_type": "AttributeType", "attributes": "Attributes", "data_frequency": "DataFrequency", "dataset_name": "DatasetName", "dataset_type": "DatasetType", "domain": "Domain", "encryption_config": "EncryptionConfig", "key": "Key", "kms_key_arn": "KmsKeyArn", "role_arn": "RoleArn", "schema": "Schema", "tags": "Tags", "value": "Value", }) opts = opts.WithCreateTimeoutInMinutes(0).WithDeleteTimeoutInMinutes(0) opts = opts.WithUpdateTimeoutInMinutes(0) resourceType, err := NewResourceType(ctx, opts...) if err != nil { return nil, err } return resourceType, nil }