// Code generated by generators/resource/main.go; DO NOT EDIT. package globalaccelerator 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_globalaccelerator_accelerator", acceleratorResourceType) } // acceleratorResourceType returns the Terraform awscc_globalaccelerator_accelerator resource type. // This Terraform resource type corresponds to the CloudFormation AWS::GlobalAccelerator::Accelerator resource type. func acceleratorResourceType(ctx context.Context) (tfsdk.ResourceType, error) { attributes := map[string]tfsdk.Attribute{ "accelerator_arn": { // Property: AcceleratorArn // CloudFormation resource type schema: // { // "description": "The Amazon Resource Name (ARN) of the accelerator.", // "type": "string" // } Description: "The Amazon Resource Name (ARN) of the accelerator.", Type: types.StringType, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), }, }, "dns_name": { // Property: DnsName // CloudFormation resource type schema: // { // "description": "The Domain Name System (DNS) name that Global Accelerator creates that points to your accelerator's static IP addresses.", // "type": "string" // } Description: "The Domain Name System (DNS) name that Global Accelerator creates that points to your accelerator's static IP addresses.", Type: types.StringType, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), }, }, "enabled": { // Property: Enabled // CloudFormation resource type schema: // { // "default": true, // "description": "Indicates whether an accelerator is enabled. The value is true or false.", // "type": "boolean" // } Description: "Indicates whether an accelerator is enabled. The value is true or false.", Type: types.BoolType, Optional: true, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ DefaultValue(types.Bool{Value: true}), tfsdk.UseStateForUnknown(), }, }, "ip_address_type": { // Property: IpAddressType // CloudFormation resource type schema: // { // "default": "IPV4", // "description": "IP Address type.", // "enum": [ // "IPV4", // "IPV6" // ], // "type": "string" // } Description: "IP Address type.", Type: types.StringType, Optional: true, Computed: true, Validators: []tfsdk.AttributeValidator{ validate.StringInSlice([]string{ "IPV4", "IPV6", }), }, PlanModifiers: []tfsdk.AttributePlanModifier{ DefaultValue(types.String{Value: "IPV4"}), tfsdk.UseStateForUnknown(), }, }, "ip_addresses": { // Property: IpAddresses // CloudFormation resource type schema: // { // "description": "The IP addresses from BYOIP Prefix pool.", // "items": { // "description": "The IP addresses from BYOIP Prefix pool.", // "pattern": "^(?:[0-9]{1,3}\\.){3}[0-9]{1,3}$", // "type": "string" // }, // "type": "array" // } Description: "The IP addresses from BYOIP Prefix pool.", Type: types.ListType{ElemType: types.StringType}, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.ArrayForEach(validate.StringMatch(regexp.MustCompile("^(?:[0-9]{1,3}\\.){3}[0-9]{1,3}$"), "")), }, }, "name": { // Property: Name // CloudFormation resource type schema: // { // "description": "Name of accelerator.", // "maxLength": 64, // "minLength": 1, // "pattern": "^[a-zA-Z0-9_-]{0,64}$", // "type": "string" // } Description: "Name of accelerator.", Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 64), validate.StringMatch(regexp.MustCompile("^[a-zA-Z0-9_-]{0,64}$"), ""), }, }, "tags": { // Property: Tags // CloudFormation resource type schema: // { // "items": { // "additionalProperties": false, // "description": "Tag is a key-value pair associated with accelerator.", // "properties": { // "Key": { // "description": "Key of the tag. Value can be 1 to 127 characters.", // "maxLength": 127, // "minLength": 1, // "type": "string" // }, // "Value": { // "description": "Value for the tag. Value can be 1 to 255 characters.", // "maxLength": 255, // "minLength": 1, // "type": "string" // } // }, // "required": [ // "Value", // "Key" // ], // "type": "object" // }, // "type": "array" // } Attributes: tfsdk.ListNestedAttributes( map[string]tfsdk.Attribute{ "key": { // Property: Key Description: "Key of the tag. Value can be 1 to 127 characters.", Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 127), }, }, "value": { // Property: Value Description: "Value for the tag. Value can be 1 to 255 characters.", Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 255), }, }, }, tfsdk.ListNestedAttributesOptions{}, ), 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: "Resource Type definition for AWS::GlobalAccelerator::Accelerator", Version: 1, Attributes: attributes, } var opts ResourceTypeOptions opts = opts.WithCloudFormationTypeName("AWS::GlobalAccelerator::Accelerator").WithTerraformTypeName("awscc_globalaccelerator_accelerator") opts = opts.WithTerraformSchema(schema) opts = opts.WithSyntheticIDAttribute(true) opts = opts.WithAttributeNameMap(map[string]string{ "accelerator_arn": "AcceleratorArn", "dns_name": "DnsName", "enabled": "Enabled", "ip_address_type": "IpAddressType", "ip_addresses": "IpAddresses", "key": "Key", "name": "Name", "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 }