Class CfnResourcePolicy
Attaches a resource-based permission policy to a secret.
Inherited Members
Namespace: Amazon.CDK.AWS.SecretsManager
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnResourcePolicy : CfnResource, IInspectable, IResourcePolicyRef, IConstruct, IDependable, IEnvironmentAware
Syntax (vb)
Public Class CfnResourcePolicy Inherits CfnResource Implements IInspectable, IResourcePolicyRef, IConstruct, IDependable, IEnvironmentAware
Remarks
A resource-based policy is optional. If a secret already has a resource policy attached, you must first remove it before attaching a new policy using this CloudFormation resource. You can remove the policy using the console , CLI , or API . For more information, see Authentication and access control for Secrets Manager .
Required permissions: secretsmanager:PutResourcePolicy , secretsmanager:GetResourcePolicy . For more information, see IAM policy actions for Secrets Manager and Authentication and access control in Secrets Manager .
CloudformationResource: AWS::SecretsManager::ResourcePolicy
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.SecretsManager;
var resourcePolicy;
var cfnResourcePolicy = new CfnResourcePolicy(this, "MyCfnResourcePolicy", new CfnResourcePolicyProps {
ResourcePolicy = resourcePolicy,
SecretId = "secretId",
// the properties below are optional
BlockPublicPolicy = false
});
Synopsis
Constructors
| CfnResourcePolicy(Construct, string, ICfnResourcePolicyProps) | Create a new |
Properties
| AttrId | The Arn of the secret. |
| BlockPublicPolicy | Specifies whether to block resource-based policies that allow broad access to the secret. |
| CFN_RESOURCE_TYPE_NAME | The CloudFormation resource type name for this resource class. |
| CfnProperties | Attaches a resource-based permission policy to a secret. |
| ResourcePolicy | A JSON-formatted string for an AWS resource-based policy. |
| ResourcePolicyRef | A reference to a ResourcePolicy resource. |
| SecretId | The ARN or name of the secret to attach the resource-based policy. |
Methods
| Inspect(TreeInspector) | Examines the CloudFormation resource and discloses attributes. |
| IsCfnResourcePolicy(object) | Checks whether the given object is a CfnResourcePolicy. |
| RenderProperties(IDictionary<string, object>) | Attaches a resource-based permission policy to a secret. |
Constructors
CfnResourcePolicy(Construct, string, ICfnResourcePolicyProps)
Create a new AWS::SecretsManager::ResourcePolicy.
public CfnResourcePolicy(Construct scope, string id, ICfnResourcePolicyProps props)
Parameters
- scope Construct
Scope in which this resource is defined.
- id string
Construct identifier for this resource (unique in its scope).
- props ICfnResourcePolicyProps
Resource properties.
Remarks
A resource-based policy is optional. If a secret already has a resource policy attached, you must first remove it before attaching a new policy using this CloudFormation resource. You can remove the policy using the console , CLI , or API . For more information, see Authentication and access control for Secrets Manager .
Required permissions: secretsmanager:PutResourcePolicy , secretsmanager:GetResourcePolicy . For more information, see IAM policy actions for Secrets Manager and Authentication and access control in Secrets Manager .
CloudformationResource: AWS::SecretsManager::ResourcePolicy
ExampleMetadata: fixture=_generated
Properties
AttrId
The Arn of the secret.
public virtual string AttrId { get; }
Property Value
Remarks
CloudformationAttribute: Id
BlockPublicPolicy
Specifies whether to block resource-based policies that allow broad access to the secret.
public virtual object? BlockPublicPolicy { get; set; }
Property Value
Remarks
Type union: either bool or IResolvable
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
public static string CFN_RESOURCE_TYPE_NAME { get; }
Property Value
Remarks
A resource-based policy is optional. If a secret already has a resource policy attached, you must first remove it before attaching a new policy using this CloudFormation resource. You can remove the policy using the console , CLI , or API . For more information, see Authentication and access control for Secrets Manager .
Required permissions: secretsmanager:PutResourcePolicy , secretsmanager:GetResourcePolicy . For more information, see IAM policy actions for Secrets Manager and Authentication and access control in Secrets Manager .
CloudformationResource: AWS::SecretsManager::ResourcePolicy
ExampleMetadata: fixture=_generated
CfnProperties
Attaches a resource-based permission policy to a secret.
protected override IDictionary<string, object> CfnProperties { get; }
Property Value
Overrides
Remarks
A resource-based policy is optional. If a secret already has a resource policy attached, you must first remove it before attaching a new policy using this CloudFormation resource. You can remove the policy using the console , CLI , or API . For more information, see Authentication and access control for Secrets Manager .
Required permissions: secretsmanager:PutResourcePolicy , secretsmanager:GetResourcePolicy . For more information, see IAM policy actions for Secrets Manager and Authentication and access control in Secrets Manager .
CloudformationResource: AWS::SecretsManager::ResourcePolicy
ExampleMetadata: fixture=_generated
ResourcePolicy
A JSON-formatted string for an AWS resource-based policy.
public virtual object ResourcePolicy { get; set; }
Property Value
Remarks
A resource-based policy is optional. If a secret already has a resource policy attached, you must first remove it before attaching a new policy using this CloudFormation resource. You can remove the policy using the console , CLI , or API . For more information, see Authentication and access control for Secrets Manager .
Required permissions: secretsmanager:PutResourcePolicy , secretsmanager:GetResourcePolicy . For more information, see IAM policy actions for Secrets Manager and Authentication and access control in Secrets Manager .
CloudformationResource: AWS::SecretsManager::ResourcePolicy
ExampleMetadata: fixture=_generated
ResourcePolicyRef
A reference to a ResourcePolicy resource.
public virtual IResourcePolicyReference ResourcePolicyRef { get; }
Property Value
Remarks
A resource-based policy is optional. If a secret already has a resource policy attached, you must first remove it before attaching a new policy using this CloudFormation resource. You can remove the policy using the console , CLI , or API . For more information, see Authentication and access control for Secrets Manager .
Required permissions: secretsmanager:PutResourcePolicy , secretsmanager:GetResourcePolicy . For more information, see IAM policy actions for Secrets Manager and Authentication and access control in Secrets Manager .
CloudformationResource: AWS::SecretsManager::ResourcePolicy
ExampleMetadata: fixture=_generated
SecretId
The ARN or name of the secret to attach the resource-based policy.
public virtual string SecretId { get; set; }
Property Value
Remarks
A resource-based policy is optional. If a secret already has a resource policy attached, you must first remove it before attaching a new policy using this CloudFormation resource. You can remove the policy using the console , CLI , or API . For more information, see Authentication and access control for Secrets Manager .
Required permissions: secretsmanager:PutResourcePolicy , secretsmanager:GetResourcePolicy . For more information, see IAM policy actions for Secrets Manager and Authentication and access control in Secrets Manager .
CloudformationResource: AWS::SecretsManager::ResourcePolicy
ExampleMetadata: fixture=_generated
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.
Remarks
A resource-based policy is optional. If a secret already has a resource policy attached, you must first remove it before attaching a new policy using this CloudFormation resource. You can remove the policy using the console , CLI , or API . For more information, see Authentication and access control for Secrets Manager .
Required permissions: secretsmanager:PutResourcePolicy , secretsmanager:GetResourcePolicy . For more information, see IAM policy actions for Secrets Manager and Authentication and access control in Secrets Manager .
CloudformationResource: AWS::SecretsManager::ResourcePolicy
ExampleMetadata: fixture=_generated
IsCfnResourcePolicy(object)
Checks whether the given object is a CfnResourcePolicy.
public static bool IsCfnResourcePolicy(object x)
Parameters
- x object
Returns
Remarks
A resource-based policy is optional. If a secret already has a resource policy attached, you must first remove it before attaching a new policy using this CloudFormation resource. You can remove the policy using the console , CLI , or API . For more information, see Authentication and access control for Secrets Manager .
Required permissions: secretsmanager:PutResourcePolicy , secretsmanager:GetResourcePolicy . For more information, see IAM policy actions for Secrets Manager and Authentication and access control in Secrets Manager .
CloudformationResource: AWS::SecretsManager::ResourcePolicy
ExampleMetadata: fixture=_generated
RenderProperties(IDictionary<string, object>)
Attaches a resource-based permission policy to a secret.
protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
Parameters
- props IDictionary<string, object>
Returns
Overrides
Remarks
A resource-based policy is optional. If a secret already has a resource policy attached, you must first remove it before attaching a new policy using this CloudFormation resource. You can remove the policy using the console , CLI , or API . For more information, see Authentication and access control for Secrets Manager .
Required permissions: secretsmanager:PutResourcePolicy , secretsmanager:GetResourcePolicy . For more information, see IAM policy actions for Secrets Manager and Authentication and access control in Secrets Manager .
CloudformationResource: AWS::SecretsManager::ResourcePolicy
ExampleMetadata: fixture=_generated