// Code generated by generators/singular-data-source/main.go; DO NOT EDIT. package iam import ( "context" "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" ) func init() { registry.AddDataSourceTypeFactory("awscc_iam_role", roleDataSourceType) } // roleDataSourceType returns the Terraform awscc_iam_role data source type. // This Terraform data source type corresponds to the CloudFormation AWS::IAM::Role resource type. func roleDataSourceType(ctx context.Context) (tfsdk.DataSourceType, error) { attributes := map[string]tfsdk.Attribute{ "arn": { // Property: Arn // CloudFormation resource type schema: // { // "description": "The Amazon Resource Name (ARN) for the role.", // "type": "string" // } Description: "The Amazon Resource Name (ARN) for the role.", Type: types.StringType, Computed: true, }, "assume_role_policy_document": { // Property: AssumeRolePolicyDocument // CloudFormation resource type schema: // { // "description": "The trust policy that is associated with this role.", // "type": "string" // } Description: "The trust policy that is associated with this role.", Type: types.StringType, Computed: true, }, "description": { // Property: Description // CloudFormation resource type schema: // { // "description": "A description of the role that you provide.", // "maxLength": 1000, // "type": "string" // } Description: "A description of the role that you provide.", Type: types.StringType, Computed: true, }, "managed_policy_arns": { // Property: ManagedPolicyArns // CloudFormation resource type schema: // { // "description": "A list of Amazon Resource Names (ARNs) of the IAM managed policies that you want to attach to the role. ", // "insertionOrder": false, // "items": { // "type": "string" // }, // "type": "array", // "uniqueItems": true // } Description: "A list of Amazon Resource Names (ARNs) of the IAM managed policies that you want to attach to the role. ", Type: types.SetType{ElemType: types.StringType}, Computed: true, }, "max_session_duration": { // Property: MaxSessionDuration // CloudFormation resource type schema: // { // "description": "The maximum session duration (in seconds) that you want to set for the specified role. If you do not specify a value for this setting, the default maximum of one hour is applied. This setting can have a value from 1 hour to 12 hours. ", // "maximum": 43200, // "minimum": 3600, // "type": "integer" // } Description: "The maximum session duration (in seconds) that you want to set for the specified role. If you do not specify a value for this setting, the default maximum of one hour is applied. This setting can have a value from 1 hour to 12 hours. ", Type: types.Int64Type, Computed: true, }, "path": { // Property: Path // CloudFormation resource type schema: // { // "description": "The path to the role.", // "type": "string" // } Description: "The path to the role.", Type: types.StringType, Computed: true, }, "permissions_boundary": { // Property: PermissionsBoundary // CloudFormation resource type schema: // { // "description": "The ARN of the policy used to set the permissions boundary for the role.", // "type": "string" // } Description: "The ARN of the policy used to set the permissions boundary for the role.", Type: types.StringType, Computed: true, }, "policies": { // Property: Policies // CloudFormation resource type schema: // { // "description": "Adds or updates an inline policy document that is embedded in the specified IAM role. ", // "insertionOrder": false, // "items": { // "additionalProperties": false, // "description": "The inline policy document that is embedded in the specified IAM role.", // "properties": { // "PolicyDocument": { // "description": "The policy document.", // "type": "string" // }, // "PolicyName": { // "description": "The friendly name (not ARN) identifying the policy.", // "maxLength": 128, // "minLength": 1, // "type": "string" // } // }, // "required": [ // "PolicyName", // "PolicyDocument" // ], // "type": "object" // }, // "type": "array", // "uniqueItems": false // } Description: "Adds or updates an inline policy document that is embedded in the specified IAM role. ", Attributes: tfsdk.ListNestedAttributes( map[string]tfsdk.Attribute{ "policy_document": { // Property: PolicyDocument Description: "The policy document.", Type: types.StringType, Computed: true, }, "policy_name": { // Property: PolicyName Description: "The friendly name (not ARN) identifying the policy.", Type: types.StringType, Computed: true, }, }, tfsdk.ListNestedAttributesOptions{}, ), Computed: true, }, "role_id": { // Property: RoleId // CloudFormation resource type schema: // { // "description": "The stable and unique string identifying the role.", // "type": "string" // } Description: "The stable and unique string identifying the role.", Type: types.StringType, Computed: true, }, "role_name": { // Property: RoleName // CloudFormation resource type schema: // { // "description": "A name for the IAM role, up to 64 characters in length.", // "maxLength": 64, // "type": "string" // } Description: "A name for the IAM role, up to 64 characters in length.", Type: types.StringType, Computed: true, }, "tags": { // Property: Tags // CloudFormation resource type schema: // { // "description": "A list of tags that are attached to the role.", // "insertionOrder": false, // "items": { // "additionalProperties": false, // "description": "A key-value pair to associate with a resource.", // "properties": { // "Key": { // "description": "The key name of the tag. You can specify a value that is 1 to 128 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -.", // "maxLength": 128, // "minLength": 1, // "type": "string" // }, // "Value": { // "description": "The value for the tag. You can specify a value that is 0 to 256 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -.", // "maxLength": 256, // "minLength": 0, // "type": "string" // } // }, // "required": [ // "Key", // "Value" // ], // "type": "object" // }, // "type": "array", // "uniqueItems": false // } Description: "A list of tags that are attached to the role.", Attributes: tfsdk.ListNestedAttributes( map[string]tfsdk.Attribute{ "key": { // Property: Key Description: "The key name of the tag. You can specify a value that is 1 to 128 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -.", Type: types.StringType, Computed: true, }, "value": { // Property: Value Description: "The value for the tag. You can specify a value that is 0 to 256 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -.", Type: types.StringType, Computed: true, }, }, tfsdk.ListNestedAttributesOptions{}, ), Computed: true, }, } attributes["id"] = tfsdk.Attribute{ Description: "Uniquely identifies the resource.", Type: types.StringType, Required: true, } schema := tfsdk.Schema{ Description: "Data Source schema for AWS::IAM::Role", Version: 1, Attributes: attributes, } var opts DataSourceTypeOptions opts = opts.WithCloudFormationTypeName("AWS::IAM::Role").WithTerraformTypeName("awscc_iam_role") opts = opts.WithTerraformSchema(schema) opts = opts.WithAttributeNameMap(map[string]string{ "arn": "Arn", "assume_role_policy_document": "AssumeRolePolicyDocument", "description": "Description", "key": "Key", "managed_policy_arns": "ManagedPolicyArns", "max_session_duration": "MaxSessionDuration", "path": "Path", "permissions_boundary": "PermissionsBoundary", "policies": "Policies", "policy_document": "PolicyDocument", "policy_name": "PolicyName", "role_id": "RoleId", "role_name": "RoleName", "tags": "Tags", "value": "Value", }) singularDataSourceType, err := NewSingularDataSourceType(ctx, opts...) if err != nil { return nil, err } return singularDataSourceType, nil }