@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)", date="2023-05-10T17:05:56.454Z") @Stability(value=Stable) public class CfnLayerVersionPermission extends CfnResource implements IInspectable
The AWS::Lambda::LayerVersionPermission resource adds permissions to the resource-based policy of a version of an Lambda layer . Use this action to grant layer usage permission to other accounts. You can grant permission to a single account, all AWS accounts, or all accounts in an organization.
Since the release of the UpdateReplacePolicy both
UpdateReplacePolicyandDeletionPolicyare required to protect your Resources/LayerPermissions from deletion.
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.lambda.*;
CfnLayerVersionPermission cfnLayerVersionPermission = CfnLayerVersionPermission.Builder.create(this, "MyCfnLayerVersionPermission")
.action("action")
.layerVersionArn("layerVersionArn")
.principal("principal")
// the properties below are optional
.organizationId("organizationId")
.build();
| Modifier and Type | Class and Description |
|---|---|
static class |
CfnLayerVersionPermission.Builder
A fluent builder for
CfnLayerVersionPermission. |
software.amazon.jsii.JsiiObject.InitializationModeIInspectable.Jsii$Default, IInspectable.Jsii$ProxyIConstruct.Jsii$Default| Modifier and Type | Field and Description |
|---|---|
static String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
| Modifier | Constructor and Description |
|---|---|
|
CfnLayerVersionPermission(Construct scope,
String id,
CfnLayerVersionPermissionProps props)
Create a new `AWS::Lambda::LayerVersionPermission`.
|
protected |
CfnLayerVersionPermission(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnLayerVersionPermission(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
String |
getAction()
The API action that grants access to the layer.
|
protected Map<String,Object> |
getCfnProperties() |
String |
getLayerVersionArn()
The name or Amazon Resource Name (ARN) of the layer.
|
String |
getOrganizationId()
With the principal set to `*` , grant permission to all accounts in the specified organization.
|
String |
getPrincipal()
An account ID, or `*` to grant layer usage permission to all accounts in an organization, or all AWS accounts (if `organizationId` is not specified).
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected Map<String,Object> |
renderProperties(Map<String,Object> props) |
void |
setAction(String value)
The API action that grants access to the layer.
|
void |
setLayerVersionArn(String value)
The name or Amazon Resource Name (ARN) of the layer.
|
void |
setOrganizationId(String value)
With the principal set to `*` , grant permission to all accounts in the specified organization.
|
void |
setPrincipal(String value)
An account ID, or `*` to grant layer usage permission to all accounts in an organization, or all AWS accounts (if `organizationId` is not specified).
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validatePropertiesgetRefgetCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdgetNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validatejsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet@Stability(value=Stable) public static final String CFN_RESOURCE_TYPE_NAME
protected CfnLayerVersionPermission(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnLayerVersionPermission(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public CfnLayerVersionPermission(@NotNull
Construct scope,
@NotNull
String id,
@NotNull
CfnLayerVersionPermissionProps props)
scope - - scope in which this resource is defined. This parameter is required.id - - scoped id of the resource. This parameter is required.props - - resource properties. This parameter is required.@Stability(value=Stable)
public void inspect(@NotNull
TreeInspector inspector)
inspect in interface IInspectableinspector - - tree inspector to collect and process attributes. This parameter is required.@Stability(value=Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
renderProperties in class CfnResourceprops - This parameter is required.@Stability(value=Stable) @NotNull protected Map<String,Object> getCfnProperties()
getCfnProperties in class CfnResource@Stability(value=Stable) @NotNull public String getAction()
For example, lambda:GetLayerVersion .
@Stability(value=Stable)
public void setAction(@NotNull
String value)
For example, lambda:GetLayerVersion .
@Stability(value=Stable) @NotNull public String getLayerVersionArn()
@Stability(value=Stable)
public void setLayerVersionArn(@NotNull
String value)
@Stability(value=Stable) @NotNull public String getPrincipal()
For the last case, make sure that you really do want all AWS accounts to have usage permission to this layer.
@Stability(value=Stable)
public void setPrincipal(@NotNull
String value)
For the last case, make sure that you really do want all AWS accounts to have usage permission to this layer.
@Stability(value=Stable) @Nullable public String getOrganizationId()
@Stability(value=Stable)
public void setOrganizationId(@Nullable
String value)
Copyright © 2023. All rights reserved.