I'm working with AWS Amplify to develop an iOS application. I've added storage through S3 to host some assets and am trying to configure the application to download them. The only issue is that every example I see has the bucket name and path hardcoded, but because I have multiple environments and make new environments sometimes and each bucket has the environment name appended to it, I don't want to have to rewrite the bucket name each time.
For example if I'm in my test environment the bucket name might be assetsxxxxxx-test but if I switch to a new environment, I might be referencing assetsyyyyy-dev let's say.
The thing is the bucket name is referenced in the aswconfiguration.json file:
"S3TransferUtility": {
"Default": {
"Bucket": "assetsxxxxx-test",
"Region": "us-east-2"
}
}
So my question is how can I reference that bucket name programmatically so that when that field is rewritten when I switch environments, I won't have to change my code.
Thanks