createAccessPoint method
Creates an access point and associates it to a specified bucket. For more information, see Managing access to shared datasets with access points or Managing access to shared datasets in directory buckets with access points in the Amazon S3 User Guide.
To create an access point and attach it to a volume on an Amazon FSx file system, see CreateAndAttachS3AccessPoint in the Amazon FSx API Reference.
Implementation
Future<CreateAccessPointResult> createAccessPoint({
required String accountId,
required String bucket,
required String name,
String? bucketAccountId,
PublicAccessBlockConfiguration? publicAccessBlockConfiguration,
Scope? scope,
List<Tag>? tags,
VpcConfiguration? vpcConfiguration,
}) async {
final headers = <String, String>{
'x-amz-account-id': accountId.toString(),
};
final $result = await _protocol.send(
method: 'PUT',
requestUri: '/v20180820/accesspoint',
headers: headers,
payload: CreateAccessPointRequest(
accountId: accountId,
bucket: bucket,
name: name,
bucketAccountId: bucketAccountId,
publicAccessBlockConfiguration: publicAccessBlockConfiguration,
scope: scope,
tags: tags,
vpcConfiguration: vpcConfiguration)
.toXml('CreateAccessPointRequest'),
endpoint: _resolveEndpoint(
requiresAccountId: true,
accountId: accountId,
bucket: bucket,
accessPointName: name,
),
hostPrefix: '{AccountId}.',
exceptionFnMap: _exceptionFns,
);
return CreateAccessPointResult.fromXml($result.body);
}