createAccessGrantsLocation method
The S3 data location that you would like to register in your S3 Access Grants instance. Your S3 data must be in the same Region as your S3 Access Grants instance. The location can be one of the following:
-
The default S3 location
s3:// -
A bucket -
S3:// -
A bucket and prefix -
S3://
- Permissions
-
You must have the
s3:CreateAccessGrantsLocationpermission to use this operation. - Additional Permissions
-
You must also have the following permission for the specified IAM role:
iam:PassRole
Parameter accountId :
The Amazon Web Services account ID of the S3 Access Grants instance.
Parameter iAMRoleArn :
The Amazon Resource Name (ARN) of the IAM role for the registered
location. S3 Access Grants assumes this role to manage access to the
registered location.
Parameter locationScope :
The S3 path to the location that you are registering. The location scope
can be the default S3 location s3://, the S3 path to a bucket
s3://, or the S3 path to a bucket and prefix
s3://. A prefix in S3 is a string of
characters at the beginning of an object key name used to organize the
objects that you store in your S3 buckets. For example, object key names
that start with the engineering/ prefix or object key names
that start with the marketing/campaigns/ prefix.
Parameter tags :
The Amazon Web Services resource tags that you are adding to the S3 Access
Grants location. Each tag is a label consisting of a user-defined key and
value. Tags can help you manage, identify, organize, search for, and
filter resources.
Implementation
Future<CreateAccessGrantsLocationResult> createAccessGrantsLocation({
required String accountId,
required String iAMRoleArn,
required String locationScope,
List<Tag>? tags,
}) async {
final headers = <String, String>{
'x-amz-account-id': accountId.toString(),
};
final $result = await _protocol.send(
method: 'POST',
requestUri: '/v20180820/accessgrantsinstance/location',
headers: headers,
payload: CreateAccessGrantsLocationRequest(
accountId: accountId,
iAMRoleArn: iAMRoleArn,
locationScope: locationScope,
tags: tags)
.toXml('CreateAccessGrantsLocationRequest'),
exceptionFnMap: _exceptionFns,
);
return CreateAccessGrantsLocationResult.fromXml($result.body);
}