// Code generated by generators/resource/main.go; DO NOT EDIT. package sso 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_sso_permission_set", permissionSetResourceType) } // permissionSetResourceType returns the Terraform awscc_sso_permission_set resource type. // This Terraform resource type corresponds to the CloudFormation AWS::SSO::PermissionSet resource type. func permissionSetResourceType(ctx context.Context) (tfsdk.ResourceType, error) { attributes := map[string]tfsdk.Attribute{ "description": { // Property: Description // CloudFormation resource type schema: // { // "description": "The permission set description.", // "maxLength": 700, // "minLength": 1, // "pattern": "[\\p{L}\\p{M}\\p{Z}\\p{S}\\p{N}\\p{P}]*", // "type": "string" // } Description: "The permission set description.", Type: types.StringType, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 700), validate.StringMatch(regexp.MustCompile("[\\p{L}\\p{M}\\p{Z}\\p{S}\\p{N}\\p{P}]*"), ""), }, }, "inline_policy": { // Property: InlinePolicy // CloudFormation resource type schema: // { // "description": "The inline policy to put in permission set.", // "type": "string" // } Description: "The inline policy to put in permission set.", Type: types.StringType, Optional: true, }, "instance_arn": { // Property: InstanceArn // CloudFormation resource type schema: // { // "description": "The sso instance arn that the permission set is owned.", // "maxLength": 1224, // "minLength": 10, // "pattern": "arn:(aws|aws-us-gov|aws-cn|aws-iso|aws-iso-b):sso:::instance/(sso)?ins-[a-zA-Z0-9-.]{16}", // "type": "string" // } Description: "The sso instance arn that the permission set is owned.", Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(10, 1224), validate.StringMatch(regexp.MustCompile("arn:(aws|aws-us-gov|aws-cn|aws-iso|aws-iso-b):sso:::instance/(sso)?ins-[a-zA-Z0-9-.]{16}"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, }, "managed_policies": { // Property: ManagedPolicies // CloudFormation resource type schema: // { // "insertionOrder": false, // "items": { // "description": "The managed policy to attach.", // "maxLength": 2048, // "minLength": 20, // "type": "string" // }, // "maxItems": 20, // "type": "array" // } Type: types.ListType{ElemType: types.StringType}, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.ArrayLenAtMost(20), validate.ArrayForEach(validate.StringLenBetween(20, 2048)), }, PlanModifiers: []tfsdk.AttributePlanModifier{ Multiset(), }, }, "name": { // Property: Name // CloudFormation resource type schema: // { // "description": "The name you want to assign to this permission set.", // "maxLength": 32, // "minLength": 1, // "pattern": "[\\w+=,.@-]+", // "type": "string" // } Description: "The name you want to assign to this permission set.", Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 32), validate.StringMatch(regexp.MustCompile("[\\w+=,.@-]+"), ""), }, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.RequiresReplace(), }, }, "permission_set_arn": { // Property: PermissionSetArn // CloudFormation resource type schema: // { // "description": "The permission set that the policy will be attached to", // "maxLength": 1224, // "minLength": 10, // "pattern": "arn:(aws|aws-us-gov|aws-cn|aws-iso|aws-iso-b):sso:::permissionSet/(sso)?ins-[a-zA-Z0-9-.]{16}/ps-[a-zA-Z0-9-./]{16}", // "type": "string" // } Description: "The permission set that the policy will be attached to", Type: types.StringType, Computed: true, PlanModifiers: []tfsdk.AttributePlanModifier{ tfsdk.UseStateForUnknown(), }, }, "relay_state_type": { // Property: RelayStateType // CloudFormation resource type schema: // { // "description": "The relay state URL that redirect links to any service in the AWS Management Console.", // "maxLength": 240, // "minLength": 1, // "pattern": "[a-zA-Z0-9\u0026amp;$@#\\/%?=~\\-_'\u0026quot;|!:,.;*+\\[\\]\\ \\(\\)\\{\\}]+", // "type": "string" // } Description: "The relay state URL that redirect links to any service in the AWS Management Console.", Type: types.StringType, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 240), validate.StringMatch(regexp.MustCompile("[a-zA-Z0-9&$@#\\/%?=~\\-_'"|!:,.;*+\\[\\]\\ \\(\\)\\{\\}]+"), ""), }, }, "session_duration": { // Property: SessionDuration // CloudFormation resource type schema: // { // "description": "The length of time that a user can be signed in to an AWS account.", // "maxLength": 100, // "minLength": 1, // "pattern": "", // "type": "string" // } Description: "The length of time that a user can be signed in to an AWS account.", Type: types.StringType, Optional: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 100), }, }, "tags": { // Property: Tags // CloudFormation resource type schema: // { // "insertionOrder": false, // "items": { // "additionalProperties": false, // "description": "The metadata that you apply to the permission set to help you categorize and organize them.", // "properties": { // "Key": { // "maxLength": 128, // "minLength": 1, // "pattern": "[\\w+=,.@-]+", // "type": "string" // }, // "Value": { // "maxLength": 256, // "minLength": 0, // "pattern": "[\\w+=,.@-]+", // "type": "string" // } // }, // "required": [ // "Key", // "Value" // ], // "type": "object" // }, // "maxItems": 50, // "type": "array" // } Attributes: tfsdk.ListNestedAttributes( map[string]tfsdk.Attribute{ "key": { // Property: Key Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(1, 128), validate.StringMatch(regexp.MustCompile("[\\w+=,.@-]+"), ""), }, }, "value": { // Property: Value Type: types.StringType, Required: true, Validators: []tfsdk.AttributeValidator{ validate.StringLenBetween(0, 256), validate.StringMatch(regexp.MustCompile("[\\w+=,.@-]+"), ""), }, }, }, tfsdk.ListNestedAttributesOptions{}, ), Optional: true, Validators: []tfsdk.AttributeValidator{ validate.ArrayLenAtMost(50), }, 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: "Resource Type definition for SSO PermissionSet", Version: 1, Attributes: attributes, } var opts ResourceTypeOptions opts = opts.WithCloudFormationTypeName("AWS::SSO::PermissionSet").WithTerraformTypeName("awscc_sso_permission_set") opts = opts.WithTerraformSchema(schema) opts = opts.WithSyntheticIDAttribute(true) opts = opts.WithAttributeNameMap(map[string]string{ "description": "Description", "inline_policy": "InlinePolicy", "instance_arn": "InstanceArn", "key": "Key", "managed_policies": "ManagedPolicies", "name": "Name", "permission_set_arn": "PermissionSetArn", "relay_state_type": "RelayStateType", "session_duration": "SessionDuration", "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 }