Class CfnPolicy
Creates a policy of a specified type that you can attach to a root, an organizational unit (OU), or an individual AWS account .
Inherited Members
Namespace: Amazon.CDK.AWS.Organizations
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnPolicy : CfnResource, IInspectable, ITaggable
Syntax (vb)
Public Class CfnPolicy
Inherits CfnResource
Implements IInspectable, ITaggable
Remarks
For more information about policies and their use, see Managing AWS Organizations policies .
If the request includes tags, then the requester must have the organizations:TagResource
permission.
This operation can be called only from the organization's management account.
Before you can create a policy of a given type, you must first enable that policy type in your organization.
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-organizations-policy.html
CloudformationResource: AWS::Organizations::Policy
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Organizations;
var content;
var cfnPolicy = new CfnPolicy(this, "MyCfnPolicy", new CfnPolicyProps {
Content = content,
Name = "name",
Type = "type",
// the properties below are optional
Description = "description",
Tags = new [] { new CfnTag {
Key = "key",
Value = "value"
} },
TargetIds = new [] { "targetIds" }
});
Synopsis
Constructors
CfnPolicy(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
CfnPolicy(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
CfnPolicy(Construct, String, ICfnPolicyProps) |
Properties
AttrArn | Returns the Amazon Resource Name (ARN) of the policy. |
AttrAwsManaged | Returns a boolean value that indicates whether the specified policy is an AWS managed policy. |
AttrId | Returns the unique identifier (ID) of the policy. |
CFN_RESOURCE_TYPE_NAME | The CloudFormation resource type name for this resource class. |
CfnProperties | |
Content | The policy text content. |
Description | Human readable description of the policy. |
Name | Name of the policy. |
Tags | Tag Manager which manages the tags for this resource. |
TagsRaw | A list of tags that you want to attach to the newly created policy. |
TargetIds | List of unique identifiers (IDs) of the root, OU, or account that you want to attach the policy to. |
Type | The type of policy to create. |
Methods
Inspect(TreeInspector) | Examines the CloudFormation resource and discloses attributes. |
RenderProperties(IDictionary<String, Object>) |
Constructors
CfnPolicy(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CfnPolicy(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
CfnPolicy(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CfnPolicy(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
CfnPolicy(Construct, String, ICfnPolicyProps)
public CfnPolicy(Construct scope, string id, ICfnPolicyProps props)
Parameters
- scope Constructs.Construct
Scope in which this resource is defined.
- id System.String
Construct identifier for this resource (unique in its scope).
- props ICfnPolicyProps
Resource properties.
Properties
AttrArn
Returns the Amazon Resource Name (ARN) of the policy.
public virtual string AttrArn { get; }
Property Value
System.String
Remarks
For example: arn:aws:organizations::111111111111:policy/o-exampleorgid/service_control_policy/p-examplepolicyid111
.
CloudformationAttribute: Arn
AttrAwsManaged
Returns a boolean value that indicates whether the specified policy is an AWS managed policy.
public virtual IResolvable AttrAwsManaged { get; }
Property Value
Remarks
If true, then you can attach the policy to roots, OUs, or accounts, but you cannot edit it. For example: true | false
.
CloudformationAttribute: AwsManaged
AttrId
Returns the unique identifier (ID) of the policy.
public virtual string AttrId { get; }
Property Value
System.String
Remarks
For example: p-examplepolicyid111
.
CloudformationAttribute: Id
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
public static string CFN_RESOURCE_TYPE_NAME { get; }
Property Value
System.String
CfnProperties
protected override IDictionary<string, object> CfnProperties { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.Object>
Overrides
Content
The policy text content.
public virtual object Content { get; set; }
Property Value
System.Object
Remarks
You can specify the policy content as a JSON object or a JSON string.
Description
Human readable description of the policy.
public virtual string Description { get; set; }
Property Value
System.String
Name
Name of the policy.
public virtual string Name { get; set; }
Property Value
System.String
Tags
Tag Manager which manages the tags for this resource.
public virtual TagManager Tags { get; }
Property Value
TagsRaw
A list of tags that you want to attach to the newly created policy.
public virtual ICfnTag[] TagsRaw { get; set; }
Property Value
ICfnTag[]
TargetIds
List of unique identifiers (IDs) of the root, OU, or account that you want to attach the policy to.
public virtual string[] TargetIds { get; set; }
Property Value
System.String[]
Type
The type of policy to create.
public virtual string Type { get; set; }
Property Value
System.String
Methods
Inspect(TreeInspector)
Examines the CloudFormation resource and discloses attributes.
public virtual void Inspect(TreeInspector inspector)
Parameters
- inspector TreeInspector
tree inspector to collect and process attributes.
RenderProperties(IDictionary<String, Object>)
protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
Parameters
- props System.Collections.Generic.IDictionary<System.String, System.Object>
Returns
System.Collections.Generic.IDictionary<System.String, System.Object>