// Code generated by generators/resource/main.go; DO NOT EDIT. package ecr 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_ecr_pull_through_cache_rule", pullThroughCacheRuleResourceType) } // pullThroughCacheRuleResourceType returns the Terraform awscc_ecr_pull_through_cache_rule resource type. // This Terraform resource type corresponds to the CloudFormation AWS::ECR::PullThroughCacheRule resource type. func pullThroughCacheRuleResourceType(ctx context.Context) (tfsdk.ResourceType, error) { attributes := map[string]tfsdk.Attribute{ "ecr_repository_prefix": { // Property: EcrRepositoryPrefix // CloudFormation resource type schema: // { // "description": "The ECRRepositoryPrefix is a custom alias for upstream registry url.", // "maxLength": 20, // "minLength": 2, // "pattern": "^([a-z0-9]+(?:[._-][a-z0-9]+)*)$", // "type": "string" // } Description: "The ECRRepositoryPrefix is a custom alias for upstream registry url.", Type: types.StringType, Optional: true, Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(2, 20), validate.StringMatch(regexp.MustCompile("^([a-z0-9]+(?:[._-][a-z0-9]+)*)$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), tfsdk.RequiresReplace(), }, }, "upstream_registry_url": { // Property: UpstreamRegistryUrl // CloudFormation resource type schema: // { // "description": "The upstreamRegistryUrl is the endpoint of upstream registry url of the public repository to be cached", // "type": "string" // } Description: "The upstreamRegistryUrl is the endpoint of upstream registry url of the public repository to be cached", Type: types.StringType, Optional: true, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), 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: "The AWS::ECR::PullThroughCacheRule resource configures the upstream registry configuration details for an Amazon Elastic Container Registry (Amazon Private ECR) pull-through cache.", Version: 1, Attributes: attributes, } var opts ResourceTypeOptions opts = opts.WithCloudFormationTypeName("AWS::ECR::PullThroughCacheRule").WithTerraformTypeName("awscc_ecr_pull_through_cache_rule") opts = opts.WithTerraformSchema(schema) opts = opts.WithSyntheticIDAttribute(true) opts = opts.WithAttributeNameMap(map[string]string{ "ecr_repository_prefix": "EcrRepositoryPrefix", "upstream_registry_url": "UpstreamRegistryUrl", }) opts = opts.IsImmutableType(true) opts = opts.WithCreateTimeoutInMinutes(0).WithDeleteTimeoutInMinutes(0) resourceType, err := NewResourceType(ctx, opts...) if err != nil { return nil, err } return resourceType, nil }