Class CfnManagedPolicy
Creates a new managed policy for your AWS account .
Implements
Inherited Members
Namespace: Amazon.CDK.AWS.IAM
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnManagedPolicy : CfnResource, IInspectable
Syntax (vb)
Public Class CfnManagedPolicy
Inherits CfnResource
Implements IInspectable
Remarks
This operation creates a policy version with a version identifier of v1
and sets v1 as the policy's default version. For more information about policy versions, see Versioning for managed policies in the IAM User Guide .
As a best practice, you can validate your IAM policies. To learn more, see Validating IAM policies in the IAM User Guide .
For more information about managed policies in general, see Managed policies and inline policies in the IAM User Guide .
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-managedpolicy.html
CloudformationResource: AWS::IAM::ManagedPolicy
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.IAM;
var policyDocument;
var cfnManagedPolicy = new CfnManagedPolicy(this, "MyCfnManagedPolicy", new CfnManagedPolicyProps {
PolicyDocument = policyDocument,
// the properties below are optional
Description = "description",
Groups = new [] { "groups" },
ManagedPolicyName = "managedPolicyName",
Path = "path",
Roles = new [] { "roles" },
Users = new [] { "users" }
});
Synopsis
Constructors
CfnManagedPolicy(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
CfnManagedPolicy(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
CfnManagedPolicy(Construct, String, ICfnManagedPolicyProps) |
Properties
AttrAttachmentCount | The number of principal entities (users, groups, and roles) that the policy is attached to. |
AttrCreateDate | The date and time, in ISO 8601 date-time format , when the policy was created. |
AttrDefaultVersionId | The identifier for the version of the policy that is set as the default (operative) version. |
AttrIsAttachable | Specifies whether the policy can be attached to an IAM user, group, or role. |
AttrPermissionsBoundaryUsageCount | The number of entities (users and roles) for which the policy is used as the permissions boundary. |
AttrPolicyArn | |
AttrPolicyId | The stable and unique string identifying the policy. |
AttrUpdateDate | The date and time, in ISO 8601 date-time format , when the policy was last updated. |
CFN_RESOURCE_TYPE_NAME | The CloudFormation resource type name for this resource class. |
CfnProperties | |
Description | A friendly description of the policy. |
Groups | The name (friendly name, not ARN) of the group to attach the policy to. |
ManagedPolicyName | The friendly name of the policy. |
Path | The path for the policy. |
PolicyDocument | The JSON policy document that you want to use as the content for the new policy. |
Roles | The name (friendly name, not ARN) of the role to attach the policy to. |
Users | The name (friendly name, not ARN) of the IAM user to attach the policy to. |
Methods
Inspect(TreeInspector) | Examines the CloudFormation resource and discloses attributes. |
RenderProperties(IDictionary<String, Object>) |
Constructors
CfnManagedPolicy(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CfnManagedPolicy(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
CfnManagedPolicy(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CfnManagedPolicy(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
CfnManagedPolicy(Construct, String, ICfnManagedPolicyProps)
public CfnManagedPolicy(Construct scope, string id, ICfnManagedPolicyProps 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 ICfnManagedPolicyProps
Resource properties.
Properties
AttrAttachmentCount
The number of principal entities (users, groups, and roles) that the policy is attached to.
public virtual double AttrAttachmentCount { get; }
Property Value
System.Double
Remarks
CloudformationAttribute: AttachmentCount
AttrCreateDate
The date and time, in ISO 8601 date-time format , when the policy was created.
public virtual string AttrCreateDate { get; }
Property Value
System.String
Remarks
CloudformationAttribute: CreateDate
AttrDefaultVersionId
The identifier for the version of the policy that is set as the default (operative) version.
public virtual string AttrDefaultVersionId { get; }
Property Value
System.String
Remarks
For more information about policy versions, see Versioning for managed policies in the IAM User Guide .
CloudformationAttribute: DefaultVersionId
AttrIsAttachable
Specifies whether the policy can be attached to an IAM user, group, or role.
public virtual IResolvable AttrIsAttachable { get; }
Property Value
Remarks
CloudformationAttribute: IsAttachable
AttrPermissionsBoundaryUsageCount
The number of entities (users and roles) for which the policy is used as the permissions boundary.
public virtual double AttrPermissionsBoundaryUsageCount { get; }
Property Value
System.Double
Remarks
For more information about permissions boundaries, see Permissions boundaries for IAM identities in the IAM User Guide .
CloudformationAttribute: PermissionsBoundaryUsageCount
AttrPolicyArn
public virtual string AttrPolicyArn { get; }
Property Value
System.String
Remarks
CloudformationAttribute: PolicyArn
AttrPolicyId
The stable and unique string identifying the policy.
public virtual string AttrPolicyId { get; }
Property Value
System.String
Remarks
For more information about IDs, see IAM identifiers in the IAM User Guide .
CloudformationAttribute: PolicyId
AttrUpdateDate
The date and time, in ISO 8601 date-time format , when the policy was last updated.
public virtual string AttrUpdateDate { get; }
Property Value
System.String
Remarks
When a policy has only one version, this field contains the date and time when the policy was created. When a policy has more than one version, this field contains the date and time when the most recent policy version was created.
CloudformationAttribute: UpdateDate
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
Description
A friendly description of the policy.
public virtual string Description { get; set; }
Property Value
System.String
Groups
The name (friendly name, not ARN) of the group to attach the policy to.
public virtual string[] Groups { get; set; }
Property Value
System.String[]
ManagedPolicyName
The friendly name of the policy.
public virtual string ManagedPolicyName { get; set; }
Property Value
System.String
Path
The path for the policy.
public virtual string Path { get; set; }
Property Value
System.String
PolicyDocument
The JSON policy document that you want to use as the content for the new policy.
public virtual object PolicyDocument { get; set; }
Property Value
System.Object
Roles
The name (friendly name, not ARN) of the role to attach the policy to.
public virtual string[] Roles { get; set; }
Property Value
System.String[]
Users
The name (friendly name, not ARN) of the IAM user to attach the policy to.
public virtual string[] Users { 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>