Class CfnAccessGrant
- All Implemented Interfaces:
IInspectable,IEnvironmentAware,IAccessGrantRef,ITaggableV2,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
AWS::S3::AccessGrant resource creates an access grant that gives a grantee access to your S3 data.
The grantee can be an IAM user or role or a directory user, or group. Before you can create a grant, you must have an S3 Access Grants instance in the same Region as the S3 data. You can create an S3 Access Grants instance using the AWS::S3::AccessGrantsInstance . You must also have registered at least one S3 data location in your S3 Access Grants instance using AWS::S3::AccessGrantsLocation .
- Permissions - You must have the
s3:CreateAccessGrantpermission to use this resource. - Additional Permissions - For any directory identity -
sso:DescribeInstanceandsso:DescribeApplication
For directory users - identitystore:DescribeUser
For directory groups - identitystore:DescribeGroup
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.s3.*;
CfnAccessGrant cfnAccessGrant = CfnAccessGrant.Builder.create(this, "MyCfnAccessGrant")
.accessGrantsLocationId("accessGrantsLocationId")
.grantee(GranteeProperty.builder()
.granteeIdentifier("granteeIdentifier")
.granteeType("granteeType")
.build())
.permission("permission")
// the properties below are optional
.accessGrantsLocationConfiguration(AccessGrantsLocationConfigurationProperty.builder()
.s3SubPrefix("s3SubPrefix")
.build())
.applicationArn("applicationArn")
.s3PrefixType("s3PrefixType")
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceThe configuration options of the S3 Access Grants location.static final classA fluent builder forCfnAccessGrant.static interfaceThe user, group, or role to which you are granting access.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.interfaces.s3.IAccessGrantRef
IAccessGrantRef.Jsii$Default, IAccessGrantRef.Jsii$ProxyNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.ITaggableV2
ITaggableV2.Jsii$Default, ITaggableV2.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnAccessGrant(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnAccessGrant(software.amazon.jsii.JsiiObjectRef objRef) CfnAccessGrant(software.constructs.Construct scope, String id, CfnAccessGrantProps props) Create a newAWS::S3::AccessGrant. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringarnForAccessGrant(IAccessGrantRef resource) A reference to a AccessGrant resource.The configuration options of the grant location.The ID of the registered location to which you are granting access.The Amazon Resource Name (ARN) of an AWS IAM Identity Center application associated with your Identity Center instance.The ARN of the access grant.The ID of the access grant.The S3 path of the data to which you are granting access.Tag Manager which manages the tags for this resource.The user, group, or role to which you are granting access.The type of access that you are granting to your S3 data, which can be set to one of the following values: -READ– Grant read-only access to the S3 data.The type ofS3SubPrefix.getTags()The AWS resource tags that you are adding to the access grant.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.static BooleanChecks whether the given object is a CfnAccessGrant.renderProperties(Map<String, Object> props) voidThe configuration options of the grant location.voidsetAccessGrantsLocationConfiguration(CfnAccessGrant.AccessGrantsLocationConfigurationProperty value) The configuration options of the grant location.voidsetAccessGrantsLocationId(String value) The ID of the registered location to which you are granting access.voidsetApplicationArn(String value) The Amazon Resource Name (ARN) of an AWS IAM Identity Center application associated with your Identity Center instance.voidsetGrantee(IResolvable value) The user, group, or role to which you are granting access.voidThe user, group, or role to which you are granting access.voidsetPermission(String value) The type of access that you are granting to your S3 data, which can be set to one of the following values: -READ– Grant read-only access to the S3 data.voidsetS3PrefixType(String value) The type ofS3SubPrefix.voidThe AWS resource tags that you are adding to the access grant.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getEnv, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.constructs.Construct
getNode, isConstructMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.interfaces.IEnvironmentAware
getEnvMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnAccessGrant
protected CfnAccessGrant(software.amazon.jsii.JsiiObjectRef objRef) -
CfnAccessGrant
protected CfnAccessGrant(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnAccessGrant
@Stability(Stable) public CfnAccessGrant(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnAccessGrantProps props) Create a newAWS::S3::AccessGrant.- Parameters:
scope- Scope in which this resource is defined. This parameter is required.id- Construct identifier for this resource (unique in its scope). This parameter is required.props- Resource properties. This parameter is required.
-
-
Method Details
-
arnForAccessGrant
@Stability(Stable) @NotNull public static String arnForAccessGrant(@NotNull IAccessGrantRef resource) - Parameters:
resource- This parameter is required.
-
isCfnAccessGrant
Checks whether the given object is a CfnAccessGrant.- Parameters:
x- This parameter is required.
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAccessGrantRef
A reference to a AccessGrant resource.- Specified by:
getAccessGrantRefin interfaceIAccessGrantRef
-
getAttrAccessGrantArn
The ARN of the access grant. -
getAttrAccessGrantId
The ID of the access grant.S3 Access Grants auto-generates this ID when you create the access grant.
-
getAttrGrantScope
The S3 path of the data to which you are granting access.It is the result of appending the
Subprefixto the location scope. -
getCdkTagManager
Tag Manager which manages the tags for this resource.- Specified by:
getCdkTagManagerin interfaceITaggableV2
-
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getAccessGrantsLocationId
The ID of the registered location to which you are granting access. -
setAccessGrantsLocationId
The ID of the registered location to which you are granting access. -
getGrantee
The user, group, or role to which you are granting access.Returns union: either
IResolvableorCfnAccessGrant.GranteeProperty -
setGrantee
The user, group, or role to which you are granting access. -
setGrantee
The user, group, or role to which you are granting access. -
getPermission
The type of access that you are granting to your S3 data, which can be set to one of the following values: -READ– Grant read-only access to the S3 data. -
setPermission
The type of access that you are granting to your S3 data, which can be set to one of the following values: -READ– Grant read-only access to the S3 data. -
getAccessGrantsLocationConfiguration
The configuration options of the grant location.Returns union: either
IResolvableorCfnAccessGrant.AccessGrantsLocationConfigurationProperty -
setAccessGrantsLocationConfiguration
The configuration options of the grant location. -
setAccessGrantsLocationConfiguration
@Stability(Stable) public void setAccessGrantsLocationConfiguration(@Nullable CfnAccessGrant.AccessGrantsLocationConfigurationProperty value) The configuration options of the grant location. -
getApplicationArn
The Amazon Resource Name (ARN) of an AWS IAM Identity Center application associated with your Identity Center instance. -
setApplicationArn
The Amazon Resource Name (ARN) of an AWS IAM Identity Center application associated with your Identity Center instance. -
getS3PrefixType
The type ofS3SubPrefix. -
setS3PrefixType
The type ofS3SubPrefix. -
getTags
The AWS resource tags that you are adding to the access grant. -
setTags
The AWS resource tags that you are adding to the access grant.
-