1. Packages
  2. AWS Native
  3. API Docs
  4. iam
  5. Role

AWS Native is in preview. AWS Classic is fully supported.

AWS Native v0.100.0 published on Wednesday, Mar 27, 2024 by Pulumi

aws-native.iam.Role

Explore with Pulumi AI

aws-native logo

AWS Native is in preview. AWS Classic is fully supported.

AWS Native v0.100.0 published on Wednesday, Mar 27, 2024 by Pulumi

    Creates a new role for your AWS-account. For more information about roles, see IAM roles in the IAM User Guide. For information about quotas for role names and the number of roles you can create, see IAM and quotas in the IAM User Guide.

    Example Usage

    Example

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AwsNative = Pulumi.AwsNative;
    
    return await Deployment.RunAsync(() => 
    {
        var iamRole = new AwsNative.Iam.Role("iamRole", new()
        {
            AssumeRolePolicyDocument = 
            {
                { "version", "2012-10-17" },
                { "statement", new[]
                {
                    
                    {
                        { "effect", "Allow" },
                        { "principal", 
                        {
                            { "service", new[]
                            {
                                "cloudformation.amazonaws.com",
                                "gamelift.amazonaws.com",
                            } },
                        } },
                        { "action", "sts:AssumeRole" },
                    },
                } },
            },
            RoleName = "ScriptIAMRole",
            Policies = new[]
            {
                new AwsNative.Iam.Inputs.RolePolicyArgs
                {
                    PolicyName = "ScriptResourceIAMPolicy",
                    PolicyDocument = 
                    {
                        { "version", "2012-10-17" },
                        { "statement", new[]
                        {
                            
                            {
                                { "effect", "Allow" },
                                { "action", new[]
                                {
                                    "s3:GetObject",
                                    "s3:GetObjectVersion",
                                    "s3:GetObjectMetadata",
                                    "s3:*Object*",
                                } },
                                { "resource", new[]
                                {
                                    "*",
                                } },
                            },
                        } },
                    },
                },
            },
        });
    
        var scriptResource = new AwsNative.GameLift.Script("scriptResource", new()
        {
            Name = "MyRealtimeScript",
            Version = "v1.0",
            StorageLocation = new AwsNative.GameLift.Inputs.ScriptS3LocationArgs
            {
                Bucket = "MyBucketName",
                Key = "MyScriptFiles.zip",
                RoleArn = iamRole.Arn,
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws-native/sdk/go/aws/gamelift"
    	"github.com/pulumi/pulumi-aws-native/sdk/go/aws/iam"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		iamRole, err := iam.NewRole(ctx, "iamRole", &iam.RoleArgs{
    			AssumeRolePolicyDocument: pulumi.Any{
    				Version: "2012-10-17",
    				Statement: []map[string]interface{}{
    					map[string]interface{}{
    						"effect": "Allow",
    						"principal": map[string]interface{}{
    							"service": []string{
    								"cloudformation.amazonaws.com",
    								"gamelift.amazonaws.com",
    							},
    						},
    						"action": "sts:AssumeRole",
    					},
    				},
    			},
    			RoleName: pulumi.String("ScriptIAMRole"),
    			Policies: iam.RolePolicyTypeArray{
    				&iam.RolePolicyTypeArgs{
    					PolicyName: pulumi.String("ScriptResourceIAMPolicy"),
    					PolicyDocument: pulumi.Any{
    						Version: "2012-10-17",
    						Statement: []map[string]interface{}{
    							map[string]interface{}{
    								"effect": "Allow",
    								"action": []string{
    									"s3:GetObject",
    									"s3:GetObjectVersion",
    									"s3:GetObjectMetadata",
    									"s3:*Object*",
    								},
    								"resource": []string{
    									"*",
    								},
    							},
    						},
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = gamelift.NewScript(ctx, "scriptResource", &gamelift.ScriptArgs{
    			Name:    pulumi.String("MyRealtimeScript"),
    			Version: pulumi.String("v1.0"),
    			StorageLocation: &gamelift.ScriptS3LocationArgs{
    				Bucket:  pulumi.String("MyBucketName"),
    				Key:     pulumi.String("MyScriptFiles.zip"),
    				RoleArn: iamRole.Arn,
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    

    Coming soon!

    import pulumi
    import pulumi_aws_native as aws_native
    
    iam_role = aws_native.iam.Role("iamRole",
        assume_role_policy_document={
            "version": "2012-10-17",
            "statement": [{
                "effect": "Allow",
                "principal": {
                    "service": [
                        "cloudformation.amazonaws.com",
                        "gamelift.amazonaws.com",
                    ],
                },
                "action": "sts:AssumeRole",
            }],
        },
        role_name="ScriptIAMRole",
        policies=[aws_native.iam.RolePolicyArgs(
            policy_name="ScriptResourceIAMPolicy",
            policy_document={
                "version": "2012-10-17",
                "statement": [{
                    "effect": "Allow",
                    "action": [
                        "s3:GetObject",
                        "s3:GetObjectVersion",
                        "s3:GetObjectMetadata",
                        "s3:*Object*",
                    ],
                    "resource": ["*"],
                }],
            },
        )])
    script_resource = aws_native.gamelift.Script("scriptResource",
        name="MyRealtimeScript",
        version="v1.0",
        storage_location=aws_native.gamelift.ScriptS3LocationArgs(
            bucket="MyBucketName",
            key="MyScriptFiles.zip",
            role_arn=iam_role.arn,
        ))
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aws_native from "@pulumi/aws-native";
    
    const iamRole = new aws_native.iam.Role("iamRole", {
        assumeRolePolicyDocument: {
            version: "2012-10-17",
            statement: [{
                effect: "Allow",
                principal: {
                    service: [
                        "cloudformation.amazonaws.com",
                        "gamelift.amazonaws.com",
                    ],
                },
                action: "sts:AssumeRole",
            }],
        },
        roleName: "ScriptIAMRole",
        policies: [{
            policyName: "ScriptResourceIAMPolicy",
            policyDocument: {
                version: "2012-10-17",
                statement: [{
                    effect: "Allow",
                    action: [
                        "s3:GetObject",
                        "s3:GetObjectVersion",
                        "s3:GetObjectMetadata",
                        "s3:*Object*",
                    ],
                    resource: ["*"],
                }],
            },
        }],
    });
    const scriptResource = new aws_native.gamelift.Script("scriptResource", {
        name: "MyRealtimeScript",
        version: "v1.0",
        storageLocation: {
            bucket: "MyBucketName",
            key: "MyScriptFiles.zip",
            roleArn: iamRole.arn,
        },
    });
    

    Coming soon!

    Example

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AwsNative = Pulumi.AwsNative;
    
    return await Deployment.RunAsync(() => 
    {
        var iamRole = new AwsNative.Iam.Role("iamRole", new()
        {
            AssumeRolePolicyDocument = 
            {
                { "version", "2012-10-17" },
                { "statement", new[]
                {
                    
                    {
                        { "effect", "Allow" },
                        { "principal", 
                        {
                            { "service", new[]
                            {
                                "cloudformation.amazonaws.com",
                                "gamelift.amazonaws.com",
                            } },
                        } },
                        { "action", "sts:AssumeRole" },
                    },
                } },
            },
            RoleName = "ScriptIAMRole",
            Policies = new[]
            {
                new AwsNative.Iam.Inputs.RolePolicyArgs
                {
                    PolicyName = "ScriptResourceIAMPolicy",
                    PolicyDocument = 
                    {
                        { "version", "2012-10-17" },
                        { "statement", new[]
                        {
                            
                            {
                                { "effect", "Allow" },
                                { "action", new[]
                                {
                                    "s3:GetObject",
                                    "s3:GetObjectVersion",
                                    "s3:GetObjectMetadata",
                                    "s3:*Object*",
                                } },
                                { "resource", new[]
                                {
                                    "*",
                                } },
                            },
                        } },
                    },
                },
            },
        });
    
        var scriptResource = new AwsNative.GameLift.Script("scriptResource", new()
        {
            Name = "MyRealtimeScript",
            Version = "v1.0",
            StorageLocation = new AwsNative.GameLift.Inputs.ScriptS3LocationArgs
            {
                Bucket = "MyBucketName",
                Key = "MyScriptFiles.zip",
                RoleArn = iamRole.Arn,
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws-native/sdk/go/aws/gamelift"
    	"github.com/pulumi/pulumi-aws-native/sdk/go/aws/iam"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		iamRole, err := iam.NewRole(ctx, "iamRole", &iam.RoleArgs{
    			AssumeRolePolicyDocument: pulumi.Any{
    				Version: "2012-10-17",
    				Statement: []map[string]interface{}{
    					map[string]interface{}{
    						"effect": "Allow",
    						"principal": map[string]interface{}{
    							"service": []string{
    								"cloudformation.amazonaws.com",
    								"gamelift.amazonaws.com",
    							},
    						},
    						"action": "sts:AssumeRole",
    					},
    				},
    			},
    			RoleName: pulumi.String("ScriptIAMRole"),
    			Policies: iam.RolePolicyTypeArray{
    				&iam.RolePolicyTypeArgs{
    					PolicyName: pulumi.String("ScriptResourceIAMPolicy"),
    					PolicyDocument: pulumi.Any{
    						Version: "2012-10-17",
    						Statement: []map[string]interface{}{
    							map[string]interface{}{
    								"effect": "Allow",
    								"action": []string{
    									"s3:GetObject",
    									"s3:GetObjectVersion",
    									"s3:GetObjectMetadata",
    									"s3:*Object*",
    								},
    								"resource": []string{
    									"*",
    								},
    							},
    						},
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = gamelift.NewScript(ctx, "scriptResource", &gamelift.ScriptArgs{
    			Name:    pulumi.String("MyRealtimeScript"),
    			Version: pulumi.String("v1.0"),
    			StorageLocation: &gamelift.ScriptS3LocationArgs{
    				Bucket:  pulumi.String("MyBucketName"),
    				Key:     pulumi.String("MyScriptFiles.zip"),
    				RoleArn: iamRole.Arn,
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    

    Coming soon!

    import pulumi
    import pulumi_aws_native as aws_native
    
    iam_role = aws_native.iam.Role("iamRole",
        assume_role_policy_document={
            "version": "2012-10-17",
            "statement": [{
                "effect": "Allow",
                "principal": {
                    "service": [
                        "cloudformation.amazonaws.com",
                        "gamelift.amazonaws.com",
                    ],
                },
                "action": "sts:AssumeRole",
            }],
        },
        role_name="ScriptIAMRole",
        policies=[aws_native.iam.RolePolicyArgs(
            policy_name="ScriptResourceIAMPolicy",
            policy_document={
                "version": "2012-10-17",
                "statement": [{
                    "effect": "Allow",
                    "action": [
                        "s3:GetObject",
                        "s3:GetObjectVersion",
                        "s3:GetObjectMetadata",
                        "s3:*Object*",
                    ],
                    "resource": ["*"],
                }],
            },
        )])
    script_resource = aws_native.gamelift.Script("scriptResource",
        name="MyRealtimeScript",
        version="v1.0",
        storage_location=aws_native.gamelift.ScriptS3LocationArgs(
            bucket="MyBucketName",
            key="MyScriptFiles.zip",
            role_arn=iam_role.arn,
        ))
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aws_native from "@pulumi/aws-native";
    
    const iamRole = new aws_native.iam.Role("iamRole", {
        assumeRolePolicyDocument: {
            version: "2012-10-17",
            statement: [{
                effect: "Allow",
                principal: {
                    service: [
                        "cloudformation.amazonaws.com",
                        "gamelift.amazonaws.com",
                    ],
                },
                action: "sts:AssumeRole",
            }],
        },
        roleName: "ScriptIAMRole",
        policies: [{
            policyName: "ScriptResourceIAMPolicy",
            policyDocument: {
                version: "2012-10-17",
                statement: [{
                    effect: "Allow",
                    action: [
                        "s3:GetObject",
                        "s3:GetObjectVersion",
                        "s3:GetObjectMetadata",
                        "s3:*Object*",
                    ],
                    resource: ["*"],
                }],
            },
        }],
    });
    const scriptResource = new aws_native.gamelift.Script("scriptResource", {
        name: "MyRealtimeScript",
        version: "v1.0",
        storageLocation: {
            bucket: "MyBucketName",
            key: "MyScriptFiles.zip",
            roleArn: iamRole.arn,
        },
    });
    

    Coming soon!

    Example

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AwsNative = Pulumi.AwsNative;
    
    return await Deployment.RunAsync(() => 
    {
        var amazonGrafanaWorkspaceIAMRole = new AwsNative.Iam.Role("amazonGrafanaWorkspaceIAMRole", new()
        {
            ManagedPolicyArns = new[]
            {
                "arn:aws:iam::aws:policy/service-role/AmazonGrafanaAthenaAccess",
            },
            AssumeRolePolicyDocument = 
            {
                { "version", "2012-10-17" },
                { "statement", new[]
                {
                    
                    {
                        { "effect", "Allow" },
                        { "principal", 
                        {
                            { "service", new[]
                            {
                                "grafana.amazonaws.com",
                            } },
                        } },
                        { "action", new[]
                        {
                            "sts:AssumeRole",
                        } },
                    },
                } },
            },
        });
    
        var amazonGrafanaWorkspace = new AwsNative.Grafana.Workspace("amazonGrafanaWorkspace", new()
        {
            AccountAccessType = AwsNative.Grafana.WorkspaceAccountAccessType.CurrentAccount,
            Name = "AmazonGrafanaWorkspace",
            Description = "Amazon Grafana Workspace",
            AuthenticationProviders = new[]
            {
                AwsNative.Grafana.WorkspaceAuthenticationProviderTypes.Saml,
            },
            PermissionType = AwsNative.Grafana.WorkspacePermissionType.CustomerManaged,
            GrafanaVersion = "9.4",
            RoleArn = amazonGrafanaWorkspaceIAMRole.Arn,
            SamlConfiguration = new AwsNative.Grafana.Inputs.WorkspaceSamlConfigurationArgs
            {
                IdpMetadata = new AwsNative.Grafana.Inputs.WorkspaceIdpMetadataArgs
                {
                    Xml = "<md:EntityDescriptor xmlns:md='urn:oasis:names:tc:SAML:2.0:metadata' entityID='entityId'>DATA</md:EntityDescriptor>",
                },
                AssertionAttributes = new AwsNative.Grafana.Inputs.WorkspaceAssertionAttributesArgs
                {
                    Name = "displayName",
                    Login = "login",
                    Email = "email",
                    Groups = "group",
                    Role = "role",
                    Org = "org",
                },
                RoleValues = new AwsNative.Grafana.Inputs.WorkspaceRoleValuesArgs
                {
                    Editor = new[]
                    {
                        "editor1",
                    },
                    Admin = new[]
                    {
                        "admin1",
                    },
                },
                AllowedOrganizations = new[]
                {
                    "org1",
                },
                LoginValidityDuration = 60,
            },
        });
    
        return new Dictionary<string, object?>
        {
            ["workspaceEndpoint"] = amazonGrafanaWorkspace.Endpoint,
            ["workspaceStatus"] = amazonGrafanaWorkspace.Status,
            ["workspaceId"] = amazonGrafanaWorkspace.Id,
            ["grafanaVersion"] = amazonGrafanaWorkspace.GrafanaVersion,
        };
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws-native/sdk/go/aws/grafana"
    	"github.com/pulumi/pulumi-aws-native/sdk/go/aws/iam"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		amazonGrafanaWorkspaceIAMRole, err := iam.NewRole(ctx, "amazonGrafanaWorkspaceIAMRole", &iam.RoleArgs{
    			ManagedPolicyArns: pulumi.StringArray{
    				pulumi.String("arn:aws:iam::aws:policy/service-role/AmazonGrafanaAthenaAccess"),
    			},
    			AssumeRolePolicyDocument: pulumi.Any{
    				Version: "2012-10-17",
    				Statement: []map[string]interface{}{
    					map[string]interface{}{
    						"effect": "Allow",
    						"principal": map[string]interface{}{
    							"service": []string{
    								"grafana.amazonaws.com",
    							},
    						},
    						"action": []string{
    							"sts:AssumeRole",
    						},
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		amazonGrafanaWorkspace, err := grafana.NewWorkspace(ctx, "amazonGrafanaWorkspace", &grafana.WorkspaceArgs{
    			AccountAccessType: grafana.WorkspaceAccountAccessTypeCurrentAccount,
    			Name:              pulumi.String("AmazonGrafanaWorkspace"),
    			Description:       pulumi.String("Amazon Grafana Workspace"),
    			AuthenticationProviders: grafana.WorkspaceAuthenticationProviderTypesArray{
    				grafana.WorkspaceAuthenticationProviderTypesSaml,
    			},
    			PermissionType: grafana.WorkspacePermissionTypeCustomerManaged,
    			GrafanaVersion: pulumi.String("9.4"),
    			RoleArn:        amazonGrafanaWorkspaceIAMRole.Arn,
    			SamlConfiguration: &grafana.WorkspaceSamlConfigurationArgs{
    				IdpMetadata: &grafana.WorkspaceIdpMetadataArgs{
    					Xml: pulumi.String("<md:EntityDescriptor xmlns:md='urn:oasis:names:tc:SAML:2.0:metadata' entityID='entityId'>DATA</md:EntityDescriptor>"),
    				},
    				AssertionAttributes: &grafana.WorkspaceAssertionAttributesArgs{
    					Name:   pulumi.String("displayName"),
    					Login:  pulumi.String("login"),
    					Email:  pulumi.String("email"),
    					Groups: pulumi.String("group"),
    					Role:   pulumi.String("role"),
    					Org:    pulumi.String("org"),
    				},
    				RoleValues: &grafana.WorkspaceRoleValuesArgs{
    					Editor: pulumi.StringArray{
    						pulumi.String("editor1"),
    					},
    					Admin: pulumi.StringArray{
    						pulumi.String("admin1"),
    					},
    				},
    				AllowedOrganizations: pulumi.StringArray{
    					pulumi.String("org1"),
    				},
    				LoginValidityDuration: pulumi.Float64(60),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		ctx.Export("workspaceEndpoint", amazonGrafanaWorkspace.Endpoint)
    		ctx.Export("workspaceStatus", amazonGrafanaWorkspace.Status)
    		ctx.Export("workspaceId", amazonGrafanaWorkspace.ID())
    		ctx.Export("grafanaVersion", amazonGrafanaWorkspace.GrafanaVersion)
    		return nil
    	})
    }
    

    Coming soon!

    import pulumi
    import pulumi_aws_native as aws_native
    
    amazon_grafana_workspace_iam_role = aws_native.iam.Role("amazonGrafanaWorkspaceIAMRole",
        managed_policy_arns=["arn:aws:iam::aws:policy/service-role/AmazonGrafanaAthenaAccess"],
        assume_role_policy_document={
            "version": "2012-10-17",
            "statement": [{
                "effect": "Allow",
                "principal": {
                    "service": ["grafana.amazonaws.com"],
                },
                "action": ["sts:AssumeRole"],
            }],
        })
    amazon_grafana_workspace = aws_native.grafana.Workspace("amazonGrafanaWorkspace",
        account_access_type=aws_native.grafana.WorkspaceAccountAccessType.CURRENT_ACCOUNT,
        name="AmazonGrafanaWorkspace",
        description="Amazon Grafana Workspace",
        authentication_providers=[aws_native.grafana.WorkspaceAuthenticationProviderTypes.SAML],
        permission_type=aws_native.grafana.WorkspacePermissionType.CUSTOMER_MANAGED,
        grafana_version="9.4",
        role_arn=amazon_grafana_workspace_iam_role.arn,
        saml_configuration=aws_native.grafana.WorkspaceSamlConfigurationArgs(
            idp_metadata=aws_native.grafana.WorkspaceIdpMetadataArgs(
                xml="<md:EntityDescriptor xmlns:md='urn:oasis:names:tc:SAML:2.0:metadata' entityID='entityId'>DATA</md:EntityDescriptor>",
            ),
            assertion_attributes=aws_native.grafana.WorkspaceAssertionAttributesArgs(
                name="displayName",
                login="login",
                email="email",
                groups="group",
                role="role",
                org="org",
            ),
            role_values=aws_native.grafana.WorkspaceRoleValuesArgs(
                editor=["editor1"],
                admin=["admin1"],
            ),
            allowed_organizations=["org1"],
            login_validity_duration=60,
        ))
    pulumi.export("workspaceEndpoint", amazon_grafana_workspace.endpoint)
    pulumi.export("workspaceStatus", amazon_grafana_workspace.status)
    pulumi.export("workspaceId", amazon_grafana_workspace.id)
    pulumi.export("grafanaVersion", amazon_grafana_workspace.grafana_version)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aws_native from "@pulumi/aws-native";
    
    const amazonGrafanaWorkspaceIAMRole = new aws_native.iam.Role("amazonGrafanaWorkspaceIAMRole", {
        managedPolicyArns: ["arn:aws:iam::aws:policy/service-role/AmazonGrafanaAthenaAccess"],
        assumeRolePolicyDocument: {
            version: "2012-10-17",
            statement: [{
                effect: "Allow",
                principal: {
                    service: ["grafana.amazonaws.com"],
                },
                action: ["sts:AssumeRole"],
            }],
        },
    });
    const amazonGrafanaWorkspace = new aws_native.grafana.Workspace("amazonGrafanaWorkspace", {
        accountAccessType: aws_native.grafana.WorkspaceAccountAccessType.CurrentAccount,
        name: "AmazonGrafanaWorkspace",
        description: "Amazon Grafana Workspace",
        authenticationProviders: [aws_native.grafana.WorkspaceAuthenticationProviderTypes.Saml],
        permissionType: aws_native.grafana.WorkspacePermissionType.CustomerManaged,
        grafanaVersion: "9.4",
        roleArn: amazonGrafanaWorkspaceIAMRole.arn,
        samlConfiguration: {
            idpMetadata: {
                xml: "<md:EntityDescriptor xmlns:md='urn:oasis:names:tc:SAML:2.0:metadata' entityID='entityId'>DATA</md:EntityDescriptor>",
            },
            assertionAttributes: {
                name: "displayName",
                login: "login",
                email: "email",
                groups: "group",
                role: "role",
                org: "org",
            },
            roleValues: {
                editor: ["editor1"],
                admin: ["admin1"],
            },
            allowedOrganizations: ["org1"],
            loginValidityDuration: 60,
        },
    });
    export const workspaceEndpoint = amazonGrafanaWorkspace.endpoint;
    export const workspaceStatus = amazonGrafanaWorkspace.status;
    export const workspaceId = amazonGrafanaWorkspace.id;
    export const grafanaVersion = amazonGrafanaWorkspace.grafanaVersion;
    

    Coming soon!

    Example

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AwsNative = Pulumi.AwsNative;
    
    return await Deployment.RunAsync(() => 
    {
        var amazonGrafanaWorkspaceIAMRole = new AwsNative.Iam.Role("amazonGrafanaWorkspaceIAMRole", new()
        {
            ManagedPolicyArns = new[]
            {
                "arn:aws:iam::aws:policy/service-role/AmazonGrafanaAthenaAccess",
            },
            AssumeRolePolicyDocument = 
            {
                { "version", "2012-10-17" },
                { "statement", new[]
                {
                    
                    {
                        { "effect", "Allow" },
                        { "principal", 
                        {
                            { "service", new[]
                            {
                                "grafana.amazonaws.com",
                            } },
                        } },
                        { "action", new[]
                        {
                            "sts:AssumeRole",
                        } },
                    },
                } },
            },
        });
    
        var amazonGrafanaWorkspace = new AwsNative.Grafana.Workspace("amazonGrafanaWorkspace", new()
        {
            AccountAccessType = AwsNative.Grafana.WorkspaceAccountAccessType.CurrentAccount,
            Name = "AmazonGrafanaWorkspace",
            Description = "Amazon Grafana Workspace",
            AuthenticationProviders = new[]
            {
                AwsNative.Grafana.WorkspaceAuthenticationProviderTypes.Saml,
            },
            PermissionType = AwsNative.Grafana.WorkspacePermissionType.CustomerManaged,
            GrafanaVersion = "9.4",
            RoleArn = amazonGrafanaWorkspaceIAMRole.Arn,
            SamlConfiguration = new AwsNative.Grafana.Inputs.WorkspaceSamlConfigurationArgs
            {
                IdpMetadata = new AwsNative.Grafana.Inputs.WorkspaceIdpMetadataArgs
                {
                    Xml = "<md:EntityDescriptor xmlns:md='urn:oasis:names:tc:SAML:2.0:metadata' entityID='entityId'>DATA</md:EntityDescriptor>",
                },
                AssertionAttributes = new AwsNative.Grafana.Inputs.WorkspaceAssertionAttributesArgs
                {
                    Name = "displayName",
                    Login = "login",
                    Email = "email",
                    Groups = "group",
                    Role = "role",
                    Org = "org",
                },
                RoleValues = new AwsNative.Grafana.Inputs.WorkspaceRoleValuesArgs
                {
                    Editor = new[]
                    {
                        "editor1",
                    },
                    Admin = new[]
                    {
                        "admin1",
                    },
                },
                AllowedOrganizations = new[]
                {
                    "org1",
                },
                LoginValidityDuration = 60,
            },
        });
    
        return new Dictionary<string, object?>
        {
            ["workspaceEndpoint"] = amazonGrafanaWorkspace.Endpoint,
            ["workspaceStatus"] = amazonGrafanaWorkspace.Status,
            ["workspaceId"] = amazonGrafanaWorkspace.Id,
            ["grafanaVersion"] = amazonGrafanaWorkspace.GrafanaVersion,
        };
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws-native/sdk/go/aws/grafana"
    	"github.com/pulumi/pulumi-aws-native/sdk/go/aws/iam"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		amazonGrafanaWorkspaceIAMRole, err := iam.NewRole(ctx, "amazonGrafanaWorkspaceIAMRole", &iam.RoleArgs{
    			ManagedPolicyArns: pulumi.StringArray{
    				pulumi.String("arn:aws:iam::aws:policy/service-role/AmazonGrafanaAthenaAccess"),
    			},
    			AssumeRolePolicyDocument: pulumi.Any{
    				Version: "2012-10-17",
    				Statement: []map[string]interface{}{
    					map[string]interface{}{
    						"effect": "Allow",
    						"principal": map[string]interface{}{
    							"service": []string{
    								"grafana.amazonaws.com",
    							},
    						},
    						"action": []string{
    							"sts:AssumeRole",
    						},
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		amazonGrafanaWorkspace, err := grafana.NewWorkspace(ctx, "amazonGrafanaWorkspace", &grafana.WorkspaceArgs{
    			AccountAccessType: grafana.WorkspaceAccountAccessTypeCurrentAccount,
    			Name:              pulumi.String("AmazonGrafanaWorkspace"),
    			Description:       pulumi.String("Amazon Grafana Workspace"),
    			AuthenticationProviders: grafana.WorkspaceAuthenticationProviderTypesArray{
    				grafana.WorkspaceAuthenticationProviderTypesSaml,
    			},
    			PermissionType: grafana.WorkspacePermissionTypeCustomerManaged,
    			GrafanaVersion: pulumi.String("9.4"),
    			RoleArn:        amazonGrafanaWorkspaceIAMRole.Arn,
    			SamlConfiguration: &grafana.WorkspaceSamlConfigurationArgs{
    				IdpMetadata: &grafana.WorkspaceIdpMetadataArgs{
    					Xml: pulumi.String("<md:EntityDescriptor xmlns:md='urn:oasis:names:tc:SAML:2.0:metadata' entityID='entityId'>DATA</md:EntityDescriptor>"),
    				},
    				AssertionAttributes: &grafana.WorkspaceAssertionAttributesArgs{
    					Name:   pulumi.String("displayName"),
    					Login:  pulumi.String("login"),
    					Email:  pulumi.String("email"),
    					Groups: pulumi.String("group"),
    					Role:   pulumi.String("role"),
    					Org:    pulumi.String("org"),
    				},
    				RoleValues: &grafana.WorkspaceRoleValuesArgs{
    					Editor: pulumi.StringArray{
    						pulumi.String("editor1"),
    					},
    					Admin: pulumi.StringArray{
    						pulumi.String("admin1"),
    					},
    				},
    				AllowedOrganizations: pulumi.StringArray{
    					pulumi.String("org1"),
    				},
    				LoginValidityDuration: pulumi.Float64(60),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		ctx.Export("workspaceEndpoint", amazonGrafanaWorkspace.Endpoint)
    		ctx.Export("workspaceStatus", amazonGrafanaWorkspace.Status)
    		ctx.Export("workspaceId", amazonGrafanaWorkspace.ID())
    		ctx.Export("grafanaVersion", amazonGrafanaWorkspace.GrafanaVersion)
    		return nil
    	})
    }
    

    Coming soon!

    import pulumi
    import pulumi_aws_native as aws_native
    
    amazon_grafana_workspace_iam_role = aws_native.iam.Role("amazonGrafanaWorkspaceIAMRole",
        managed_policy_arns=["arn:aws:iam::aws:policy/service-role/AmazonGrafanaAthenaAccess"],
        assume_role_policy_document={
            "version": "2012-10-17",
            "statement": [{
                "effect": "Allow",
                "principal": {
                    "service": ["grafana.amazonaws.com"],
                },
                "action": ["sts:AssumeRole"],
            }],
        })
    amazon_grafana_workspace = aws_native.grafana.Workspace("amazonGrafanaWorkspace",
        account_access_type=aws_native.grafana.WorkspaceAccountAccessType.CURRENT_ACCOUNT,
        name="AmazonGrafanaWorkspace",
        description="Amazon Grafana Workspace",
        authentication_providers=[aws_native.grafana.WorkspaceAuthenticationProviderTypes.SAML],
        permission_type=aws_native.grafana.WorkspacePermissionType.CUSTOMER_MANAGED,
        grafana_version="9.4",
        role_arn=amazon_grafana_workspace_iam_role.arn,
        saml_configuration=aws_native.grafana.WorkspaceSamlConfigurationArgs(
            idp_metadata=aws_native.grafana.WorkspaceIdpMetadataArgs(
                xml="<md:EntityDescriptor xmlns:md='urn:oasis:names:tc:SAML:2.0:metadata' entityID='entityId'>DATA</md:EntityDescriptor>",
            ),
            assertion_attributes=aws_native.grafana.WorkspaceAssertionAttributesArgs(
                name="displayName",
                login="login",
                email="email",
                groups="group",
                role="role",
                org="org",
            ),
            role_values=aws_native.grafana.WorkspaceRoleValuesArgs(
                editor=["editor1"],
                admin=["admin1"],
            ),
            allowed_organizations=["org1"],
            login_validity_duration=60,
        ))
    pulumi.export("workspaceEndpoint", amazon_grafana_workspace.endpoint)
    pulumi.export("workspaceStatus", amazon_grafana_workspace.status)
    pulumi.export("workspaceId", amazon_grafana_workspace.id)
    pulumi.export("grafanaVersion", amazon_grafana_workspace.grafana_version)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aws_native from "@pulumi/aws-native";
    
    const amazonGrafanaWorkspaceIAMRole = new aws_native.iam.Role("amazonGrafanaWorkspaceIAMRole", {
        managedPolicyArns: ["arn:aws:iam::aws:policy/service-role/AmazonGrafanaAthenaAccess"],
        assumeRolePolicyDocument: {
            version: "2012-10-17",
            statement: [{
                effect: "Allow",
                principal: {
                    service: ["grafana.amazonaws.com"],
                },
                action: ["sts:AssumeRole"],
            }],
        },
    });
    const amazonGrafanaWorkspace = new aws_native.grafana.Workspace("amazonGrafanaWorkspace", {
        accountAccessType: aws_native.grafana.WorkspaceAccountAccessType.CurrentAccount,
        name: "AmazonGrafanaWorkspace",
        description: "Amazon Grafana Workspace",
        authenticationProviders: [aws_native.grafana.WorkspaceAuthenticationProviderTypes.Saml],
        permissionType: aws_native.grafana.WorkspacePermissionType.CustomerManaged,
        grafanaVersion: "9.4",
        roleArn: amazonGrafanaWorkspaceIAMRole.arn,
        samlConfiguration: {
            idpMetadata: {
                xml: "<md:EntityDescriptor xmlns:md='urn:oasis:names:tc:SAML:2.0:metadata' entityID='entityId'>DATA</md:EntityDescriptor>",
            },
            assertionAttributes: {
                name: "displayName",
                login: "login",
                email: "email",
                groups: "group",
                role: "role",
                org: "org",
            },
            roleValues: {
                editor: ["editor1"],
                admin: ["admin1"],
            },
            allowedOrganizations: ["org1"],
            loginValidityDuration: 60,
        },
    });
    export const workspaceEndpoint = amazonGrafanaWorkspace.endpoint;
    export const workspaceStatus = amazonGrafanaWorkspace.status;
    export const workspaceId = amazonGrafanaWorkspace.id;
    export const grafanaVersion = amazonGrafanaWorkspace.grafanaVersion;
    

    Coming soon!

    Example

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AwsNative = Pulumi.AwsNative;
    
    return await Deployment.RunAsync(() => 
    {
        var rootRole = new AwsNative.Iam.Role("rootRole", new()
        {
            AssumeRolePolicyDocument = 
            {
                { "version", "2012-10-17" },
                { "statement", new[]
                {
                    
                    {
                        { "effect", "Allow" },
                        { "principal", 
                        {
                            { "service", new[]
                            {
                                "ec2.amazonaws.com",
                            } },
                        } },
                        { "action", new[]
                        {
                            "sts:AssumeRole",
                        } },
                    },
                } },
            },
            Path = "/",
            Policies = new[]
            {
                new AwsNative.Iam.Inputs.RolePolicyArgs
                {
                    PolicyName = "root",
                    PolicyDocument = 
                    {
                        { "version", "2012-10-17" },
                        { "statement", new[]
                        {
                            
                            {
                                { "effect", "Allow" },
                                { "action", "*" },
                                { "resource", "*" },
                            },
                        } },
                    },
                },
            },
        });
    
        var rootInstanceProfile = new AwsNative.Iam.InstanceProfile("rootInstanceProfile", new()
        {
            Path = "/",
            Roles = new[]
            {
                rootRole.Id,
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws-native/sdk/go/aws/iam"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		rootRole, err := iam.NewRole(ctx, "rootRole", &iam.RoleArgs{
    			AssumeRolePolicyDocument: pulumi.Any{
    				Version: "2012-10-17",
    				Statement: []map[string]interface{}{
    					map[string]interface{}{
    						"effect": "Allow",
    						"principal": map[string]interface{}{
    							"service": []string{
    								"ec2.amazonaws.com",
    							},
    						},
    						"action": []string{
    							"sts:AssumeRole",
    						},
    					},
    				},
    			},
    			Path: pulumi.String("/"),
    			Policies: iam.RolePolicyTypeArray{
    				&iam.RolePolicyTypeArgs{
    					PolicyName: pulumi.String("root"),
    					PolicyDocument: pulumi.Any{
    						Version: "2012-10-17",
    						Statement: []map[string]interface{}{
    							map[string]interface{}{
    								"effect":   "Allow",
    								"action":   "*",
    								"resource": "*",
    							},
    						},
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = iam.NewInstanceProfile(ctx, "rootInstanceProfile", &iam.InstanceProfileArgs{
    			Path: pulumi.String("/"),
    			Roles: pulumi.StringArray{
    				rootRole.ID(),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    

    Coming soon!

    import pulumi
    import pulumi_aws_native as aws_native
    
    root_role = aws_native.iam.Role("rootRole",
        assume_role_policy_document={
            "version": "2012-10-17",
            "statement": [{
                "effect": "Allow",
                "principal": {
                    "service": ["ec2.amazonaws.com"],
                },
                "action": ["sts:AssumeRole"],
            }],
        },
        path="/",
        policies=[aws_native.iam.RolePolicyArgs(
            policy_name="root",
            policy_document={
                "version": "2012-10-17",
                "statement": [{
                    "effect": "Allow",
                    "action": "*",
                    "resource": "*",
                }],
            },
        )])
    root_instance_profile = aws_native.iam.InstanceProfile("rootInstanceProfile",
        path="/",
        roles=[root_role.id])
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aws_native from "@pulumi/aws-native";
    
    const rootRole = new aws_native.iam.Role("rootRole", {
        assumeRolePolicyDocument: {
            version: "2012-10-17",
            statement: [{
                effect: "Allow",
                principal: {
                    service: ["ec2.amazonaws.com"],
                },
                action: ["sts:AssumeRole"],
            }],
        },
        path: "/",
        policies: [{
            policyName: "root",
            policyDocument: {
                version: "2012-10-17",
                statement: [{
                    effect: "Allow",
                    action: "*",
                    resource: "*",
                }],
            },
        }],
    });
    const rootInstanceProfile = new aws_native.iam.InstanceProfile("rootInstanceProfile", {
        path: "/",
        roles: [rootRole.id],
    });
    

    Coming soon!

    Example

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AwsNative = Pulumi.AwsNative;
    
    return await Deployment.RunAsync(() => 
    {
        var rootRole = new AwsNative.Iam.Role("rootRole", new()
        {
            AssumeRolePolicyDocument = 
            {
                { "version", "2012-10-17" },
                { "statement", new[]
                {
                    
                    {
                        { "effect", "Allow" },
                        { "principal", 
                        {
                            { "service", new[]
                            {
                                "ec2.amazonaws.com",
                            } },
                        } },
                        { "action", new[]
                        {
                            "sts:AssumeRole",
                        } },
                    },
                } },
            },
            Path = "/",
            Policies = new[]
            {
                new AwsNative.Iam.Inputs.RolePolicyArgs
                {
                    PolicyName = "root",
                    PolicyDocument = 
                    {
                        { "version", "2012-10-17" },
                        { "statement", new[]
                        {
                            
                            {
                                { "effect", "Allow" },
                                { "action", "*" },
                                { "resource", "*" },
                            },
                        } },
                    },
                },
            },
        });
    
        var rootInstanceProfile = new AwsNative.Iam.InstanceProfile("rootInstanceProfile", new()
        {
            Path = "/",
            Roles = new[]
            {
                rootRole.Id,
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws-native/sdk/go/aws/iam"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		rootRole, err := iam.NewRole(ctx, "rootRole", &iam.RoleArgs{
    			AssumeRolePolicyDocument: pulumi.Any{
    				Version: "2012-10-17",
    				Statement: []map[string]interface{}{
    					map[string]interface{}{
    						"effect": "Allow",
    						"principal": map[string]interface{}{
    							"service": []string{
    								"ec2.amazonaws.com",
    							},
    						},
    						"action": []string{
    							"sts:AssumeRole",
    						},
    					},
    				},
    			},
    			Path: pulumi.String("/"),
    			Policies: iam.RolePolicyTypeArray{
    				&iam.RolePolicyTypeArgs{
    					PolicyName: pulumi.String("root"),
    					PolicyDocument: pulumi.Any{
    						Version: "2012-10-17",
    						Statement: []map[string]interface{}{
    							map[string]interface{}{
    								"effect":   "Allow",
    								"action":   "*",
    								"resource": "*",
    							},
    						},
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = iam.NewInstanceProfile(ctx, "rootInstanceProfile", &iam.InstanceProfileArgs{
    			Path: pulumi.String("/"),
    			Roles: pulumi.StringArray{
    				rootRole.ID(),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    

    Coming soon!

    import pulumi
    import pulumi_aws_native as aws_native
    
    root_role = aws_native.iam.Role("rootRole",
        assume_role_policy_document={
            "version": "2012-10-17",
            "statement": [{
                "effect": "Allow",
                "principal": {
                    "service": ["ec2.amazonaws.com"],
                },
                "action": ["sts:AssumeRole"],
            }],
        },
        path="/",
        policies=[aws_native.iam.RolePolicyArgs(
            policy_name="root",
            policy_document={
                "version": "2012-10-17",
                "statement": [{
                    "effect": "Allow",
                    "action": "*",
                    "resource": "*",
                }],
            },
        )])
    root_instance_profile = aws_native.iam.InstanceProfile("rootInstanceProfile",
        path="/",
        roles=[root_role.id])
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aws_native from "@pulumi/aws-native";
    
    const rootRole = new aws_native.iam.Role("rootRole", {
        assumeRolePolicyDocument: {
            version: "2012-10-17",
            statement: [{
                effect: "Allow",
                principal: {
                    service: ["ec2.amazonaws.com"],
                },
                action: ["sts:AssumeRole"],
            }],
        },
        path: "/",
        policies: [{
            policyName: "root",
            policyDocument: {
                version: "2012-10-17",
                statement: [{
                    effect: "Allow",
                    action: "*",
                    resource: "*",
                }],
            },
        }],
    });
    const rootInstanceProfile = new aws_native.iam.InstanceProfile("rootInstanceProfile", {
        path: "/",
        roles: [rootRole.id],
    });
    

    Coming soon!

    Example

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AwsNative = Pulumi.AwsNative;
    
    return await Deployment.RunAsync(() => 
    {
        var automationExecutionRole = new AwsNative.Iam.Role("automationExecutionRole", new()
        {
            AssumeRolePolicyDocument = 
            {
                { "version", "2012-10-17" },
                { "statement", new[]
                {
                    
                    {
                        { "effect", "Allow" },
                        { "principal", 
                        {
                            { "service", "ssm.amazonaws.com" },
                        } },
                        { "action", new[]
                        {
                            "sts:AssumeRole",
                        } },
                    },
                } },
            },
            Path = "/",
            ManagedPolicyArns = new[]
            {
                "arn:${AWS::Partition}:iam::aws:policy/AmazonEC2FullAccess",
            },
        });
    
        var automationAssociation = new AwsNative.Ssm.Association("automationAssociation", new()
        {
            Name = "AWS-StopEC2Instance",
            Parameters = 
            {
                { "automationAssumeRole", new[]
                {
                    "AutomationExecutionRole.Arn",
                } },
            },
            Targets = new[]
            {
                new AwsNative.Ssm.Inputs.AssociationTargetArgs
                {
                    Key = "ParameterValues",
                    Values = new[]
                    {
                        "i-1234567890abcdef0",
                    },
                },
            },
            AutomationTargetParameterName = "InstanceId",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws-native/sdk/go/aws/iam"
    	"github.com/pulumi/pulumi-aws-native/sdk/go/aws/ssm"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := iam.NewRole(ctx, "automationExecutionRole", &iam.RoleArgs{
    			AssumeRolePolicyDocument: pulumi.Any{
    				Version: "2012-10-17",
    				Statement: []map[string]interface{}{
    					map[string]interface{}{
    						"effect": "Allow",
    						"principal": map[string]interface{}{
    							"service": "ssm.amazonaws.com",
    						},
    						"action": []string{
    							"sts:AssumeRole",
    						},
    					},
    				},
    			},
    			Path: pulumi.String("/"),
    			ManagedPolicyArns: pulumi.StringArray{
    				pulumi.String("arn:${AWS::Partition}:iam::aws:policy/AmazonEC2FullAccess"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = ssm.NewAssociation(ctx, "automationAssociation", &ssm.AssociationArgs{
    			Name: pulumi.String("AWS-StopEC2Instance"),
    			Parameters: pulumi.StringArrayMap{
    				"automationAssumeRole": pulumi.StringArray{
    					pulumi.String("AutomationExecutionRole.Arn"),
    				},
    			},
    			Targets: ssm.AssociationTargetArray{
    				&ssm.AssociationTargetArgs{
    					Key: pulumi.String("ParameterValues"),
    					Values: pulumi.StringArray{
    						pulumi.String("i-1234567890abcdef0"),
    					},
    				},
    			},
    			AutomationTargetParameterName: pulumi.String("InstanceId"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    

    Coming soon!

    import pulumi
    import pulumi_aws_native as aws_native
    
    automation_execution_role = aws_native.iam.Role("automationExecutionRole",
        assume_role_policy_document={
            "version": "2012-10-17",
            "statement": [{
                "effect": "Allow",
                "principal": {
                    "service": "ssm.amazonaws.com",
                },
                "action": ["sts:AssumeRole"],
            }],
        },
        path="/",
        managed_policy_arns=["arn:${AWS::Partition}:iam::aws:policy/AmazonEC2FullAccess"])
    automation_association = aws_native.ssm.Association("automationAssociation",
        name="AWS-StopEC2Instance",
        parameters={
            "automationAssumeRole": ["AutomationExecutionRole.Arn"],
        },
        targets=[aws_native.ssm.AssociationTargetArgs(
            key="ParameterValues",
            values=["i-1234567890abcdef0"],
        )],
        automation_target_parameter_name="InstanceId")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aws_native from "@pulumi/aws-native";
    
    const automationExecutionRole = new aws_native.iam.Role("automationExecutionRole", {
        assumeRolePolicyDocument: {
            version: "2012-10-17",
            statement: [{
                effect: "Allow",
                principal: {
                    service: "ssm.amazonaws.com",
                },
                action: ["sts:AssumeRole"],
            }],
        },
        path: "/",
        managedPolicyArns: ["arn:${AWS::Partition}:iam::aws:policy/AmazonEC2FullAccess"],
    });
    const automationAssociation = new aws_native.ssm.Association("automationAssociation", {
        name: "AWS-StopEC2Instance",
        parameters: {
            automationAssumeRole: ["AutomationExecutionRole.Arn"],
        },
        targets: [{
            key: "ParameterValues",
            values: ["i-1234567890abcdef0"],
        }],
        automationTargetParameterName: "InstanceId",
    });
    

    Coming soon!

    Create Role Resource

    new Role(name: string, args: RoleArgs, opts?: CustomResourceOptions);
    @overload
    def Role(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             assume_role_policy_document: Optional[Any] = None,
             description: Optional[str] = None,
             managed_policy_arns: Optional[Sequence[str]] = None,
             max_session_duration: Optional[int] = None,
             path: Optional[str] = None,
             permissions_boundary: Optional[str] = None,
             policies: Optional[Sequence[RolePolicyArgs]] = None,
             role_name: Optional[str] = None,
             tags: Optional[Sequence[_root_inputs.TagArgs]] = None)
    @overload
    def Role(resource_name: str,
             args: RoleArgs,
             opts: Optional[ResourceOptions] = None)
    func NewRole(ctx *Context, name string, args RoleArgs, opts ...ResourceOption) (*Role, error)
    public Role(string name, RoleArgs args, CustomResourceOptions? opts = null)
    public Role(String name, RoleArgs args)
    public Role(String name, RoleArgs args, CustomResourceOptions options)
    
    type: aws-native:iam:Role
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args RoleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args RoleArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args RoleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args RoleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args RoleArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Role Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The Role resource accepts the following input properties:

    AssumeRolePolicyDocument object

    The trust policy that is associated with this role. Trust policies define which entities can assume the role. You can associate only one trust policy with a role. For an example of a policy that can be used to assume a role, see Template Examples. For more information about the elements that you can use in an IAM policy, see Policy Elements Reference in the User Guide.

    Search the CloudFormation User Guide for AWS::IAM::Role for more information about the expected schema for this property.

    Description string
    A description of the role that you provide.
    ManagedPolicyArns List<string>
    A list of Amazon Resource Names (ARNs) of the IAM managed policies that you want to attach to the role. For more information about ARNs, see Amazon Resource Names (ARNs) and Service Namespaces in the General Reference.
    MaxSessionDuration int
    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 value of one hour is applied. This setting can have a value from 1 hour to 12 hours. Anyone who assumes the role from the CLI or API can use the DurationSeconds API parameter or the duration-seconds CLI parameter to request a longer session. The MaxSessionDuration setting determines the maximum duration that can be requested using the DurationSeconds parameter. If users don't specify a value for the DurationSeconds parameter, their security credentials are valid for one hour by default. This applies when you use the AssumeRole* API operations or the assume-role* CLI operations but does not apply when you use those operations to create a console URL. For more information, see Using IAM roles in the IAM User Guide.
    Path string
    The path to the role. For more information about paths, see IAM Identifiers in the IAM User Guide. This parameter is optional. If it is not included, it defaults to a slash (/). This parameter allows (through its regex pattern) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021) through the DEL character (\u007F), including most punctuation characters, digits, and upper and lowercased letters.
    PermissionsBoundary string
    The ARN of the policy used to set the permissions boundary for the role. For more information about permissions boundaries, see Permissions boundaries for IAM identities in the IAM User Guide.
    Policies List<Pulumi.AwsNative.Iam.Inputs.RolePolicy>
    Adds or updates an inline policy document that is embedded in the specified IAM role. When you embed an inline policy in a role, the inline policy is used as part of the role's access (permissions) policy. The role's trust policy is created at the same time as the role. You can update a role's trust policy later. For more information about IAM roles, go to Using Roles to Delegate Permissions and Federate Identities. A role can also have an attached managed policy. For information about policies, see Managed Policies and Inline Policies in the User Guide. For information about limits on the number of inline policies that you can embed with a role, see Limitations on Entities in the User Guide. If an external policy (such as AWS::IAM::Policy or
    RoleName string
    A name for the IAM role, up to 64 characters in length. For valid values, see the RoleName parameter for the CreateRole action in the User Guide. This parameter allows (per its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-. The role name must be unique within the account. Role names are not distinguished by case. For example, you cannot create roles named both "Role1" and "role1". If you don't specify a name, CFN generates a unique physical ID and uses that ID for the role name. If you specify a name, you must specify the CAPABILITY_NAMED_IAM value to acknowledge your template's capabilities. For more information, see [Acknowledging Resources in Templates](https://docs.aws.amazon.com/AWSCloudFormation/latest/Use
    Tags List<Pulumi.AwsNative.Inputs.Tag>
    A list of tags that are attached to the role. For more information about tagging, see Tagging IAM resources in the IAM User Guide.
    AssumeRolePolicyDocument interface{}

    The trust policy that is associated with this role. Trust policies define which entities can assume the role. You can associate only one trust policy with a role. For an example of a policy that can be used to assume a role, see Template Examples. For more information about the elements that you can use in an IAM policy, see Policy Elements Reference in the User Guide.

    Search the CloudFormation User Guide for AWS::IAM::Role for more information about the expected schema for this property.

    Description string
    A description of the role that you provide.
    ManagedPolicyArns []string
    A list of Amazon Resource Names (ARNs) of the IAM managed policies that you want to attach to the role. For more information about ARNs, see Amazon Resource Names (ARNs) and Service Namespaces in the General Reference.
    MaxSessionDuration int
    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 value of one hour is applied. This setting can have a value from 1 hour to 12 hours. Anyone who assumes the role from the CLI or API can use the DurationSeconds API parameter or the duration-seconds CLI parameter to request a longer session. The MaxSessionDuration setting determines the maximum duration that can be requested using the DurationSeconds parameter. If users don't specify a value for the DurationSeconds parameter, their security credentials are valid for one hour by default. This applies when you use the AssumeRole* API operations or the assume-role* CLI operations but does not apply when you use those operations to create a console URL. For more information, see Using IAM roles in the IAM User Guide.
    Path string
    The path to the role. For more information about paths, see IAM Identifiers in the IAM User Guide. This parameter is optional. If it is not included, it defaults to a slash (/). This parameter allows (through its regex pattern) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021) through the DEL character (\u007F), including most punctuation characters, digits, and upper and lowercased letters.
    PermissionsBoundary string
    The ARN of the policy used to set the permissions boundary for the role. For more information about permissions boundaries, see Permissions boundaries for IAM identities in the IAM User Guide.
    Policies []RolePolicyTypeArgs
    Adds or updates an inline policy document that is embedded in the specified IAM role. When you embed an inline policy in a role, the inline policy is used as part of the role's access (permissions) policy. The role's trust policy is created at the same time as the role. You can update a role's trust policy later. For more information about IAM roles, go to Using Roles to Delegate Permissions and Federate Identities. A role can also have an attached managed policy. For information about policies, see Managed Policies and Inline Policies in the User Guide. For information about limits on the number of inline policies that you can embed with a role, see Limitations on Entities in the User Guide. If an external policy (such as AWS::IAM::Policy or
    RoleName string
    A name for the IAM role, up to 64 characters in length. For valid values, see the RoleName parameter for the CreateRole action in the User Guide. This parameter allows (per its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-. The role name must be unique within the account. Role names are not distinguished by case. For example, you cannot create roles named both "Role1" and "role1". If you don't specify a name, CFN generates a unique physical ID and uses that ID for the role name. If you specify a name, you must specify the CAPABILITY_NAMED_IAM value to acknowledge your template's capabilities. For more information, see [Acknowledging Resources in Templates](https://docs.aws.amazon.com/AWSCloudFormation/latest/Use
    Tags TagArgs
    A list of tags that are attached to the role. For more information about tagging, see Tagging IAM resources in the IAM User Guide.
    assumeRolePolicyDocument Object

    The trust policy that is associated with this role. Trust policies define which entities can assume the role. You can associate only one trust policy with a role. For an example of a policy that can be used to assume a role, see Template Examples. For more information about the elements that you can use in an IAM policy, see Policy Elements Reference in the User Guide.

    Search the CloudFormation User Guide for AWS::IAM::Role for more information about the expected schema for this property.

    description String
    A description of the role that you provide.
    managedPolicyArns List<String>
    A list of Amazon Resource Names (ARNs) of the IAM managed policies that you want to attach to the role. For more information about ARNs, see Amazon Resource Names (ARNs) and Service Namespaces in the General Reference.
    maxSessionDuration Integer
    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 value of one hour is applied. This setting can have a value from 1 hour to 12 hours. Anyone who assumes the role from the CLI or API can use the DurationSeconds API parameter or the duration-seconds CLI parameter to request a longer session. The MaxSessionDuration setting determines the maximum duration that can be requested using the DurationSeconds parameter. If users don't specify a value for the DurationSeconds parameter, their security credentials are valid for one hour by default. This applies when you use the AssumeRole* API operations or the assume-role* CLI operations but does not apply when you use those operations to create a console URL. For more information, see Using IAM roles in the IAM User Guide.
    path String
    The path to the role. For more information about paths, see IAM Identifiers in the IAM User Guide. This parameter is optional. If it is not included, it defaults to a slash (/). This parameter allows (through its regex pattern) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021) through the DEL character (\u007F), including most punctuation characters, digits, and upper and lowercased letters.
    permissionsBoundary String
    The ARN of the policy used to set the permissions boundary for the role. For more information about permissions boundaries, see Permissions boundaries for IAM identities in the IAM User Guide.
    policies List<RolePolicy>
    Adds or updates an inline policy document that is embedded in the specified IAM role. When you embed an inline policy in a role, the inline policy is used as part of the role's access (permissions) policy. The role's trust policy is created at the same time as the role. You can update a role's trust policy later. For more information about IAM roles, go to Using Roles to Delegate Permissions and Federate Identities. A role can also have an attached managed policy. For information about policies, see Managed Policies and Inline Policies in the User Guide. For information about limits on the number of inline policies that you can embed with a role, see Limitations on Entities in the User Guide. If an external policy (such as AWS::IAM::Policy or
    roleName String
    A name for the IAM role, up to 64 characters in length. For valid values, see the RoleName parameter for the CreateRole action in the User Guide. This parameter allows (per its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-. The role name must be unique within the account. Role names are not distinguished by case. For example, you cannot create roles named both "Role1" and "role1". If you don't specify a name, CFN generates a unique physical ID and uses that ID for the role name. If you specify a name, you must specify the CAPABILITY_NAMED_IAM value to acknowledge your template's capabilities. For more information, see [Acknowledging Resources in Templates](https://docs.aws.amazon.com/AWSCloudFormation/latest/Use
    tags List<Tag>
    A list of tags that are attached to the role. For more information about tagging, see Tagging IAM resources in the IAM User Guide.
    assumeRolePolicyDocument any

    The trust policy that is associated with this role. Trust policies define which entities can assume the role. You can associate only one trust policy with a role. For an example of a policy that can be used to assume a role, see Template Examples. For more information about the elements that you can use in an IAM policy, see Policy Elements Reference in the User Guide.

    Search the CloudFormation User Guide for AWS::IAM::Role for more information about the expected schema for this property.

    description string
    A description of the role that you provide.
    managedPolicyArns string[]
    A list of Amazon Resource Names (ARNs) of the IAM managed policies that you want to attach to the role. For more information about ARNs, see Amazon Resource Names (ARNs) and Service Namespaces in the General Reference.
    maxSessionDuration number
    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 value of one hour is applied. This setting can have a value from 1 hour to 12 hours. Anyone who assumes the role from the CLI or API can use the DurationSeconds API parameter or the duration-seconds CLI parameter to request a longer session. The MaxSessionDuration setting determines the maximum duration that can be requested using the DurationSeconds parameter. If users don't specify a value for the DurationSeconds parameter, their security credentials are valid for one hour by default. This applies when you use the AssumeRole* API operations or the assume-role* CLI operations but does not apply when you use those operations to create a console URL. For more information, see Using IAM roles in the IAM User Guide.
    path string
    The path to the role. For more information about paths, see IAM Identifiers in the IAM User Guide. This parameter is optional. If it is not included, it defaults to a slash (/). This parameter allows (through its regex pattern) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021) through the DEL character (\u007F), including most punctuation characters, digits, and upper and lowercased letters.
    permissionsBoundary string
    The ARN of the policy used to set the permissions boundary for the role. For more information about permissions boundaries, see Permissions boundaries for IAM identities in the IAM User Guide.
    policies RolePolicy[]
    Adds or updates an inline policy document that is embedded in the specified IAM role. When you embed an inline policy in a role, the inline policy is used as part of the role's access (permissions) policy. The role's trust policy is created at the same time as the role. You can update a role's trust policy later. For more information about IAM roles, go to Using Roles to Delegate Permissions and Federate Identities. A role can also have an attached managed policy. For information about policies, see Managed Policies and Inline Policies in the User Guide. For information about limits on the number of inline policies that you can embed with a role, see Limitations on Entities in the User Guide. If an external policy (such as AWS::IAM::Policy or
    roleName string
    A name for the IAM role, up to 64 characters in length. For valid values, see the RoleName parameter for the CreateRole action in the User Guide. This parameter allows (per its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-. The role name must be unique within the account. Role names are not distinguished by case. For example, you cannot create roles named both "Role1" and "role1". If you don't specify a name, CFN generates a unique physical ID and uses that ID for the role name. If you specify a name, you must specify the CAPABILITY_NAMED_IAM value to acknowledge your template's capabilities. For more information, see [Acknowledging Resources in Templates](https://docs.aws.amazon.com/AWSCloudFormation/latest/Use
    tags Tag[]
    A list of tags that are attached to the role. For more information about tagging, see Tagging IAM resources in the IAM User Guide.
    assume_role_policy_document Any

    The trust policy that is associated with this role. Trust policies define which entities can assume the role. You can associate only one trust policy with a role. For an example of a policy that can be used to assume a role, see Template Examples. For more information about the elements that you can use in an IAM policy, see Policy Elements Reference in the User Guide.

    Search the CloudFormation User Guide for AWS::IAM::Role for more information about the expected schema for this property.

    description str
    A description of the role that you provide.
    managed_policy_arns Sequence[str]
    A list of Amazon Resource Names (ARNs) of the IAM managed policies that you want to attach to the role. For more information about ARNs, see Amazon Resource Names (ARNs) and Service Namespaces in the General Reference.
    max_session_duration int
    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 value of one hour is applied. This setting can have a value from 1 hour to 12 hours. Anyone who assumes the role from the CLI or API can use the DurationSeconds API parameter or the duration-seconds CLI parameter to request a longer session. The MaxSessionDuration setting determines the maximum duration that can be requested using the DurationSeconds parameter. If users don't specify a value for the DurationSeconds parameter, their security credentials are valid for one hour by default. This applies when you use the AssumeRole* API operations or the assume-role* CLI operations but does not apply when you use those operations to create a console URL. For more information, see Using IAM roles in the IAM User Guide.
    path str
    The path to the role. For more information about paths, see IAM Identifiers in the IAM User Guide. This parameter is optional. If it is not included, it defaults to a slash (/). This parameter allows (through its regex pattern) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021) through the DEL character (\u007F), including most punctuation characters, digits, and upper and lowercased letters.
    permissions_boundary str
    The ARN of the policy used to set the permissions boundary for the role. For more information about permissions boundaries, see Permissions boundaries for IAM identities in the IAM User Guide.
    policies Sequence[RolePolicyArgs]
    Adds or updates an inline policy document that is embedded in the specified IAM role. When you embed an inline policy in a role, the inline policy is used as part of the role's access (permissions) policy. The role's trust policy is created at the same time as the role. You can update a role's trust policy later. For more information about IAM roles, go to Using Roles to Delegate Permissions and Federate Identities. A role can also have an attached managed policy. For information about policies, see Managed Policies and Inline Policies in the User Guide. For information about limits on the number of inline policies that you can embed with a role, see Limitations on Entities in the User Guide. If an external policy (such as AWS::IAM::Policy or
    role_name str
    A name for the IAM role, up to 64 characters in length. For valid values, see the RoleName parameter for the CreateRole action in the User Guide. This parameter allows (per its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-. The role name must be unique within the account. Role names are not distinguished by case. For example, you cannot create roles named both "Role1" and "role1". If you don't specify a name, CFN generates a unique physical ID and uses that ID for the role name. If you specify a name, you must specify the CAPABILITY_NAMED_IAM value to acknowledge your template's capabilities. For more information, see [Acknowledging Resources in Templates](https://docs.aws.amazon.com/AWSCloudFormation/latest/Use
    tags TagArgs]
    A list of tags that are attached to the role. For more information about tagging, see Tagging IAM resources in the IAM User Guide.
    assumeRolePolicyDocument Any

    The trust policy that is associated with this role. Trust policies define which entities can assume the role. You can associate only one trust policy with a role. For an example of a policy that can be used to assume a role, see Template Examples. For more information about the elements that you can use in an IAM policy, see Policy Elements Reference in the User Guide.

    Search the CloudFormation User Guide for AWS::IAM::Role for more information about the expected schema for this property.

    description String
    A description of the role that you provide.
    managedPolicyArns List<String>
    A list of Amazon Resource Names (ARNs) of the IAM managed policies that you want to attach to the role. For more information about ARNs, see Amazon Resource Names (ARNs) and Service Namespaces in the General Reference.
    maxSessionDuration Number
    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 value of one hour is applied. This setting can have a value from 1 hour to 12 hours. Anyone who assumes the role from the CLI or API can use the DurationSeconds API parameter or the duration-seconds CLI parameter to request a longer session. The MaxSessionDuration setting determines the maximum duration that can be requested using the DurationSeconds parameter. If users don't specify a value for the DurationSeconds parameter, their security credentials are valid for one hour by default. This applies when you use the AssumeRole* API operations or the assume-role* CLI operations but does not apply when you use those operations to create a console URL. For more information, see Using IAM roles in the IAM User Guide.
    path String
    The path to the role. For more information about paths, see IAM Identifiers in the IAM User Guide. This parameter is optional. If it is not included, it defaults to a slash (/). This parameter allows (through its regex pattern) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021) through the DEL character (\u007F), including most punctuation characters, digits, and upper and lowercased letters.
    permissionsBoundary String
    The ARN of the policy used to set the permissions boundary for the role. For more information about permissions boundaries, see Permissions boundaries for IAM identities in the IAM User Guide.
    policies List<Property Map>
    Adds or updates an inline policy document that is embedded in the specified IAM role. When you embed an inline policy in a role, the inline policy is used as part of the role's access (permissions) policy. The role's trust policy is created at the same time as the role. You can update a role's trust policy later. For more information about IAM roles, go to Using Roles to Delegate Permissions and Federate Identities. A role can also have an attached managed policy. For information about policies, see Managed Policies and Inline Policies in the User Guide. For information about limits on the number of inline policies that you can embed with a role, see Limitations on Entities in the User Guide. If an external policy (such as AWS::IAM::Policy or
    roleName String
    A name for the IAM role, up to 64 characters in length. For valid values, see the RoleName parameter for the CreateRole action in the User Guide. This parameter allows (per its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-. The role name must be unique within the account. Role names are not distinguished by case. For example, you cannot create roles named both "Role1" and "role1". If you don't specify a name, CFN generates a unique physical ID and uses that ID for the role name. If you specify a name, you must specify the CAPABILITY_NAMED_IAM value to acknowledge your template's capabilities. For more information, see [Acknowledging Resources in Templates](https://docs.aws.amazon.com/AWSCloudFormation/latest/Use
    tags List<Property Map>
    A list of tags that are attached to the role. For more information about tagging, see Tagging IAM resources in the IAM User Guide.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Role resource produces the following output properties:

    Arn string
    Id string
    The provider-assigned unique ID for this managed resource.
    RoleId string
    Arn string
    Id string
    The provider-assigned unique ID for this managed resource.
    RoleId string
    arn String
    id String
    The provider-assigned unique ID for this managed resource.
    roleId String
    arn string
    id string
    The provider-assigned unique ID for this managed resource.
    roleId string
    arn str
    id str
    The provider-assigned unique ID for this managed resource.
    role_id str
    arn String
    id String
    The provider-assigned unique ID for this managed resource.
    roleId String

    Supporting Types

    RolePolicy, RolePolicyArgs

    PolicyDocument object
    The entire contents of the policy that defines permissions. For more information, see Overview of JSON policies.
    PolicyName string
    The friendly name (not ARN) identifying the policy.
    PolicyDocument interface{}
    The entire contents of the policy that defines permissions. For more information, see Overview of JSON policies.
    PolicyName string
    The friendly name (not ARN) identifying the policy.
    policyDocument Object
    The entire contents of the policy that defines permissions. For more information, see Overview of JSON policies.
    policyName String
    The friendly name (not ARN) identifying the policy.
    policyDocument any
    The entire contents of the policy that defines permissions. For more information, see Overview of JSON policies.
    policyName string
    The friendly name (not ARN) identifying the policy.
    policy_document Any
    The entire contents of the policy that defines permissions. For more information, see Overview of JSON policies.
    policy_name str
    The friendly name (not ARN) identifying the policy.
    policyDocument Any
    The entire contents of the policy that defines permissions. For more information, see Overview of JSON policies.
    policyName String
    The friendly name (not ARN) identifying the policy.

    Tag, TagArgs

    Key string
    The key name of the tag
    Value string
    The value of the tag
    Key string
    The key name of the tag
    Value string
    The value of the tag
    key String
    The key name of the tag
    value String
    The value of the tag
    key string
    The key name of the tag
    value string
    The value of the tag
    key str
    The key name of the tag
    value str
    The value of the tag
    key String
    The key name of the tag
    value String
    The value of the tag

    Package Details

    Repository
    AWS Native pulumi/pulumi-aws-native
    License
    Apache-2.0
    aws-native logo

    AWS Native is in preview. AWS Classic is fully supported.

    AWS Native v0.100.0 published on Wednesday, Mar 27, 2024 by Pulumi