// Code generated by generators/resource/main.go; DO NOT EDIT. package billingconductor 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_billingconductor_pricing_plan", pricingPlanResourceType) } // pricingPlanResourceType returns the Terraform awscc_billingconductor_pricing_plan resource type. // This Terraform resource type corresponds to the CloudFormation AWS::BillingConductor::PricingPlan resource type. func pricingPlanResourceType(ctx context.Context) (tfsdk.ResourceType, error) { attributes := map[string]tfsdk.Attribute{ "arn": { // Property: Arn // CloudFormation resource type schema: // { // "description": "Pricing Plan ARN", // "pattern": "arn:aws(-cn)?:billingconductor::[0-9]{12}:pricingplan/[a-zA-Z0-9]{10}", // "type": "string" // } Description: "Pricing Plan ARN", Type: types.StringType, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), }, }, "creation_time": { // Property: CreationTime // CloudFormation resource type schema: // { // "description": "Creation timestamp in UNIX epoch time format", // "type": "integer" // } Description: "Creation timestamp in UNIX epoch time format", Type: types.Int64Type, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), }, }, "description": { // Property: Description // CloudFormation resource type schema: // { // "maxLength": 1024, // "type": "string" // } Type: types.StringType, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(1024), }, }, "last_modified_time": { // Property: LastModifiedTime // CloudFormation resource type schema: // { // "description": "Latest modified timestamp in UNIX epoch time format", // "type": "integer" // } Description: "Latest modified timestamp in UNIX epoch time format", Type: types.Int64Type, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), }, }, "name": { // Property: Name // CloudFormation resource type schema: // { // "maxLength": 128, // "minLength": 1, // "pattern": "[a-zA-Z0-9_\\+=\\.\\-@]+", // "type": "string" // } Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9_\\+=\\.\\-@]+"), ""), }, }, "pricing_rule_arns": { // Property: PricingRuleArns // CloudFormation resource type schema: // { // "insertionOrder": false, // "items": { // "description": "Pricing Rule ARN", // "pattern": "arn:aws(-cn)?:billingconductor::[0-9]{12}:pricingrule/[a-zA-Z0-9]{10}", // "type": "string" // }, // "type": "array" // } Type: types.ListType{ElemType: types.StringType}, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("arn:aws(-cn)?:billingconductor::[0-9]{12}:pricingrule/[a-zA-Z0-9]{10}"), "")), }, PlanModifiers: []tfsdk.AttributePlanModifier{ Multiset(), }, }, "size": { // Property: Size // CloudFormation resource type schema: // { // "description": "Number of associated pricing rules", // "type": "integer" // } Description: "Number of associated pricing rules", Type: types.Int64Type, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), }, }, "tags": { // Property: Tags // CloudFormation resource type schema: // { // "insertionOrder": false, // "items": { // "additionalProperties": false, // "properties": { // "Key": { // "maxLength": 128, // "minLength": 1, // "type": "string" // }, // "Value": { // "maxLength": 256, // "minLength": 1, // "type": "string" // } // }, // "required": [ // "Key", // "Value" // ], // "type": "object" // }, // "type": "array", // "uniqueItems": true // } Attributes: tfsdk.SetNestedAttributes( map[string]tfsdk.Attribute{ "key": { // Property: Key Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), }, }, "value": { // Property: Value Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), }, }, }, tfsdk.SetNestedAttributesOptions{}, ), Optional: true, }, } attributes["id"] = tfsdk.Attribute{ Description: "Uniquely identifies the resource.", Type: types.StringType, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), }, } schema := tfsdk.Schema{ Description: "Pricing Plan enables you to customize your billing details consistent with the usage that accrues in each of your billing groups.", Version: 1, Attributes: attributes, } var opts ResourceTypeOptions opts = opts.WithCloudFormationTypeName("AWS::BillingConductor::PricingPlan").WithTerraformTypeName("awscc_billingconductor_pricing_plan") opts = opts.WithTerraformSchema(schema) opts = opts.WithSyntheticIDAttribute(true) opts = opts.WithAttributeNameMap(map[string]string{ "arn": "Arn", "creation_time": "CreationTime", "description": "Description", "key": "Key", "last_modified_time": "LastModifiedTime", "name": "Name", "pricing_rule_arns": "PricingRuleArns", "size": "Size", "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 }