Class PolicyAttachment
Provides a resource to attach an AWS Organizations policy to an organization account, root, or unit.
Example Usage
Organization Account
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var account = new Aws.Organizations.PolicyAttachment("account", new Aws.Organizations.PolicyAttachmentArgs
{
PolicyId = aws_organizations_policy.Example.Id,
TargetId = "123456789012",
});
}
}
Organization Root
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var root = new Aws.Organizations.PolicyAttachment("root", new Aws.Organizations.PolicyAttachmentArgs
{
PolicyId = aws_organizations_policy.Example.Id,
TargetId = aws_organizations_organization.Example.Roots[0].Id,
});
}
}
Organization Unit
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var unit = new Aws.Organizations.PolicyAttachment("unit", new Aws.Organizations.PolicyAttachmentArgs
{
PolicyId = aws_organizations_policy.Example.Id,
TargetId = aws_organizations_organizational_unit.Example.Id,
});
}
}
Inherited Members
Namespace: Pulumi.Aws.Organizations
Assembly: Pulumi.Aws.dll
Syntax
public class PolicyAttachment : CustomResource
Constructors
View SourcePolicyAttachment(String, PolicyAttachmentArgs, CustomResourceOptions)
Create a PolicyAttachment resource with the given unique name, arguments, and options.
Declaration
public PolicyAttachment(string name, PolicyAttachmentArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| PolicyAttachmentArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourcePolicyId
The unique identifier (ID) of the policy that you want to attach to the target.
Declaration
public Output<string> PolicyId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
TargetId
The unique identifier (ID) of the root, organizational unit, or account number that you want to attach the policy to.
Declaration
public Output<string> TargetId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, PolicyAttachmentState, CustomResourceOptions)
Get an existing PolicyAttachment resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static PolicyAttachment Get(string name, Input<string> id, PolicyAttachmentState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| PolicyAttachmentState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| PolicyAttachment |