// Code generated by generators/resource/main.go; DO NOT EDIT. package timestream 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_timestream_table", tableResourceType) } // tableResourceType returns the Terraform awscc_timestream_table resource type. // This Terraform resource type corresponds to the CloudFormation AWS::Timestream::Table resource type. func tableResourceType(ctx context.Context) (tfsdk.ResourceType, error) { attributes := map[string]tfsdk.Attribute{ "arn": { // Property: Arn // CloudFormation resource type schema: // { // "type": "string" // } Type: types.StringType, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), }, }, "database_name": { // Property: DatabaseName // CloudFormation resource type schema: // { // "description": "The name for the database which the table to be created belongs to.", // "pattern": "^[a-zA-Z0-9_.-]{3,256}$", // "type": "string" // } Description: "The name for the database which the table to be created belongs to.", Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9_.-]{3,256}$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, }, "magnetic_store_write_properties": { // Property: MagneticStoreWriteProperties // CloudFormation resource type schema: // { // "additionalProperties": false, // "description": "The properties that determine whether magnetic store writes are enabled.", // "properties": { // "EnableMagneticStoreWrites": { // "description": "Boolean flag indicating whether magnetic store writes are enabled.", // "type": "boolean" // }, // "MagneticStoreRejectedDataLocation": { // "additionalProperties": false, // "description": "Location to store information about records that were asynchronously rejected during magnetic store writes.", // "properties": { // "S3Configuration": { // "additionalProperties": false, // "description": "S3 configuration for location to store rejections from magnetic store writes", // "properties": { // "BucketName": { // "description": "The bucket name used to store the data.", // "type": "string" // }, // "EncryptionOption": { // "description": "Either SSE_KMS or SSE_S3.", // "type": "string" // }, // "KmsKeyId": { // "description": "Must be provided if SSE_KMS is specified as the encryption option", // "type": "string" // }, // "ObjectKeyPrefix": { // "description": "String used to prefix all data in the bucket.", // "type": "string" // } // }, // "required": [ // "EncryptionOption", // "BucketName" // ], // "type": "object" // } // }, // "type": "object" // } // }, // "required": [ // "EnableMagneticStoreWrites" // ], // "type": "object" // } Description: "The properties that determine whether magnetic store writes are enabled.", Attributes: tfsdk.SingleNestedAttributes( map[string]tfsdk.Attribute{ "enable_magnetic_store_writes": { // Property: EnableMagneticStoreWrites Description: "Boolean flag indicating whether magnetic store writes are enabled.", Type: types.BoolType, Required: true, }, "magnetic_store_rejected_data_location": { // Property: MagneticStoreRejectedDataLocation Description: "Location to store information about records that were asynchronously rejected during magnetic store writes.", Attributes: tfsdk.SingleNestedAttributes( map[string]tfsdk.Attribute{ "s3_configuration": { // Property: S3Configuration Description: "S3 configuration for location to store rejections from magnetic store writes", Attributes: tfsdk.SingleNestedAttributes( map[string]tfsdk.Attribute{ "bucket_name": { // Property: BucketName Description: "The bucket name used to store the data.", Type: types.StringType, Required: true, }, "encryption_option": { // Property: EncryptionOption Description: "Either SSE_KMS or SSE_S3.", Type: types.StringType, Required: true, }, "kms_key_id": { // Property: KmsKeyId Description: "Must be provided if SSE_KMS is specified as the encryption option", Type: types.StringType, Optional: true, }, "object_key_prefix": { // Property: ObjectKeyPrefix Description: "String used to prefix all data in the bucket.", Type: types.StringType, Optional: true, }, }, ), Optional: true, }, }, ), Optional: true, }, }, ), Optional: true, }, "name": { // Property: Name // CloudFormation resource type schema: // { // "description": "The table name exposed as a read-only attribute.", // "type": "string" // } Description: "The table name exposed as a read-only attribute.", Type: types.StringType, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), }, }, "retention_properties": { // Property: RetentionProperties // CloudFormation resource type schema: // { // "additionalProperties": false, // "description": "The retention duration of the memory store and the magnetic store.", // "properties": { // "MagneticStoreRetentionPeriodInDays": { // "description": "The duration for which data must be stored in the magnetic store.", // "type": "string" // }, // "MemoryStoreRetentionPeriodInHours": { // "description": "The duration for which data must be stored in the memory store.", // "type": "string" // } // }, // "type": "object" // } Description: "The retention duration of the memory store and the magnetic store.", Attributes: tfsdk.SingleNestedAttributes( map[string]tfsdk.Attribute{ "magnetic_store_retention_period_in_days": { // Property: MagneticStoreRetentionPeriodInDays Description: "The duration for which data must be stored in the magnetic store.", Type: types.StringType, Optional: true, }, "memory_store_retention_period_in_hours": { // Property: MemoryStoreRetentionPeriodInHours Description: "The duration for which data must be stored in the memory store.", Type: types.StringType, Optional: true, }, }, ), Optional: true, }, "table_name": { // Property: TableName // CloudFormation resource type schema: // { // "description": "The name for the table. If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the table name.", // "pattern": "^[a-zA-Z0-9_.-]{3,256}$", // "type": "string" // } Description: "The name for the table. If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the table name.", Type: types.StringType, Optional: true, Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9_.-]{3,256}$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ 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": "You can use the Resource Tags property to apply tags to resources, which can help you identify and categorize those resources.", // "properties": { // "Key": { // "maxLength": 128, // "minLength": 1, // "type": "string" // }, // "Value": { // "maxLength": 256, // "minLength": 0, // "type": "string" // } // }, // "type": "object" // }, // "maxItems": 200, // "type": "array" // } Description: "An array of key-value pairs to apply to this resource.", Attributes: tfsdk.ListNestedAttributes( map[string]tfsdk.Attribute{ "key": { // Property: Key Type: types.StringType, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), }, }, "value": { // Property: Value Type: types.StringType, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 256), }, }, }, tfsdk.ListNestedAttributesOptions{}, ), Optional: true, Validators: []tfsdk.AttributeValidator{ validate.ArrayLenAtMost(200), }, PlanModifiers: []tfsdk.AttributePlanModifier{ Multiset(), }, }, } attributes["id"] = tfsdk.Attribute{ Description: "Uniquely identifies the resource.", Type: types.StringType, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), }, } schema := tfsdk.Schema{ Description: "The AWS::Timestream::Table resource creates a Timestream Table.", Version: 1, Attributes: attributes, } var opts ResourceTypeOptions opts = opts.WithCloudFormationTypeName("AWS::Timestream::Table").WithTerraformTypeName("awscc_timestream_table") opts = opts.WithTerraformSchema(schema) opts = opts.WithSyntheticIDAttribute(true) opts = opts.WithAttributeNameMap(map[string]string{ "arn": "Arn", "bucket_name": "BucketName", "database_name": "DatabaseName", "enable_magnetic_store_writes": "EnableMagneticStoreWrites", "encryption_option": "EncryptionOption", "key": "Key", "kms_key_id": "KmsKeyId", "magnetic_store_rejected_data_location": "MagneticStoreRejectedDataLocation", "magnetic_store_retention_period_in_days": "MagneticStoreRetentionPeriodInDays", "magnetic_store_write_properties": "MagneticStoreWriteProperties", "memory_store_retention_period_in_hours": "MemoryStoreRetentionPeriodInHours", "name": "Name", "object_key_prefix": "ObjectKeyPrefix", "retention_properties": "RetentionProperties", "s3_configuration": "S3Configuration", "table_name": "TableName", "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 }