aws.quicksight.IamPolicyAssignment
Explore with Pulumi AI
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:
- Assignment
Name string - Name of the assignment.
- Assignment
Status string Status of the assignment. Valid values are
ENABLED
,DISABLED
, andDRAFT
.The following arguments are optional:
- Aws
Account stringId - AWS account ID.
- Identities
Iam
Policy Assignment Identities - Amazon QuickSight users, groups, or both to assign the policy to. See
identities
block. - Namespace string
- Namespace that contains the assignment. Defaults to
default
. - Policy
Arn string - ARN of the IAM policy to apply to the Amazon QuickSight users and groups specified in this assignment.
- Assignment
Name string - Name of the assignment.
- Assignment
Status string Status of the assignment. Valid values are
ENABLED
,DISABLED
, andDRAFT
.The following arguments are optional:
- Aws
Account stringId - AWS account ID.
- Identities
Iam
Policy Assignment Identities Args - Amazon QuickSight users, groups, or both to assign the policy to. See
identities
block. - Namespace string
- Namespace that contains the assignment. Defaults to
default
. - Policy
Arn string - ARN of the IAM policy to apply to the Amazon QuickSight users and groups specified in this assignment.
- assignment
Name String - Name of the assignment.
- assignment
Status String Status of the assignment. Valid values are
ENABLED
,DISABLED
, andDRAFT
.The following arguments are optional:
- aws
Account StringId - AWS account ID.
- identities
Iam
Policy Assignment Identities - Amazon QuickSight users, groups, or both to assign the policy to. See
identities
block. - namespace String
- Namespace that contains the assignment. Defaults to
default
. - policy
Arn String - ARN of the IAM policy to apply to the Amazon QuickSight users and groups specified in this assignment.
- assignment
Name string - Name of the assignment.
- assignment
Status string Status of the assignment. Valid values are
ENABLED
,DISABLED
, andDRAFT
.The following arguments are optional:
- aws
Account stringId - AWS account ID.
- identities
Iam
Policy Assignment Identities - Amazon QuickSight users, groups, or both to assign the policy to. See
identities
block. - namespace string
- Namespace that contains the assignment. Defaults to
default
. - policy
Arn 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
, andDRAFT
.The following arguments are optional:
- aws_
account_ strid - AWS account ID.
- identities
Iam
Policy Assignment Identities Args - 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.
- assignment
Name String - Name of the assignment.
- assignment
Status String Status of the assignment. Valid values are
ENABLED
,DISABLED
, andDRAFT
.The following arguments are optional:
- aws
Account StringId - 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
. - policy
Arn 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:
- Assignment
Id string - Assignment ID.
- Id string
- The provider-assigned unique ID for this managed resource.
- Assignment
Id string - Assignment ID.
- Id string
- The provider-assigned unique ID for this managed resource.
- assignment
Id String - Assignment ID.
- id String
- The provider-assigned unique ID for this managed resource.
- assignment
Id 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.
- assignment
Id 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.
- Assignment
Id string - Assignment ID.
- Assignment
Name string - Name of the assignment.
- Assignment
Status string Status of the assignment. Valid values are
ENABLED
,DISABLED
, andDRAFT
.The following arguments are optional:
- Aws
Account stringId - AWS account ID.
- Identities
Iam
Policy Assignment Identities - Amazon QuickSight users, groups, or both to assign the policy to. See
identities
block. - Namespace string
- Namespace that contains the assignment. Defaults to
default
. - Policy
Arn string - ARN of the IAM policy to apply to the Amazon QuickSight users and groups specified in this assignment.
- Assignment
Id string - Assignment ID.
- Assignment
Name string - Name of the assignment.
- Assignment
Status string Status of the assignment. Valid values are
ENABLED
,DISABLED
, andDRAFT
.The following arguments are optional:
- Aws
Account stringId - AWS account ID.
- Identities
Iam
Policy Assignment Identities Args - Amazon QuickSight users, groups, or both to assign the policy to. See
identities
block. - Namespace string
- Namespace that contains the assignment. Defaults to
default
. - Policy
Arn string - ARN of the IAM policy to apply to the Amazon QuickSight users and groups specified in this assignment.
- assignment
Id String - Assignment ID.
- assignment
Name String - Name of the assignment.
- assignment
Status String Status of the assignment. Valid values are
ENABLED
,DISABLED
, andDRAFT
.The following arguments are optional:
- aws
Account StringId - AWS account ID.
- identities
Iam
Policy Assignment Identities - Amazon QuickSight users, groups, or both to assign the policy to. See
identities
block. - namespace String
- Namespace that contains the assignment. Defaults to
default
. - policy
Arn String - ARN of the IAM policy to apply to the Amazon QuickSight users and groups specified in this assignment.
- assignment
Id string - Assignment ID.
- assignment
Name string - Name of the assignment.
- assignment
Status string Status of the assignment. Valid values are
ENABLED
,DISABLED
, andDRAFT
.The following arguments are optional:
- aws
Account stringId - AWS account ID.
- identities
Iam
Policy Assignment Identities - Amazon QuickSight users, groups, or both to assign the policy to. See
identities
block. - namespace string
- Namespace that contains the assignment. Defaults to
default
. - policy
Arn 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
, andDRAFT
.The following arguments are optional:
- aws_
account_ strid - AWS account ID.
- identities
Iam
Policy Assignment Identities Args - 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.
- assignment
Id String - Assignment ID.
- assignment
Name String - Name of the assignment.
- assignment
Status String Status of the assignment. Valid values are
ENABLED
,DISABLED
, andDRAFT
.The following arguments are optional:
- aws
Account StringId - 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
. - policy
Arn String - ARN of the IAM policy to apply to the Amazon QuickSight users and groups specified in this assignment.
Supporting Types
IamPolicyAssignmentIdentities, IamPolicyAssignmentIdentitiesArgs
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.