Sometimes working on local PC can produce inconsistency for deployment. Moreover it is good practice to run some configuration scripts from centralized place.
Cloud9 from AWS is good IDE for sharing access, especially when integrated with VS Code Remote. This repository contains IaaC for provisioning such an environment.
Install on you local machine following tools:
- Terraform
- Ansible
- Some collections and libs:
pip3 install boto3
ansible-galaxy collection install community.aws
ansible-galaxy collection install ansible.posix
ansible-galaxy collection install kubernetes.core
- Install session-manager plugin: https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html
Please, consider using existing S3 bucket for SSM commands if you want to avoid bug with newly created buckets, described here: ansible-collections/community.aws#637
Set "existing_s3_bucket_name" in terraform.tfvars.json
Fill the required terraform.tfvars.json and secrets.auto.tfvars.json files. Note: possible bug in new community modules version: ansible-collections/community.aws#1413
Then you can build docker image and run installation from Docker container:
docker build --build-arg TARGETARCH=$(arch) -t cloud-env-dev .
docker run -it -v "$(pwd)":/terraform cloud-env-dev init
docker run -it -v "$(pwd)":/terraform cloud-env-dev apply