Show / Hide Table of Contents

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,
    });
}

}
Inheritance
System.Object
Resource
CustomResource
PolicyAttachment
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Aws.Organizations
Assembly: Pulumi.Aws.dll
Syntax
public class PolicyAttachment : CustomResource

Constructors

View Source

PolicyAttachment(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 Source

PolicyId

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>
View Source

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 Source

Get(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
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.