1. Packages
  2. AWS
  3. API Docs
  4. quicksight
  5. IamPolicyAssignment
AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi

aws.quicksight.IamPolicyAssignment

Explore with Pulumi AI

aws logo
AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi

    Resource for managing an AWS QuickSight IAM Policy Assignment.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.quicksight.IamPolicyAssignment("example", {
        assignmentName: "example",
        assignmentStatus: "ENABLED",
        policyArn: exampleAwsIamPolicy.arn,
        identities: {
            users: [exampleAwsQuicksightUser.userName],
        },
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.quicksight.IamPolicyAssignment("example",
        assignment_name="example",
        assignment_status="ENABLED",
        policy_arn=example_aws_iam_policy["arn"],
        identities={
            "users": [example_aws_quicksight_user["userName"]],
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/quicksight"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := quicksight.NewIamPolicyAssignment(ctx, "example", &quicksight.IamPolicyAssignmentArgs{
    			AssignmentName:   pulumi.String("example"),
    			AssignmentStatus: pulumi.String("ENABLED"),
    			PolicyArn:        pulumi.Any(exampleAwsIamPolicy.Arn),
    			Identities: &quicksight.IamPolicyAssignmentIdentitiesArgs{
    				Users: pulumi.StringArray{
    					exampleAwsQuicksightUser.UserName,
    				},
    			},
    		})
    		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 = new Aws.Quicksight.IamPolicyAssignment("example", new()
        {
            AssignmentName = "example",
            AssignmentStatus = "ENABLED",
            PolicyArn = exampleAwsIamPolicy.Arn,
            Identities = new Aws.Quicksight.Inputs.IamPolicyAssignmentIdentitiesArgs
            {
                Users = new[]
                {
                    exampleAwsQuicksightUser.UserName,
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.quicksight.IamPolicyAssignment;
    import com.pulumi.aws.quicksight.IamPolicyAssignmentArgs;
    import com.pulumi.aws.quicksight.inputs.IamPolicyAssignmentIdentitiesArgs;
    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) {
            var example = new IamPolicyAssignment("example", IamPolicyAssignmentArgs.builder()
                .assignmentName("example")
                .assignmentStatus("ENABLED")
                .policyArn(exampleAwsIamPolicy.arn())
                .identities(IamPolicyAssignmentIdentitiesArgs.builder()
                    .users(exampleAwsQuicksightUser.userName())
                    .build())
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:quicksight:IamPolicyAssignment
        properties:
          assignmentName: example
          assignmentStatus: ENABLED
          policyArn: ${exampleAwsIamPolicy.arn}
          identities:
            users:
              - ${exampleAwsQuicksightUser.userName}
    

    Create IamPolicyAssignment Resource

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

    Constructor syntax

    new IamPolicyAssignment(name: string, args: IamPolicyAssignmentArgs, opts?: CustomResourceOptions);
    @overload
    def IamPolicyAssignment(resource_name: str,
                            args: IamPolicyAssignmentArgs,
                            opts: Optional[ResourceOptions] = None)
    
    @overload
    def IamPolicyAssignment(resource_name: str,
                            opts: Optional[ResourceOptions] = None,
                            assignment_name: Optional[str] = None,
                            assignment_status: Optional[str] = None,
                            aws_account_id: Optional[str] = None,
                            identities: Optional[IamPolicyAssignmentIdentitiesArgs] = None,
                            namespace: Optional[str] = None,
                            policy_arn: Optional[str] = None)
    func NewIamPolicyAssignment(ctx *Context, name string, args IamPolicyAssignmentArgs, opts ...ResourceOption) (*IamPolicyAssignment, error)
    public IamPolicyAssignment(string name, IamPolicyAssignmentArgs args, CustomResourceOptions? opts = null)
    public IamPolicyAssignment(String name, IamPolicyAssignmentArgs args)
    public IamPolicyAssignment(String name, IamPolicyAssignmentArgs args, CustomResourceOptions options)
    
    type: aws:quicksight:IamPolicyAssignment
    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 IamPolicyAssignmentArgs
    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 IamPolicyAssignmentArgs
    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 IamPolicyAssignmentArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args IamPolicyAssignmentArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args IamPolicyAssignmentArgs
    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 iamPolicyAssignmentResource = new Aws.Quicksight.IamPolicyAssignment("iamPolicyAssignmentResource", new()
    {
        AssignmentName = "string",
        AssignmentStatus = "string",
        AwsAccountId = "string",
        Identities = new Aws.Quicksight.Inputs.IamPolicyAssignmentIdentitiesArgs
        {
            Groups = new[]
            {
                "string",
            },
            Users = new[]
            {
                "string",
            },
        },
        Namespace = "string",
        PolicyArn = "string",
    });
    
    example, err := quicksight.NewIamPolicyAssignment(ctx, "iamPolicyAssignmentResource", &quicksight.IamPolicyAssignmentArgs{
    	AssignmentName:   pulumi.String("string"),
    	AssignmentStatus: pulumi.String("string"),
    	AwsAccountId:     pulumi.String("string"),
    	Identities: &quicksight.IamPolicyAssignmentIdentitiesArgs{
    		Groups: pulumi.StringArray{
    			pulumi.String("string"),
    		},
    		Users: pulumi.StringArray{
    			pulumi.String("string"),
    		},
    	},
    	Namespace: pulumi.String("string"),
    	PolicyArn: pulumi.String("string"),
    })
    
    var iamPolicyAssignmentResource = new IamPolicyAssignment("iamPolicyAssignmentResource", IamPolicyAssignmentArgs.builder()
        .assignmentName("string")
        .assignmentStatus("string")
        .awsAccountId("string")
        .identities(IamPolicyAssignmentIdentitiesArgs.builder()
            .groups("string")
            .users("string")
            .build())
        .namespace("string")
        .policyArn("string")
        .build());
    
    iam_policy_assignment_resource = aws.quicksight.IamPolicyAssignment("iamPolicyAssignmentResource",
        assignment_name="string",
        assignment_status="string",
        aws_account_id="string",
        identities={
            "groups": ["string"],
            "users": ["string"],
        },
        namespace="string",
        policy_arn="string")
    
    const iamPolicyAssignmentResource = new aws.quicksight.IamPolicyAssignment("iamPolicyAssignmentResource", {
        assignmentName: "string",
        assignmentStatus: "string",
        awsAccountId: "string",
        identities: {
            groups: ["string"],
            users: ["string"],
        },
        namespace: "string",
        policyArn: "string",
    });
    
    type: aws:quicksight:IamPolicyAssignment
    properties:
        assignmentName: string
        assignmentStatus: string
        awsAccountId: string
        identities:
            groups:
                - string
            users:
                - string
        namespace: string
        policyArn: string
    

    IamPolicyAssignment 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 IamPolicyAssignment resource accepts the following input properties:

    AssignmentName string
    Name of the assignment.
    AssignmentStatus string

    Status of the assignment. Valid values are ENABLED, DISABLED, and DRAFT.

    The following arguments are optional:

    AwsAccountId string
    AWS account ID.
    Identities IamPolicyAssignmentIdentities
    Amazon QuickSight users, groups, or both to assign the policy to. See identities block.
    Namespace string
    Namespace that contains the assignment. Defaults to default.
    PolicyArn string
    ARN of the IAM policy to apply to the Amazon QuickSight users and groups specified in this assignment.
    AssignmentName string
    Name of the assignment.
    AssignmentStatus string

    Status of the assignment. Valid values are ENABLED, DISABLED, and DRAFT.

    The following arguments are optional:

    AwsAccountId string
    AWS account ID.
    Identities IamPolicyAssignmentIdentitiesArgs
    Amazon QuickSight users, groups, or both to assign the policy to. See identities block.
    Namespace string
    Namespace that contains the assignment. Defaults to default.
    PolicyArn string
    ARN of the IAM policy to apply to the Amazon QuickSight users and groups specified in this assignment.
    assignmentName String
    Name of the assignment.
    assignmentStatus String

    Status of the assignment. Valid values are ENABLED, DISABLED, and DRAFT.

    The following arguments are optional:

    awsAccountId String
    AWS account ID.
    identities IamPolicyAssignmentIdentities
    Amazon QuickSight users, groups, or both to assign the policy to. See identities block.
    namespace String
    Namespace that contains the assignment. Defaults to default.
    policyArn String
    ARN of the IAM policy to apply to the Amazon QuickSight users and groups specified in this assignment.
    assignmentName string
    Name of the assignment.
    assignmentStatus string

    Status of the assignment. Valid values are ENABLED, DISABLED, and DRAFT.

    The following arguments are optional:

    awsAccountId string
    AWS account ID.
    identities IamPolicyAssignmentIdentities
    Amazon QuickSight users, groups, or both to assign the policy to. See identities block.
    namespace string
    Namespace that contains the assignment. Defaults to default.
    policyArn string
    ARN of the IAM policy to apply to the Amazon QuickSight users and groups specified in this assignment.
    assignment_name str
    Name of the assignment.
    assignment_status str

    Status of the assignment. Valid values are ENABLED, DISABLED, and DRAFT.

    The following arguments are optional:

    aws_account_id str
    AWS account ID.
    identities IamPolicyAssignmentIdentitiesArgs
    Amazon QuickSight users, groups, or both to assign the policy to. See identities block.
    namespace str
    Namespace that contains the assignment. Defaults to default.
    policy_arn str
    ARN of the IAM policy to apply to the Amazon QuickSight users and groups specified in this assignment.
    assignmentName String
    Name of the assignment.
    assignmentStatus String

    Status of the assignment. Valid values are ENABLED, DISABLED, and DRAFT.

    The following arguments are optional:

    awsAccountId String
    AWS account ID.
    identities Property Map
    Amazon QuickSight users, groups, or both to assign the policy to. See identities block.
    namespace String
    Namespace that contains the assignment. Defaults to default.
    policyArn String
    ARN of the IAM policy to apply to the Amazon QuickSight users and groups specified in this assignment.

    Outputs

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

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

    Look up Existing IamPolicyAssignment Resource

    Get an existing IamPolicyAssignment 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?: IamPolicyAssignmentState, opts?: CustomResourceOptions): IamPolicyAssignment
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            assignment_id: Optional[str] = None,
            assignment_name: Optional[str] = None,
            assignment_status: Optional[str] = None,
            aws_account_id: Optional[str] = None,
            identities: Optional[IamPolicyAssignmentIdentitiesArgs] = None,
            namespace: Optional[str] = None,
            policy_arn: Optional[str] = None) -> IamPolicyAssignment
    func GetIamPolicyAssignment(ctx *Context, name string, id IDInput, state *IamPolicyAssignmentState, opts ...ResourceOption) (*IamPolicyAssignment, error)
    public static IamPolicyAssignment Get(string name, Input<string> id, IamPolicyAssignmentState? state, CustomResourceOptions? opts = null)
    public static IamPolicyAssignment get(String name, Output<String> id, IamPolicyAssignmentState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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:
    AssignmentId string
    Assignment ID.
    AssignmentName string
    Name of the assignment.
    AssignmentStatus string

    Status of the assignment. Valid values are ENABLED, DISABLED, and DRAFT.

    The following arguments are optional:

    AwsAccountId string
    AWS account ID.
    Identities IamPolicyAssignmentIdentities
    Amazon QuickSight users, groups, or both to assign the policy to. See identities block.
    Namespace string
    Namespace that contains the assignment. Defaults to default.
    PolicyArn string
    ARN of the IAM policy to apply to the Amazon QuickSight users and groups specified in this assignment.
    AssignmentId string
    Assignment ID.
    AssignmentName string
    Name of the assignment.
    AssignmentStatus string

    Status of the assignment. Valid values are ENABLED, DISABLED, and DRAFT.

    The following arguments are optional:

    AwsAccountId string
    AWS account ID.
    Identities IamPolicyAssignmentIdentitiesArgs
    Amazon QuickSight users, groups, or both to assign the policy to. See identities block.
    Namespace string
    Namespace that contains the assignment. Defaults to default.
    PolicyArn string
    ARN of the IAM policy to apply to the Amazon QuickSight users and groups specified in this assignment.
    assignmentId String
    Assignment ID.
    assignmentName String
    Name of the assignment.
    assignmentStatus String

    Status of the assignment. Valid values are ENABLED, DISABLED, and DRAFT.

    The following arguments are optional:

    awsAccountId String
    AWS account ID.
    identities IamPolicyAssignmentIdentities
    Amazon QuickSight users, groups, or both to assign the policy to. See identities block.
    namespace String
    Namespace that contains the assignment. Defaults to default.
    policyArn String
    ARN of the IAM policy to apply to the Amazon QuickSight users and groups specified in this assignment.
    assignmentId string
    Assignment ID.
    assignmentName string
    Name of the assignment.
    assignmentStatus string

    Status of the assignment. Valid values are ENABLED, DISABLED, and DRAFT.

    The following arguments are optional:

    awsAccountId string
    AWS account ID.
    identities IamPolicyAssignmentIdentities
    Amazon QuickSight users, groups, or both to assign the policy to. See identities block.
    namespace string
    Namespace that contains the assignment. Defaults to default.
    policyArn string
    ARN of the IAM policy to apply to the Amazon QuickSight users and groups specified in this assignment.
    assignment_id str
    Assignment ID.
    assignment_name str
    Name of the assignment.
    assignment_status str

    Status of the assignment. Valid values are ENABLED, DISABLED, and DRAFT.

    The following arguments are optional:

    aws_account_id str
    AWS account ID.
    identities IamPolicyAssignmentIdentitiesArgs
    Amazon QuickSight users, groups, or both to assign the policy to. See identities block.
    namespace str
    Namespace that contains the assignment. Defaults to default.
    policy_arn str
    ARN of the IAM policy to apply to the Amazon QuickSight users and groups specified in this assignment.
    assignmentId String
    Assignment ID.
    assignmentName String
    Name of the assignment.
    assignmentStatus String

    Status of the assignment. Valid values are ENABLED, DISABLED, and DRAFT.

    The following arguments are optional:

    awsAccountId String
    AWS account ID.
    identities Property Map
    Amazon QuickSight users, groups, or both to assign the policy to. See identities block.
    namespace String
    Namespace that contains the assignment. Defaults to default.
    policyArn String
    ARN of the IAM policy to apply to the Amazon QuickSight users and groups specified in this assignment.

    Supporting Types

    IamPolicyAssignmentIdentities, IamPolicyAssignmentIdentitiesArgs

    Groups List<string>
    Array of Quicksight group names to assign the policy to.
    Users List<string>
    Array of Quicksight user names to assign the policy to.
    Groups []string
    Array of Quicksight group names to assign the policy to.
    Users []string
    Array of Quicksight user names to assign the policy to.
    groups List<String>
    Array of Quicksight group names to assign the policy to.
    users List<String>
    Array of Quicksight user names to assign the policy to.
    groups string[]
    Array of Quicksight group names to assign the policy to.
    users string[]
    Array of Quicksight user names to assign the policy to.
    groups Sequence[str]
    Array of Quicksight group names to assign the policy to.
    users Sequence[str]
    Array of Quicksight user names to assign the policy to.
    groups List<String>
    Array of Quicksight group names to assign the policy to.
    users List<String>
    Array of Quicksight user names to assign the policy to.

    Import

    Using pulumi import, import QuickSight IAM Policy Assignment using the AWS account ID, namespace, and assignment name separated by commas (,). For example:

    $ pulumi import aws:quicksight/iamPolicyAssignment:IamPolicyAssignment example 123456789012,default,example
    

    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
    AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi