CfnAccessGrantPropsMixin
- class aws_cdk.mixins_preview.aws_s3.mixins.CfnAccessGrantPropsMixin(props, *, strategy=None)
Bases:
MixinThe
AWS::S3::AccessGrantresource 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:DescribeUserFor directory groups -
identitystore:DescribeGroup- See:
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-accessgrant.html
- CloudformationResource:
AWS::S3::AccessGrant
- Mixin:
true
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview import mixins from aws_cdk.mixins_preview.aws_s3 import mixins as s3_mixins cfn_access_grant_props_mixin = s3_mixins.CfnAccessGrantPropsMixin(s3_mixins.CfnAccessGrantMixinProps( access_grants_location_configuration=s3_mixins.CfnAccessGrantPropsMixin.AccessGrantsLocationConfigurationProperty( s3_sub_prefix="s3SubPrefix" ), access_grants_location_id="accessGrantsLocationId", application_arn="applicationArn", grantee=s3_mixins.CfnAccessGrantPropsMixin.GranteeProperty( grantee_identifier="granteeIdentifier", grantee_type="granteeType" ), permission="permission", s3_prefix_type="s3PrefixType", tags=[CfnTag( key="key", value="value" )] ), strategy=mixins.PropertyMergeStrategy.OVERRIDE )
Create a mixin to apply properties to
AWS::S3::AccessGrant.- Parameters:
props (
Union[CfnAccessGrantMixinProps,Dict[str,Any]]) – L1 properties to apply.strategy (
Optional[PropertyMergeStrategy]) – (experimental) Strategy for merging nested properties. Default: - PropertyMergeStrategy.MERGE
Methods
- apply_to(construct)
Apply the mixin properties to the construct.
- Parameters:
construct (
IConstruct)- Return type:
- supports(construct)
Check if this mixin supports the given construct.
- Parameters:
construct (
IConstruct)- Return type:
bool
Attributes
- CFN_PROPERTY_KEYS = ['accessGrantsLocationConfiguration', 'accessGrantsLocationId', 'applicationArn', 'grantee', 'permission', 's3PrefixType', 'tags']
Static Methods
- classmethod is_mixin(x)
(experimental) Checks if
xis a Mixin.- Parameters:
x (
Any) – Any object.- Return type:
bool- Returns:
true if
xis an object created from a class which extendsMixin.- Stability:
experimental
AccessGrantsLocationConfigurationProperty
- class CfnAccessGrantPropsMixin.AccessGrantsLocationConfigurationProperty(*, s3_sub_prefix=None)
Bases:
objectThe configuration options of the S3 Access Grants location.
It contains the
S3SubPrefixfield. The grant scope, the data to which you are granting access, is the result of appending theSubprefixfield to the scope of the registered location.- Parameters:
s3_sub_prefix (
Optional[str]) – TheS3SubPrefixis appended to the location scope creating the grant scope. Use this field to narrow the scope of the grant to a subset of the location scope. This field is required if the location scope is the default locations3://because you cannot create a grant for all of your S3 data in the Region and must narrow the scope. For example, if the location scope is the default locations3://, theS3SubPrefxcan be a<bucket-name>/*, so the full grant scope path would bes3://<bucket-name>/*. Or theS3SubPrefxcan be<bucket-name>/<prefix-name>*, so the full grant scope path would bes3://<bucket-name>/<prefix-name>*. If theS3SubPrefixincludes a prefix, append the wildcard character*after the prefix to indicate that you want to include all object key names in the bucket that start with that prefix.- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_s3 import mixins as s3_mixins access_grants_location_configuration_property = s3_mixins.CfnAccessGrantPropsMixin.AccessGrantsLocationConfigurationProperty( s3_sub_prefix="s3SubPrefix" )
Attributes
- s3_sub_prefix
The
S3SubPrefixis appended to the location scope creating the grant scope.Use this field to narrow the scope of the grant to a subset of the location scope. This field is required if the location scope is the default location
s3://because you cannot create a grant for all of your S3 data in the Region and must narrow the scope. For example, if the location scope is the default locations3://, theS3SubPrefxcan be a<bucket-name>/*, so the full grant scope path would bes3://<bucket-name>/*. Or theS3SubPrefxcan be<bucket-name>/<prefix-name>*, so the full grant scope path would bes3://<bucket-name>/<prefix-name>*.If the
S3SubPrefixincludes a prefix, append the wildcard character*after the prefix to indicate that you want to include all object key names in the bucket that start with that prefix.
GranteeProperty
- class CfnAccessGrantPropsMixin.GranteeProperty(*, grantee_identifier=None, grantee_type=None)
Bases:
objectThe user, group, or role to which you are granting access.
You can grant access to an IAM user or role. If you have added your corporate directory to AWS IAM Identity Center and associated your Identity Center instance with your S3 Access Grants instance, the grantee can also be a corporate directory user or group.
- Parameters:
grantee_identifier (
Optional[str]) – The unique identifier of theGrantee. If the grantee type isIAM, the identifier is the IAM Amazon Resource Name (ARN) of the user or role. If the grantee type is a directory user or group, the identifier is 128-bit universally unique identifier (UUID) in the formata1b2c3d4-5678-90ab-cdef-EXAMPLE11111. You can obtain this UUID from your AWS IAM Identity Center instance.grantee_type (
Optional[str]) – The type of the grantee to which access has been granted. It can be one of the following values:. -IAM- An IAM user or role. -DIRECTORY_USER- Your corporate directory user. You can use this option if you have added your corporate identity directory to IAM Identity Center and associated the IAM Identity Center instance with your S3 Access Grants instance. -DIRECTORY_GROUP- Your corporate directory group. You can use this option if you have added your corporate identity directory to IAM Identity Center and associated the IAM Identity Center instance with your S3 Access Grants instance.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_s3 import mixins as s3_mixins grantee_property = s3_mixins.CfnAccessGrantPropsMixin.GranteeProperty( grantee_identifier="granteeIdentifier", grantee_type="granteeType" )
Attributes
- grantee_identifier
The unique identifier of the
Grantee.If the grantee type is
IAM, the identifier is the IAM Amazon Resource Name (ARN) of the user or role. If the grantee type is a directory user or group, the identifier is 128-bit universally unique identifier (UUID) in the formata1b2c3d4-5678-90ab-cdef-EXAMPLE11111. You can obtain this UUID from your AWS IAM Identity Center instance.
- grantee_type
.
IAM- An IAM user or role.DIRECTORY_USER- Your corporate directory user. You can use this option if you have added your corporate identity directory to IAM Identity Center and associated the IAM Identity Center instance with your S3 Access Grants instance.DIRECTORY_GROUP- Your corporate directory group. You can use this option if you have added your corporate identity directory to IAM Identity Center and associated the IAM Identity Center instance with your S3 Access Grants instance.
- See:
- Type:
The type of the grantee to which access has been granted. It can be one of the following values