createAndAttachS3AccessPoint method

Future<CreateAndAttachS3AccessPointResponse> createAndAttachS3AccessPoint({
  1. required String name,
  2. required S3AccessPointAttachmentType type,
  3. String? clientRequestToken,
  4. CreateAndAttachS3AccessPointOntapConfiguration? ontapConfiguration,
  5. CreateAndAttachS3AccessPointOpenZFSConfiguration? openZFSConfiguration,
  6. CreateAndAttachS3AccessPointS3Configuration? s3AccessPoint,
})

Creates an S3 access point and attaches it to an Amazon FSx volume. For FSx for OpenZFS file systems, the volume must be hosted on a high-availability file system, either Single-AZ or Multi-AZ. For more information, see Accessing your data using Amazon S3 access points. in the Amazon FSx for OpenZFS User Guide.

The requester requires the following permissions to perform these actions:

  • fsx:CreateAndAttachS3AccessPoint
  • s3:CreateAccessPoint
  • s3:GetAccessPoint
  • s3:PutAccessPointPolicy
  • s3:DeleteAccessPoint
The following actions are related to CreateAndAttachS3AccessPoint:

May throw AccessPointAlreadyOwnedByYou. May throw BadRequest. May throw IncompatibleParameterError. May throw InternalServerError. May throw InvalidAccessPoint. May throw InvalidRequest. May throw TooManyAccessPoints. May throw UnsupportedOperation. May throw VolumeNotFound.

Parameter name : The name you want to assign to this S3 access point.

Parameter type : The type of S3 access point you want to create. Only OpenZFS is supported.

Parameter openZFSConfiguration : Specifies the configuration to use when creating and attaching an S3 access point to an FSx for OpenZFS volume.

Parameter s3AccessPoint : Specifies the virtual private cloud (VPC) configuration if you're creating an access point that is restricted to a VPC. For more information, see Creating access points restricted to a virtual private cloud.

Implementation

Future<CreateAndAttachS3AccessPointResponse> createAndAttachS3AccessPoint({
  required String name,
  required S3AccessPointAttachmentType type,
  String? clientRequestToken,
  CreateAndAttachS3AccessPointOntapConfiguration? ontapConfiguration,
  CreateAndAttachS3AccessPointOpenZFSConfiguration? openZFSConfiguration,
  CreateAndAttachS3AccessPointS3Configuration? s3AccessPoint,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target':
        'AWSSimbaAPIService_v20180301.CreateAndAttachS3AccessPoint'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Name': name,
      'Type': type.value,
      'ClientRequestToken':
          clientRequestToken ?? _s.generateIdempotencyToken(),
      if (ontapConfiguration != null)
        'OntapConfiguration': ontapConfiguration,
      if (openZFSConfiguration != null)
        'OpenZFSConfiguration': openZFSConfiguration,
      if (s3AccessPoint != null) 'S3AccessPoint': s3AccessPoint,
    },
  );

  return CreateAndAttachS3AccessPointResponse.fromJson(jsonResponse.body);
}