authorizeSnapshotAccess method

Future<AuthorizeSnapshotAccessResult> authorizeSnapshotAccess({
  1. required String accountWithRestoreAccess,
  2. String? snapshotArn,
  3. String? snapshotClusterIdentifier,
  4. String? snapshotIdentifier,
})

Authorizes the specified Amazon Web Services account to restore the specified snapshot.

For more information about working with snapshots, go to Amazon Redshift Snapshots in the Amazon Redshift Cluster Management Guide.

May throw AuthorizationAlreadyExistsFault. May throw AuthorizationQuotaExceededFault. May throw ClusterSnapshotNotFoundFault. May throw DependentServiceRequestThrottlingFault. May throw InvalidClusterSnapshotStateFault. May throw LimitExceededFault. May throw UnsupportedOperationFault.

Parameter accountWithRestoreAccess : The identifier of the Amazon Web Services account authorized to restore the specified snapshot.

To share a snapshot with Amazon Web Services Support, specify amazon-redshift-support.

Parameter snapshotArn : The Amazon Resource Name (ARN) of the snapshot to authorize access to.

Parameter snapshotClusterIdentifier : The identifier of the cluster the snapshot was created from.

  • If the snapshot to access doesn't exist and the associated IAM policy doesn't allow access to all (*) snapshots - This parameter is required. Otherwise, permissions aren't available to check if the snapshot exists.
  • If the snapshot to access exists - This parameter isn't required. Redshift can retrieve the cluster identifier and use it to validate snapshot authorization.

Parameter snapshotIdentifier : The identifier of the snapshot the account is authorized to restore.

Implementation

Future<AuthorizeSnapshotAccessResult> authorizeSnapshotAccess({
  required String accountWithRestoreAccess,
  String? snapshotArn,
  String? snapshotClusterIdentifier,
  String? snapshotIdentifier,
}) async {
  final $request = <String, String>{
    'AccountWithRestoreAccess': accountWithRestoreAccess,
    if (snapshotArn != null) 'SnapshotArn': snapshotArn,
    if (snapshotClusterIdentifier != null)
      'SnapshotClusterIdentifier': snapshotClusterIdentifier,
    if (snapshotIdentifier != null) 'SnapshotIdentifier': snapshotIdentifier,
  };
  final $result = await _protocol.send(
    $request,
    action: 'AuthorizeSnapshotAccess',
    version: '2012-12-01',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    resultWrapper: 'AuthorizeSnapshotAccessResult',
  );
  return AuthorizeSnapshotAccessResult.fromXml($result);
}