create_file_cache
async
¶
create_file_cache(
*,
config_overrides: Optional[AsyncFSxClientConfig] = None,
client_request_token: Optional[ClientRequestToken] = None,
file_cache_type: Optional[FileCacheType] = None,
file_cache_type_version: Optional[FileSystemTypeVersion] = None,
storage_capacity: Optional[StorageCapacity] = None,
subnet_ids: Optional[SubnetIds] = None,
security_group_ids: Optional[SecurityGroupIds] = None,
tags: Optional[Tags] = None,
copy_tags_to_data_repository_associations: Optional[
CopyTagsToDataRepositoryAssociations
] = None,
kms_key_id: Optional[KmsKeyId] = None,
lustre_configuration: Optional[CreateFileCacheLustreConfiguration] = None,
data_repository_associations: Optional[
CreateFileCacheDataRepositoryAssociations
] = None,
) -> CreateFileCacheResponse
Creates a new Amazon File Cache resource.
You can use this operation with a client request token in the request that Amazon File Cache uses to ensure idempotent creation. If a cache with the specified client request token exists and the parameters match, CreateFileCache returns the description of the existing cache. If a cache with the specified client request token exists and the parameters don't match, this call returns IncompatibleParameterError. If a file cache with the specified client request token doesn't exist, CreateFileCache does the following:
-
Creates a new, empty Amazon File Cache resource with an assigned ID, and an initial lifecycle state of
CREATING. -
Returns the description of the cache in JSON format.
The CreateFileCache call returns while the cache's lifecycle state is still CREATING. You can check the cache creation status by calling the DescribeFileCaches operation, which returns the cache state along with other information.
Parameters:
-
client_request_token(Optional[ClientRequestToken], default:None) –An idempotency token for resource creation, in a string of up to 63 ASCII characters. This token is automatically filled on your behalf when you use the Command Line Interface (CLI) or an Amazon Web Services SDK.
By using the idempotent operation, you can retry a
CreateFileCacheoperation without the risk of creating an extra cache. This approach can be useful when an initial call fails in a way that makes it unclear whether a cache was created. Examples are if a transport level timeout occurred, or your connection was reset. If you use the same client request token and the initial call created a cache, the client receives success as long as the parameters are the same. -
file_cache_type(Optional[FileCacheType], default:None) –The type of cache that you're creating, which must be
LUSTRE. -
file_cache_type_version(Optional[FileSystemTypeVersion], default:None) –Sets the Lustre version for the cache that you're creating, which must be
2.12. -
storage_capacity(Optional[StorageCapacity], default:None) –The storage capacity of the cache in gibibytes (GiB). Valid values are 1200 GiB, 2400 GiB, and increments of 2400 GiB.
-
security_group_ids(Optional[SecurityGroupIds], default:None) –A list of IDs specifying the security groups to apply to all network interfaces created for Amazon File Cache access. This list isn't returned in later requests to describe the cache.
-
copy_tags_to_data_repository_associations(Optional[CopyTagsToDataRepositoryAssociations], default:None) –A boolean flag indicating whether tags for the cache should be copied to data repository associations. This value defaults to false.
-
kms_key_id(Optional[KmsKeyId], default:None) –Specifies the ID of the Key Management Service (KMS) key to use for encrypting data on an Amazon File Cache. If a
KmsKeyIdisn't specified, the Amazon FSx-managed KMS key for your account is used. For more information, see Encrypt in the Key Management Service API Reference. -
lustre_configuration(Optional[CreateFileCacheLustreConfiguration], default:None) –The configuration for the Amazon File Cache resource being created.
-
data_repository_associations(Optional[CreateFileCacheDataRepositoryAssociations], default:None) –A list of up to 8 configurations for data repository associations (DRAs) to be created during the cache creation. The DRAs link the cache to either an Amazon S3 data repository or a Network File System (NFS) data repository that supports the NFSv3 protocol.
The DRA configurations must meet the following requirements:
-
All configurations on the list must be of the same data repository type, either all S3 or all NFS. A cache can't link to different data repository types at the same time.
-
An NFS DRA must link to an NFS file system that supports the NFSv3 protocol.
DRA automatic import and automatic export is not supported.
-
Raises:
-
BadRequest–A generic error indicating a failure with a client request.
-
IncompatibleParameterError–The error returned when a second request is received with the same client request token but different parameters settings. A client request token should always uniquely identify a single request.
-
InternalServerError–A generic error indicating a server-side failure.
-
InvalidNetworkSettings–One or more network settings specified in the request are invalid.
-
InvalidPerUnitStorageThroughput–An invalid value for
PerUnitStorageThroughputwas provided. Please create your file system again, using a valid value. -
MissingFileCacheConfiguration–A cache configuration is required for this operation.
-
ServiceLimitExceeded–An error indicating that a particular service limit was exceeded. You can increase some service limits by contacting Amazon Web Services Support.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_fsx/_services/async_f_sx.py
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 1241 1242 1243 1244 1245 1246 | |