get_data_access
async
¶
get_data_access(
account_id: AccountId,
target: S3Prefix,
permission: Permission,
*,
config_overrides: Optional[AsyncS3ControlClientConfig] = None,
duration_seconds: Optional[DurationSeconds] = None,
privilege: Optional[Privilege] = None,
target_type: Optional[S3PrefixType] = None,
audit_context: Optional[AuditContext] = None,
) -> GetDataAccessResult
Returns a temporary access credential from S3 Access Grants to the grantee or client application. The temporary credential is an Amazon Web Services STS token that grants them access to the S3 data.
- Permissions
-
You must have the
s3:GetDataAccesspermission to use this operation. - Additional Permissions
-
The IAM role that S3 Access Grants assumes must have the following permissions specified in the trust policy when registering the location:
sts:AssumeRole, for directory users or groupssts:SetContext, and for IAM users or rolessts:SetSourceIdentity.
Parameters:
-
account_id(AccountId) –The Amazon Web Services account ID of the S3 Access Grants instance.
-
target(S3Prefix) –The S3 URI path of the data to which you are requesting temporary access credentials. If the requesting account has an access grant for this data, S3 Access Grants vends temporary access credentials in the response.
-
permission(Permission) –The type of permission granted to your S3 data, which can be set to one of the following values:
-
READ– Grant read-only access to the S3 data. -
WRITE– Grant write-only access to the S3 data. -
READWRITE– Grant both read and write access to the S3 data.
-
-
duration_seconds(Optional[DurationSeconds], default:None) –The session duration, in seconds, of the temporary access credential that S3 Access Grants vends to the grantee or client application. The default value is 1 hour, but the grantee can specify a range from 900 seconds (15 minutes) up to 43200 seconds (12 hours). If the grantee requests a value higher than this maximum, the operation fails.
-
privilege(Optional[Privilege], default:None) –The scope of the temporary access credential that S3 Access Grants vends to the grantee or client application.
-
Default– The scope of the returned temporary access token is the scope of the grant that is closest to the target scope. -
Minimal– The scope of the returned temporary access token is the same as the requested target scope as long as the requested scope is the same as or a subset of the grant scope.
-
-
target_type(Optional[S3PrefixType], default:None) –The type of
Target. The only possible value isObject. Pass this value if the target data that you would like to access is a path to an object. Do not pass this value if the target data is a bucket or a bucket and a prefix. -
audit_context(Optional[AuditContext], default:None) –The context to identify the job or query associated with the credential request. This information will be displayed in CloudTrail log in your account.
Raises:
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_s3_control/_services/async_s3_control.py
3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 | |