terraform

Multiple availability zones with terraform on AWS

半腔热情 提交于 2020-02-18 05:07:17
问题 The VPC I'm working on has 3 logical tiers: Web, App and DB. For each tier there is one subnet in each availability zone. Total of 6 subnets in the region I'm using. I'm trying to create EC2 instances using a module and the count parameter but I don't know how to tell terraform to use the two subnets of the App tier. An additional constraint I have is to use static IP addresses (or a way to have a deterministic private name) I'm playing around with the resource resource "aws_instance" "app

Multiple availability zones with terraform on AWS

ⅰ亾dé卋堺 提交于 2020-02-18 05:06:59
问题 The VPC I'm working on has 3 logical tiers: Web, App and DB. For each tier there is one subnet in each availability zone. Total of 6 subnets in the region I'm using. I'm trying to create EC2 instances using a module and the count parameter but I don't know how to tell terraform to use the two subnets of the App tier. An additional constraint I have is to use static IP addresses (or a way to have a deterministic private name) I'm playing around with the resource resource "aws_instance" "app

Multiple availability zones with terraform on AWS

こ雲淡風輕ζ 提交于 2020-02-18 05:04:22
问题 The VPC I'm working on has 3 logical tiers: Web, App and DB. For each tier there is one subnet in each availability zone. Total of 6 subnets in the region I'm using. I'm trying to create EC2 instances using a module and the count parameter but I don't know how to tell terraform to use the two subnets of the App tier. An additional constraint I have is to use static IP addresses (or a way to have a deterministic private name) I'm playing around with the resource resource "aws_instance" "app

ARM Return App Service Environment ID to use in Terraform Script

妖精的绣舞 提交于 2020-02-05 04:38:19
问题 Terraform does not allow for the deployment of App Service Environments so I am using the azurerm_template_deployment as a work around. However, I want to reference the App Service Environment ID in an App Service Plan resource that I am creating later. How would I get and save the ID of the App Service Environment using this method? I am using the depends_on tag in the app service plan resource to ensure its creation after the app service environment, but I can not figure out how to get the

MalformedPolicyDocument error when creating policy via terraform

☆樱花仙子☆ 提交于 2020-01-30 04:16:53
问题 I am getting the following error when running terraform: * aws_iam_role_policy.rds_policy: Error putting IAM role policy my-rds-policy: MalformedPolicyDocument: The policy failed legacy parsing Here is my definition of the resource: resource "aws_iam_role_policy" "rds_policy" { name = "my-rds-policy" role = "${aws_iam_role.rds_role.id}" policy = <<EOF { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "s3:ListBucket", "s3:GetBucketLocation" ], "Resource": [ "arn:aws:s3

Add azure SQL user with terraform

烂漫一生 提交于 2020-01-30 03:52:16
问题 is there a possibility to add a sql user to the azure sql via terraform? https://www.mssqltips.com/sqlservertip/5242/adding-users-to-azure-sql-databases/ Or is there a better suggestions how to create a SQL user? Thanks 回答1: Yes you can do it from Terraform if that is what you want to happen. I would use a null resource provider in Terraform to execute the commands from the box that is running Terraform. You could use PowerShell, CMD, etc. to connect to the database after it is created and

Add azure SQL user with terraform

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-30 03:50:49
问题 is there a possibility to add a sql user to the azure sql via terraform? https://www.mssqltips.com/sqlservertip/5242/adding-users-to-azure-sql-databases/ Or is there a better suggestions how to create a SQL user? Thanks 回答1: Yes you can do it from Terraform if that is what you want to happen. I would use a null resource provider in Terraform to execute the commands from the box that is running Terraform. You could use PowerShell, CMD, etc. to connect to the database after it is created and

Launching AWS aurora MySQL RDS global cluster with TERRAFORM

为君一笑 提交于 2020-01-25 10:40:48
问题 Following the documentation here https://www.terraform.io/docs/providers/aws/r/rds_global_cluster.html launching a global RDS gobal cluster which involves having a primary cluster in one region and a secondary cluster in another region will require launching resources in 2 different regions but there is no explanation of how this will work in the documentation How am i suppose to run terraform apply on the definitions to launch the global cluster since this requires 2 regions? Has anyone

Terraform error EntityAlreadyExists: Role with name iam_for_lambda already exists

霸气de小男生 提交于 2020-01-25 09:25:06
问题 When running the command terraform apply the following error occurred because the role already exists. Error: Error creating IAM Role iam_for_lambda: EntityAlreadyExists: Role with name iam_for_lambda already exists. status code: 409, request id: 204c6c00-0b1d-4fb9-bf9c-fca48c67d669 on main.tf line 1, in resource "aws_iam_role" "iam_for_lambda": 1: resource "aws_iam_role" "iam_for_lambda" { can I use conditions/tricks to check without error if the role already exists? 来源: https:/

Importing a google_storage_bucket resource in Terraform state fails

扶醉桌前 提交于 2020-01-25 07:24:04
问题 I'm trying to import a google_storage_bucket storage bucket in my Terraform state: terraform import module.bf-nathan.google_storage_bucket.assets-bucket my-bucket However, it fails as follows: module.bf-nathan.google_storage_bucket.assets-bucket: Importing from ID "my-bucket"... module.bf-nathan.google_storage_bucket.assets-bucket: Import complete! Imported google_storage_bucket (ID: next-assets-bf-nathan-botfront-cloud) module.bf-nathan.google_storage_bucket.assets-bucket: Refreshing state..