terraform-provider-aws

Terraform how to get IP address of aws_lb

。_饼干妹妹 提交于 2020-02-24 05:27:40
问题 Question If there a way to get the assigned IP address of an aws_lb resource at the time aws_lb is created by Terraform? As in AWS documentation - NLB - To find the private IP addresses to whitelist, we can find out the IP address associated to ELB. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/. In the navigation pane, choose Network Interfaces. In the search field, type the name of your Network Load Balancer. There is one network interface per load balancer subnet. On

Terraform how to get IP address of aws_lb

不想你离开。 提交于 2020-02-24 05:26:31
问题 Question If there a way to get the assigned IP address of an aws_lb resource at the time aws_lb is created by Terraform? As in AWS documentation - NLB - To find the private IP addresses to whitelist, we can find out the IP address associated to ELB. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/. In the navigation pane, choose Network Interfaces. In the search field, type the name of your Network Load Balancer. There is one network interface per load balancer subnet. On

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

Commands in user_data are not executed in terraform

和自甴很熟 提交于 2020-01-23 06:55:47
问题 Hi EC2 instance is created, but commands as part of userdata.sh are not gettingexecuted. When I manually connect to EC2 via putty, i found that nginx is not installed in EC2 instance. To verify if the script is getting executed or not I added echo message, but no output is display in command prompt when i run terraform apply. How can i verify if the user-data is getting executed or not? I have installed Terraform in C drive and below script are present in same folder C:/Terraform/userdata.sh,

Build output map in terraform

╄→尐↘猪︶ㄣ 提交于 2020-01-15 05:57:30
问题 I have a list of users to create, a list of sns topics and to create policies to give permissions to users on topics. These are all namespaced against the user... Given: main.tf provider "aws" { region = "eu-west-1" profile = "terraform" } module "topics" { source = "./queues/topics" } module "users" { source = "./users" } module "policies" { source = "./policies" sns_topics = "${module.topics.sns_topics}" } ./queues/topics.tf resource "aws_sns_topic" "svc_topic" { count = "${length(var.sns

Terraform remote state in Jenkins

久未见 提交于 2020-01-06 06:51:34
问题 am working on a declarative Jenkins pipeline for Terraform deployments. I want to have the terraform state stored remotely in my s3 I get an error terraform apply -input=false ow.plan [31mFailed to load Terraform configuration or plan: open ow.plan: no such file or directory Any suggestions? Here's my code: pipeline { agent any tools { "org.jenkinsci.plugins.terraform.TerraformInstallation" "terraform" } parameters { choice(name: 'action', choices: 'create\ndestroy', description: 'Create

EMR creation task and core nodes not able to specify as “Max on demand” for spot pricing

旧巷老猫 提交于 2020-01-05 05:03:11
问题 core_instance_group { instance_type = "c4.large" instance_count = 1 ebs_config { size = "40" type = "gp2" volumes_per_instance = 1 } bid_price = "0.30" I would require the bid_price = "max on-demand". Not sure how to pass this parameter in terraform. 回答1: I figured out a way. However, included couple of scripts to fetch the price details. Something like this: AWS price cmd: InstanceType=$1 aws pricing get-products --filters Type=TERM_MATCH,Field=instanceType,Value=${InstanceType} Type=TERM

EMR creation task and core nodes not able to specify as “Max on demand” for spot pricing

时间秒杀一切 提交于 2020-01-05 05:03:10
问题 core_instance_group { instance_type = "c4.large" instance_count = 1 ebs_config { size = "40" type = "gp2" volumes_per_instance = 1 } bid_price = "0.30" I would require the bid_price = "max on-demand". Not sure how to pass this parameter in terraform. 回答1: I figured out a way. However, included couple of scripts to fetch the price details. Something like this: AWS price cmd: InstanceType=$1 aws pricing get-products --filters Type=TERM_MATCH,Field=instanceType,Value=${InstanceType} Type=TERM

Given a failed AWS API request, how can I debug what permissions I need?

耗尽温柔 提交于 2019-12-25 01:06:14
问题 I'm using Terraform to provision some resources on AWS. Running the "plan" step of Terraform fails with the following vague error (for example): Error: Error loading state: AccessDenied: Access Denied status code: 403, request id: ABCDEF12345678, host id: SOMELONGBASE64LOOKINGSTRING=== Given a request id and a host id is it possible to see more in depth what went wrong? Setting TF_LOG=DEBUG (or some other level) seems to help, but I was curious if there is a CLI command to get more

Terraform stucks when instance_count is more than 2 while using remote-exec provisioner

蹲街弑〆低调 提交于 2019-12-24 04:29:08
问题 I am trying to provision multiple Windows EC2 instance with Terraform's remote-exec provisioner using null_resource. $ terraform -v Terraform v0.12.6 provider.aws v2.23.0 provider.null v2.1.2 Originally, I was working with three remote-exec provisioners (Two of them involved rebooting the instance) without null_resource and for a single instance , everything worked absolutely fine. I then needed to increase the count and based on several links, ended up using null_resource. So, I have reduced