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,
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. -
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
1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 | |