![]() ![]() It's a Good Idea to Sync Terraform Modules terraform get -updateīuilding the complete infrastructure may take more than 10 minutes. echo 'db_password = "Your_DB_Passwd."' > terraform.tfvars Select Dev Workspace terraform workspace select devīefore we can start will need to update variables and add the database password to terraform.tfvars. List Available Workspace terraform workspace list Initial Setup Create and Create New Workspace for Terraform Initialize and Pull Terraform Cloud-Specific Dependencies terraform initĬreate Dev Workspace terraform workspace new dev It's very important to keep tags - as if tags are not specified, nodes will not be able to join the cluster. Autoscaling Group will create nodes to be added to the cluster.Security Groups "Firewall" to allow master and nodes to communicate.# Specify the provider and access detailsĮks_cluster_name = "$" The only difference, in this case, is the number of worker nodes for Kubernetes. Terraform will run 2 separate environments, dev and prod, using the same sources. We will use Terraform modules to keep our code clean and organized. Now we can move into creating new infrastructure, using EKS and RDS with Terraform. ![]() Terra-state-bucket -versioning-configuration Status=EnabledĬreating Kubernetes cluster on AWS EKS and RDS on PostgreSQL Note: Change the name of the bucket, as the name should be unique across all AWS S3 buckets: aws s3 mb s3://terra-state-bucket -region us-west-2Įnable Versioning on The Newly Created Bucket aws s3api put-bucket-versioning -bucket \ Once we have a Terraform IAM account created we can proceed to the next step, creating a dedicated bucket to keep Terraform state files. Update terraform.tfvars file with Access and Security Keys for Newly Created Terraform IAM AccountĬreating Backend Storage For tfstate File in AWS S3 ![]() aws iam create-access-key -user-name terraform Note: This Access Key and Secret Access Key will be used by terraform to manage infrastructure deployment. Terraform -policy-arn arn:aws:iam::aws:policy/AdministratorAccess Note: For production or event proper testing account you may need tighten up and restrict access for the Terraform IAM user. Create IAM terraform User aws iam create-user -user-name terraformĪdd to Newly-Created Terraform User IAM Admin Policy The first step is to set up a Terraform admin account in AWS IAM. In the example below we will be using US West (Oregon) "us-west-2" aws configure Creating a Terraform IAM Account with Access Keys and Access Policy aws-iam-authenticator $HOME/.local/bin/aws-iam-authenticator
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |