title: AWS deployment environment determination in continuous delivery with spring cloud
body: <p>I have been investigating a combination of Spinnaker, Spring Boot/Cloud and Amazon Web services for implementing a continuous delivery of microservices for my new employer.<br>
  My biggest issue is separation of the different environments in AWS and determination of that environment by the Spring Boot/Cloud microservice when it is going through the pipeline from code checkin to production.
  What are the best practices for separating the different environments in AWS? I have seen separate sub-accounts, use of VPC to separate the environments.<br>
  Then the next step involves determination of the environment by the microservice when it starts up. We are planning on using Spring Cloud Config Server to provide runtime configuration to the microservices. The determination of environment when contacting the config server needs to be made to set the 'label' when asking the config server for configuration.</p>
  
  <p>Assumptions I am making:<br>
  1. Spinnaker, or some other pipeline capable tool is being used to push the artifact into the various environments.<br>
   2. The original artifact is a self contained jar, that ideally would be incorporated into an AWS AMI, and then pushed without modification into the subsequent deployment environments.<br>
   3. The AMI can be built with whatever scripting is necessary to determine the runtime environment, and provide that info to the jar when it is started.<br>
   4. The instance is being started by an auto-scaler, and will be starting the instance(AMI), without providing external info when being started.</p>
  
  <p>I think that is enough for now. This could probably be split into multiple questions, but I wanted to maintain a cohesive whole for the process.</p>
  
  <p>Thanks for the assistance.</p>