create_location_object_storage
async
¶
create_location_object_storage(
server_hostname: ServerHostname,
bucket_name: ObjectStorageBucketName,
*,
config_overrides: Optional[AsyncDataSyncClientConfig] = None,
server_port: Optional[ObjectStorageServerPort] = None,
server_protocol: Optional[ObjectStorageServerProtocol] = None,
subdirectory: Optional[S3Subdirectory] = None,
access_key: Optional[ObjectStorageAccessKey] = None,
secret_key: Optional[ObjectStorageSecretKey] = None,
federated_identity: Optional[ObjectStorageFederatedIdentityConfig] = None,
agent_arns: Optional[AgentArnList] = None,
tags: Optional[InputTagList] = None,
server_certificate: Optional[ObjectStorageCertificate] = None,
cmk_secret_config: Optional[CmkSecretConfig] = None,
custom_secret_config: Optional[CustomSecretConfig] = None,
) -> CreateLocationObjectStorageResponse
Creates a transfer location for an object storage system. DataSync can use this location as a source or destination for transferring data. You can make transfers with or without a DataSync agent.
Before you begin, make sure that you understand the prerequisites for DataSync to work with object storage systems.
Parameters:
-
server_hostname(ServerHostname) –Specifies the domain name or IP address (IPv4 or IPv6) of the object storage server that your DataSync agent connects to.
-
server_port(Optional[ObjectStorageServerPort], default:None) –Specifies the port that your object storage server accepts inbound network traffic on (for example, port 443).
-
server_protocol(Optional[ObjectStorageServerProtocol], default:None) –Specifies the protocol that your object storage server uses to communicate. If not specified, the default value is
HTTPS. -
subdirectory(Optional[S3Subdirectory], default:None) –Specifies the object prefix for your object storage server. If this is a source location, DataSync only copies objects with this prefix. If this is a destination location, DataSync writes all objects with this prefix.
-
bucket_name(ObjectStorageBucketName) –Specifies the name of the object storage bucket involved in the transfer.
-
access_key(Optional[ObjectStorageAccessKey], default:None) –Specifies the access key (for example, a user name) if credentials are required to authenticate with the object storage server.
-
secret_key(Optional[ObjectStorageSecretKey], default:None) –Specifies the secret key (for example, a password) if credentials are required to authenticate with the object storage server.
If you provide a secret using
SecretKey, but do not provide secret configuration details usingCmkSecretConfigorCustomSecretConfig, then DataSync stores the token using your Amazon Web Services account's Secrets Manager secret. -
federated_identity(Optional[ObjectStorageFederatedIdentityConfig], default:None) –Specifies the federated identity configuration that allows DataSync to access your object storage using an OpenID Connect (OIDC) token instead of a long-term access key and secret key. Provide either
FederatedIdentityor theAccessKey/SecretKeycredentials, but not both. -
agent_arns(Optional[AgentArnList], default:None) –(Optional) Specifies the Amazon Resource Names (ARNs) of the DataSync agents that can connect with your object storage system. If you are setting up an agentless cross-cloud transfer, you do not need to specify a value for this parameter.
Make sure you configure this parameter correctly when you first create your storage location. You cannot add or remove agents from a storage location after you create it.
-
tags(Optional[InputTagList], default:None) –Specifies the key-value pair that represents a tag that you want to add to the resource. Tags can help you manage, filter, and search for your resources. We recommend creating a name tag for your location.
-
server_certificate(Optional[ObjectStorageCertificate], default:None) –Specifies a certificate chain for DataSync to authenticate with your object storage system if the system uses a private or self-signed certificate authority (CA). You must specify a single
.pemfile with a full certificate chain (for example,file:///home/user/.ssh/object_storage_certificates.pem).The certificate chain might include:
-
The object storage system's certificate
-
All intermediate certificates (if there are any)
-
The root certificate of the signing CA
You can concatenate your certificates into a
.pemfile (which can be up to 32768 bytes before base64 encoding). The following examplecatcommand creates anobject_storage_certificates.pemfile that includes three certificates:cat object_server_certificate.pem intermediate_certificate.pem ca_root_certificate.pem > object_storage_certificates.pemTo use this parameter, configure
ServerProtocoltoHTTPS. -
-
cmk_secret_config(Optional[CmkSecretConfig], default:None) –Specifies configuration information for a DataSync-managed secret, which includes the
SecretKeythat DataSync uses to access a specific object storage location, with a customer-managed KMS key.When you include this parameter as part of a
CreateLocationObjectStoragerequest, you provide only the KMS key ARN. DataSync uses this KMS key together with the value you specify for theSecretKeyparameter to create a DataSync-managed secret to store the location access credentials.Make sure that DataSync has permission to access the KMS key that you specify. For more information, see Using a service-managed secret encrypted with a custom KMS key.
You can use either
CmkSecretConfig(withSecretKey) orCustomSecretConfig(withoutSecretKey) to provide credentials for aCreateLocationObjectStoragerequest. Do not provide both parameters for the same request. -
custom_secret_config(Optional[CustomSecretConfig], default:None) –Specifies configuration information for a customer-managed Secrets Manager secret where the secret key for a specific object storage location is stored in plain text, in Secrets Manager. This configuration includes the secret ARN, and the ARN for an IAM role that provides access to the secret. For more information, see Using a secret that you manage.
You can use either
CmkSecretConfig(withSecretKey) orCustomSecretConfig(withoutSecretKey) to provide credentials for aCreateLocationObjectStoragerequest. Do not provide both parameters for the same request.
Raises:
-
InternalException–This exception is thrown when an error occurs in the DataSync service.
-
InvalidRequestException–This exception is thrown when the client submits a malformed request.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_datasync/_services/async_data_sync.py
1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 | |