// Code generated by generators/resource/main.go; DO NOT EDIT. package cloudformation 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_cloudformation_hook_version", hookVersionResourceType) } // hookVersionResourceType returns the Terraform awscc_cloudformation_hook_version resource type. // This Terraform resource type corresponds to the CloudFormation AWS::CloudFormation::HookVersion resource type. func hookVersionResourceType(ctx context.Context) (tfsdk.ResourceType, error) { attributes := map[string]tfsdk.Attribute{ "arn": { // Property: Arn // CloudFormation resource type schema: // { // "description": "The Amazon Resource Name (ARN) of the type, here the HookVersion. This is used to uniquely identify a HookVersion resource", // "pattern": "^arn:aws[A-Za-z0-9-]{0,64}:cloudformation:[A-Za-z0-9-]{1,64}:([0-9]{12})?:type/hook/.+$", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of the type, here the HookVersion. This is used to uniquely identify a HookVersion resource", Type: types.StringType, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), }, }, "execution_role_arn": { // Property: ExecutionRoleArn // CloudFormation resource type schema: // { // "description": "The Amazon Resource Name (ARN) of the IAM execution role to use to register the type. If your resource type calls AWS APIs in any of its handlers, you must create an IAM execution role that includes the necessary permissions to call those AWS APIs, and provision that execution role in your account. CloudFormation then assumes that execution role to provide your resource type with the appropriate credentials.", // "maxLength": 256, // "pattern": "arn:.+:iam::[0-9]{12}:role/.+", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of the IAM execution role to use to register the type. If your resource type calls AWS APIs in any of its handlers, you must create an IAM execution role that includes the necessary permissions to call those AWS APIs, and provision that execution role in your account. CloudFormation then assumes that execution role to provide your resource type with the appropriate credentials.", Type: types.StringType, Optional: true, Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(256), validate.StringMatch(regexp.MustCompile("arn:.+:iam::[0-9]{12}:role/.+"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), tfsdk.RequiresReplace(), }, }, "is_default_version": { // Property: IsDefaultVersion // CloudFormation resource type schema: // { // "description": "Indicates if this type version is the current default version", // "type": "boolean" // } Description: "Indicates if this type version is the current default version", Type: types.BoolType, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), }, }, "logging_config": { // Property: LoggingConfig // CloudFormation resource type schema: // { // "additionalProperties": false, // "description": "Specifies logging configuration information for a type.", // "properties": { // "LogGroupName": { // "description": "The Amazon CloudWatch log group to which CloudFormation sends error logging information when invoking the type's handlers.", // "maxLength": 512, // "minLength": 1, // "pattern": "^[\\.\\-_/#A-Za-z0-9]+$", // "type": "string" // }, // "LogRoleArn": { // "description": "The ARN of the role that CloudFormation should assume when sending log entries to CloudWatch logs.", // "maxLength": 256, // "minLength": 1, // "type": "string" // } // }, // "type": "object" // } Description: "Specifies logging configuration information for a type.", Attributes: tfsdk.SingleNestedAttributes( map[string]tfsdk.Attribute{ "log_group_name": { // Property: LogGroupName Description: "The Amazon CloudWatch log group to which CloudFormation sends error logging information when invoking the type's handlers.", Type: types.StringType, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 512), validate.StringMatch(regexp.MustCompile("^[\\.\\-_/#A-Za-z0-9]+$"), ""), }, }, "log_role_arn": { // Property: LogRoleArn Description: "The ARN of the role that CloudFormation should assume when sending log entries to CloudWatch logs.", Type: types.StringType, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 256), }, }, }, ), Optional: true, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), tfsdk.RequiresReplace(), }, }, "schema_handler_package": { // Property: SchemaHandlerPackage // CloudFormation resource type schema: // { // "description": "A url to the S3 bucket containing the schema handler package that contains the schema, event handlers, and associated files for the type you want to register.\n\nFor information on generating a schema handler package for the type you want to register, see submit in the CloudFormation CLI User Guide.", // "maxLength": 4096, // "type": "string" // } Description: "A url to the S3 bucket containing the schema handler package that contains the schema, event handlers, and associated files for the type you want to register.\n\nFor information on generating a schema handler package for the type you want to register, see submit in the CloudFormation CLI User Guide.", Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenAtMost(4096), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, // SchemaHandlerPackage is a write-only property. }, "type_arn": { // Property: TypeArn // CloudFormation resource type schema: // { // "description": "The Amazon Resource Name (ARN) of the type without the versionID.", // "pattern": "^arn:aws[A-Za-z0-9-]{0,64}:cloudformation:[A-Za-z0-9-]{1,64}:([0-9]{12})?:type/hook/.+$", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of the type without the versionID.", Type: types.StringType, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), }, }, "type_name": { // Property: TypeName // CloudFormation resource type schema: // { // "description": "The name of the type being registered.\n\nWe recommend that type names adhere to the following pattern: company_or_organization::service::type.", // "pattern": "^[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}$", // "type": "string" // } Description: "The name of the type being registered.\n\nWe recommend that type names adhere to the following pattern: company_or_organization::service::type.", Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringMatch(regexp.MustCompile("^[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}$"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, }, "version_id": { // Property: VersionId // CloudFormation resource type schema: // { // "description": "The ID of the version of the type represented by this hook instance.", // "pattern": "^[A-Za-z0-9-]{1,128}$", // "type": "string" // } Description: "The ID of the version of the type represented by this hook instance.", Type: types.StringType, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), }, }, "visibility": { // Property: Visibility // CloudFormation resource type schema: // { // "description": "The scope at which the type is visible and usable in CloudFormation operations.\n\nValid values include:\n\nPRIVATE: The type is only visible and usable within the account in which it is registered. Currently, AWS CloudFormation marks any types you register as PRIVATE.\n\nPUBLIC: The type is publically visible and usable within any Amazon account.", // "enum": [ // "PUBLIC", // "PRIVATE" // ], // "type": "string" // } Description: "The scope at which the type is visible and usable in CloudFormation operations.\n\nValid values include:\n\nPRIVATE: The type is only visible and usable within the account in which it is registered. Currently, AWS CloudFormation marks any types you register as PRIVATE.\n\nPUBLIC: The type is publically visible and usable within any Amazon account.", 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: "Publishes new or first hook version to AWS CloudFormation Registry.", Version: 1, Attributes: attributes, } var opts ResourceTypeOptions opts = opts.WithCloudFormationTypeName("AWS::CloudFormation::HookVersion").WithTerraformTypeName("awscc_cloudformation_hook_version") opts = opts.WithTerraformSchema(schema) opts = opts.WithSyntheticIDAttribute(true) opts = opts.WithAttributeNameMap(map[string]string{ "arn": "Arn", "execution_role_arn": "ExecutionRoleArn", "is_default_version": "IsDefaultVersion", "log_group_name": "LogGroupName", "log_role_arn": "LogRoleArn", "logging_config": "LoggingConfig", "schema_handler_package": "SchemaHandlerPackage", "type_arn": "TypeArn", "type_name": "TypeName", "version_id": "VersionId", "visibility": "Visibility", }) opts = opts.WithWriteOnlyPropertyPaths([]string{ "/properties/SchemaHandlerPackage", }) opts = opts.WithCreateTimeoutInMinutes(0).WithDeleteTimeoutInMinutes(0) opts = opts.WithUpdateTimeoutInMinutes(0) resourceType, err := NewResourceType(ctx, opts...) if err != nil { return nil, err } return resourceType, nil }