Hi together,
imagine i have configured one environment with the aws amplify cli (production). In the production environment i have configured a hosting resource with S3/CDN and a auth resource. Now i want to create a dev environment that only contains a auth resource.
Do i have the ability to configure those environments independent from each other? If i create a new environment via amplify add env and after that publish the stack i get the summary based on the previous created production environment:
| Category | Resource name | Operation | Provider plugin |
| -------- | ----------------------- | --------- | ----------------- |
| Hosting | S3AndCloudFront | Create | awscloudformation |
| Auth | auth2d58178c | Create | awscloudformation |
What happens if i now delete the hosting resource. Will this affect my production environment as well?
I would like to split dev and production environments to use no hosting for the dev environment. This should be used more or less for developers to use services like cognito during their local development. But i want a production (and later a staging) environment with a configured hosting resource.
Is this possible? I also asked this on stackoverflow
* Which Category is your question related to? *
Environments
* What AWS Services are you utilizing? *
* Provide additional details e.g. code snippets *
@cremich Yes, this should be possible. Deleting hosting from your dev environment shouldn't affect your cloud resources in the prod environment. To manage these environments independently - like in your case, whenever you checkout an env - you should use amplify env checkout <env-name> --restore so that the changes of say dev environment do not get carried over to the environment you are checking out.
Hi @kaustavghosh06
thanks for your response. I will have a deeper look into it. What i observed so far:
I added the production environment to my master branch and published the stack (containing auth and cloudfront based hosting).
Then i create a dev branch from master and do a amplify delete hosting. This results in a complete deletion of the hosting stack. If i keep the dev branch isolated this is fine. But in the moment i merge the dev to master or vice versa this will cause some troubles, right?
Imagine i would merge the state of the dev branch into master this would result in losing the hosting stack in the master as well. And with that in my production environment.
Or am i missing something here :thinking:
@cremich Yes, you would have to unfortunately selectively and carefully merge the contents when merging from dev -> master or vice versa if you're selectively managing these environments with a disparity in the resource types.