1. Packages
  2. AWS
  3. API Docs
  4. ssoadmin
  5. PermissionSetInlinePolicy
Viewing docs for AWS v7.22.0
published on Wednesday, Mar 11, 2026 by Pulumi
aws logo
Viewing docs for AWS v7.22.0
published on Wednesday, Mar 11, 2026 by Pulumi

    Provides an IAM inline policy for a Single Sign-On (SSO) Permission Set resource

    NOTE: AWS Single Sign-On (SSO) only supports one IAM inline policy per aws.ssoadmin.PermissionSet resource. Creating or updating this resource will automatically Provision the Permission Set to apply the corresponding updates to all assigned accounts.

    NOTE: We suggest using jsonencode() or aws.iam.getPolicyDocument when assigning a value to inline_policy. They seamlessly translate Terraform language into JSON, enabling you to maintain consistency within your configuration without the need for context switches. Also, you can sidestep potential complications arising from formatting discrepancies, whitespace inconsistencies, and other nuances inherent to JSON.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = aws.ssoadmin.getInstances({});
    const examplePermissionSet = new aws.ssoadmin.PermissionSet("example", {
        name: "Example",
        instanceArn: example.then(example => example.arns?.[0]),
    });
    const exampleGetPolicyDocument = aws.iam.getPolicyDocument({
        statements: [{
            sid: "1",
            actions: [
                "s3:ListAllMyBuckets",
                "s3:GetBucketLocation",
            ],
            resources: ["arn:aws:s3:::*"],
        }],
    });
    const examplePermissionSetInlinePolicy = new aws.ssoadmin.PermissionSetInlinePolicy("example", {
        inlinePolicy: exampleGetPolicyDocument.then(exampleGetPolicyDocument => exampleGetPolicyDocument.json),
        instanceArn: example.then(example => example.arns?.[0]),
        permissionSetArn: examplePermissionSet.arn,
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.ssoadmin.get_instances()
    example_permission_set = aws.ssoadmin.PermissionSet("example",
        name="Example",
        instance_arn=example.arns[0])
    example_get_policy_document = aws.iam.get_policy_document(statements=[{
        "sid": "1",
        "actions": [
            "s3:ListAllMyBuckets",
            "s3:GetBucketLocation",
        ],
        "resources": ["arn:aws:s3:::*"],
    }])
    example_permission_set_inline_policy = aws.ssoadmin.PermissionSetInlinePolicy("example",
        inline_policy=example_get_policy_document.json,
        instance_arn=example.arns[0],
        permission_set_arn=example_permission_set.arn)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/iam"
    	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/ssoadmin"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := ssoadmin.GetInstances(ctx, &ssoadmin.GetInstancesArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		examplePermissionSet, err := ssoadmin.NewPermissionSet(ctx, "example", &ssoadmin.PermissionSetArgs{
    			Name:        pulumi.String("Example"),
    			InstanceArn: pulumi.String(example.Arns[0]),
    		})
    		if err != nil {
    			return err
    		}
    		exampleGetPolicyDocument, err := iam.GetPolicyDocument(ctx, &iam.GetPolicyDocumentArgs{
    			Statements: []iam.GetPolicyDocumentStatement{
    				{
    					Sid: pulumi.StringRef("1"),
    					Actions: []string{
    						"s3:ListAllMyBuckets",
    						"s3:GetBucketLocation",
    					},
    					Resources: []string{
    						"arn:aws:s3:::*",
    					},
    				},
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = ssoadmin.NewPermissionSetInlinePolicy(ctx, "example", &ssoadmin.PermissionSetInlinePolicyArgs{
    			InlinePolicy:     pulumi.String(exampleGetPolicyDocument.Json),
    			InstanceArn:      pulumi.String(example.Arns[0]),
    			PermissionSetArn: examplePermissionSet.Arn,
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Aws.SsoAdmin.GetInstances.Invoke();
    
        var examplePermissionSet = new Aws.SsoAdmin.PermissionSet("example", new()
        {
            Name = "Example",
            InstanceArn = example.Apply(getInstancesResult => getInstancesResult.Arns[0]),
        });
    
        var exampleGetPolicyDocument = Aws.Iam.GetPolicyDocument.Invoke(new()
        {
            Statements = new[]
            {
                new Aws.Iam.Inputs.GetPolicyDocumentStatementInputArgs
                {
                    Sid = "1",
                    Actions = new[]
                    {
                        "s3:ListAllMyBuckets",
                        "s3:GetBucketLocation",
                    },
                    Resources = new[]
                    {
                        "arn:aws:s3:::*",
                    },
                },
            },
        });
    
        var examplePermissionSetInlinePolicy = new Aws.SsoAdmin.PermissionSetInlinePolicy("example", new()
        {
            InlinePolicy = exampleGetPolicyDocument.Apply(getPolicyDocumentResult => getPolicyDocumentResult.Json),
            InstanceArn = example.Apply(getInstancesResult => getInstancesResult.Arns[0]),
            PermissionSetArn = examplePermissionSet.Arn,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.ssoadmin.SsoadminFunctions;
    import com.pulumi.aws.ssoadmin.inputs.GetInstancesArgs;
    import com.pulumi.aws.ssoadmin.PermissionSet;
    import com.pulumi.aws.ssoadmin.PermissionSetArgs;
    import com.pulumi.aws.iam.IamFunctions;
    import com.pulumi.aws.iam.inputs.GetPolicyDocumentArgs;
    import com.pulumi.aws.ssoadmin.PermissionSetInlinePolicy;
    import com.pulumi.aws.ssoadmin.PermissionSetInlinePolicyArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var example = SsoadminFunctions.getInstances(GetInstancesArgs.builder()
                .build());
    
            var examplePermissionSet = new PermissionSet("examplePermissionSet", PermissionSetArgs.builder()
                .name("Example")
                .instanceArn(example.arns()[0])
                .build());
    
            final var exampleGetPolicyDocument = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()
                .statements(GetPolicyDocumentStatementArgs.builder()
                    .sid("1")
                    .actions(                
                        "s3:ListAllMyBuckets",
                        "s3:GetBucketLocation")
                    .resources("arn:aws:s3:::*")
                    .build())
                .build());
    
            var examplePermissionSetInlinePolicy = new PermissionSetInlinePolicy("examplePermissionSetInlinePolicy", PermissionSetInlinePolicyArgs.builder()
                .inlinePolicy(exampleGetPolicyDocument.json())
                .instanceArn(example.arns()[0])
                .permissionSetArn(examplePermissionSet.arn())
                .build());
    
        }
    }
    
    resources:
      examplePermissionSet:
        type: aws:ssoadmin:PermissionSet
        name: example
        properties:
          name: Example
          instanceArn: ${example.arns[0]}
      examplePermissionSetInlinePolicy:
        type: aws:ssoadmin:PermissionSetInlinePolicy
        name: example
        properties:
          inlinePolicy: ${exampleGetPolicyDocument.json}
          instanceArn: ${example.arns[0]}
          permissionSetArn: ${examplePermissionSet.arn}
    variables:
      example:
        fn::invoke:
          function: aws:ssoadmin:getInstances
          arguments: {}
      exampleGetPolicyDocument:
        fn::invoke:
          function: aws:iam:getPolicyDocument
          arguments:
            statements:
              - sid: '1'
                actions:
                  - s3:ListAllMyBuckets
                  - s3:GetBucketLocation
                resources:
                  - arn:aws:s3:::*
    

    Create PermissionSetInlinePolicy Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new PermissionSetInlinePolicy(name: string, args: PermissionSetInlinePolicyArgs, opts?: CustomResourceOptions);
    @overload
    def PermissionSetInlinePolicy(resource_name: str,
                                  args: PermissionSetInlinePolicyArgs,
                                  opts: Optional[ResourceOptions] = None)
    
    @overload
    def PermissionSetInlinePolicy(resource_name: str,
                                  opts: Optional[ResourceOptions] = None,
                                  inline_policy: Optional[str] = None,
                                  instance_arn: Optional[str] = None,
                                  permission_set_arn: Optional[str] = None,
                                  region: Optional[str] = None)
    func NewPermissionSetInlinePolicy(ctx *Context, name string, args PermissionSetInlinePolicyArgs, opts ...ResourceOption) (*PermissionSetInlinePolicy, error)
    public PermissionSetInlinePolicy(string name, PermissionSetInlinePolicyArgs args, CustomResourceOptions? opts = null)
    public PermissionSetInlinePolicy(String name, PermissionSetInlinePolicyArgs args)
    public PermissionSetInlinePolicy(String name, PermissionSetInlinePolicyArgs args, CustomResourceOptions options)
    
    type: aws:ssoadmin:PermissionSetInlinePolicy
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args PermissionSetInlinePolicyArgs
    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 PermissionSetInlinePolicyArgs
    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 PermissionSetInlinePolicyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args PermissionSetInlinePolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args PermissionSetInlinePolicyArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var permissionSetInlinePolicyResource = new Aws.SsoAdmin.PermissionSetInlinePolicy("permissionSetInlinePolicyResource", new()
    {
        InlinePolicy = "string",
        InstanceArn = "string",
        PermissionSetArn = "string",
        Region = "string",
    });
    
    example, err := ssoadmin.NewPermissionSetInlinePolicy(ctx, "permissionSetInlinePolicyResource", &ssoadmin.PermissionSetInlinePolicyArgs{
    	InlinePolicy:     pulumi.String("string"),
    	InstanceArn:      pulumi.String("string"),
    	PermissionSetArn: pulumi.String("string"),
    	Region:           pulumi.String("string"),
    })
    
    var permissionSetInlinePolicyResource = new PermissionSetInlinePolicy("permissionSetInlinePolicyResource", PermissionSetInlinePolicyArgs.builder()
        .inlinePolicy("string")
        .instanceArn("string")
        .permissionSetArn("string")
        .region("string")
        .build());
    
    permission_set_inline_policy_resource = aws.ssoadmin.PermissionSetInlinePolicy("permissionSetInlinePolicyResource",
        inline_policy="string",
        instance_arn="string",
        permission_set_arn="string",
        region="string")
    
    const permissionSetInlinePolicyResource = new aws.ssoadmin.PermissionSetInlinePolicy("permissionSetInlinePolicyResource", {
        inlinePolicy: "string",
        instanceArn: "string",
        permissionSetArn: "string",
        region: "string",
    });
    
    type: aws:ssoadmin:PermissionSetInlinePolicy
    properties:
        inlinePolicy: string
        instanceArn: string
        permissionSetArn: string
        region: string
    

    PermissionSetInlinePolicy Resource Properties

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

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The PermissionSetInlinePolicy resource accepts the following input properties:

    InlinePolicy string
    The IAM inline policy to attach to a Permission Set.
    InstanceArn string
    The Amazon Resource Name (ARN) of the SSO Instance under which the operation will be executed.
    PermissionSetArn string
    The Amazon Resource Name (ARN) of the Permission Set.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    InlinePolicy string
    The IAM inline policy to attach to a Permission Set.
    InstanceArn string
    The Amazon Resource Name (ARN) of the SSO Instance under which the operation will be executed.
    PermissionSetArn string
    The Amazon Resource Name (ARN) of the Permission Set.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    inlinePolicy String
    The IAM inline policy to attach to a Permission Set.
    instanceArn String
    The Amazon Resource Name (ARN) of the SSO Instance under which the operation will be executed.
    permissionSetArn String
    The Amazon Resource Name (ARN) of the Permission Set.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    inlinePolicy string
    The IAM inline policy to attach to a Permission Set.
    instanceArn string
    The Amazon Resource Name (ARN) of the SSO Instance under which the operation will be executed.
    permissionSetArn string
    The Amazon Resource Name (ARN) of the Permission Set.
    region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    inline_policy str
    The IAM inline policy to attach to a Permission Set.
    instance_arn str
    The Amazon Resource Name (ARN) of the SSO Instance under which the operation will be executed.
    permission_set_arn str
    The Amazon Resource Name (ARN) of the Permission Set.
    region str
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    inlinePolicy String
    The IAM inline policy to attach to a Permission Set.
    instanceArn String
    The Amazon Resource Name (ARN) of the SSO Instance under which the operation will be executed.
    permissionSetArn String
    The Amazon Resource Name (ARN) of the Permission Set.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing PermissionSetInlinePolicy Resource

    Get an existing PermissionSetInlinePolicy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: PermissionSetInlinePolicyState, opts?: CustomResourceOptions): PermissionSetInlinePolicy
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            inline_policy: Optional[str] = None,
            instance_arn: Optional[str] = None,
            permission_set_arn: Optional[str] = None,
            region: Optional[str] = None) -> PermissionSetInlinePolicy
    func GetPermissionSetInlinePolicy(ctx *Context, name string, id IDInput, state *PermissionSetInlinePolicyState, opts ...ResourceOption) (*PermissionSetInlinePolicy, error)
    public static PermissionSetInlinePolicy Get(string name, Input<string> id, PermissionSetInlinePolicyState? state, CustomResourceOptions? opts = null)
    public static PermissionSetInlinePolicy get(String name, Output<String> id, PermissionSetInlinePolicyState state, CustomResourceOptions options)
    resources:  _:    type: aws:ssoadmin:PermissionSetInlinePolicy    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    InlinePolicy string
    The IAM inline policy to attach to a Permission Set.
    InstanceArn string
    The Amazon Resource Name (ARN) of the SSO Instance under which the operation will be executed.
    PermissionSetArn string
    The Amazon Resource Name (ARN) of the Permission Set.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    InlinePolicy string
    The IAM inline policy to attach to a Permission Set.
    InstanceArn string
    The Amazon Resource Name (ARN) of the SSO Instance under which the operation will be executed.
    PermissionSetArn string
    The Amazon Resource Name (ARN) of the Permission Set.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    inlinePolicy String
    The IAM inline policy to attach to a Permission Set.
    instanceArn String
    The Amazon Resource Name (ARN) of the SSO Instance under which the operation will be executed.
    permissionSetArn String
    The Amazon Resource Name (ARN) of the Permission Set.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    inlinePolicy string
    The IAM inline policy to attach to a Permission Set.
    instanceArn string
    The Amazon Resource Name (ARN) of the SSO Instance under which the operation will be executed.
    permissionSetArn string
    The Amazon Resource Name (ARN) of the Permission Set.
    region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    inline_policy str
    The IAM inline policy to attach to a Permission Set.
    instance_arn str
    The Amazon Resource Name (ARN) of the SSO Instance under which the operation will be executed.
    permission_set_arn str
    The Amazon Resource Name (ARN) of the Permission Set.
    region str
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    inlinePolicy String
    The IAM inline policy to attach to a Permission Set.
    instanceArn String
    The Amazon Resource Name (ARN) of the SSO Instance under which the operation will be executed.
    permissionSetArn String
    The Amazon Resource Name (ARN) of the Permission Set.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.

    Import

    Using pulumi import, import SSO Permission Set Inline Policies using the permission_set_arn and instance_arn separated by a comma (,). For example:

    $ pulumi import aws:ssoadmin/permissionSetInlinePolicy:PermissionSetInlinePolicy example arn:aws:sso:::permissionSet/ssoins-2938j0x8920sbj72/ps-80383020jr9302rk,arn:aws:sso:::instance/ssoins-2938j0x8920sbj72
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo
    Viewing docs for AWS v7.22.0
    published on Wednesday, Mar 11, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.