terraform

Terraform referencing output from another module with for_each

删除回忆录丶 提交于 2021-01-24 13:36:06
问题 I am having trouble referencing an output from a module in another module. The resources in the first module was deployed using for_each. The resources in the second module is trying to reference the resources from first module There are 2 modules created Security Group VM The intention is to assign the Security Group to the VM The following is the module for the Security Group variable "configserver" { type = map(object({ name = string location = string subnet = string availability_zone =

EC2 instance creation

我与影子孤独终老i 提交于 2021-01-24 11:34:24
问题 I'm trying to create multiple EC2 instance but they have different AMIs, instance types and should be in different availability zones as shown below. I've tried a few different ways but can't make it work. locals { az_ami = [ {Name = "host1", type = "t3a.medium", az = "eu_west_2a", ami_id = "ami-01234abc"}, {Name = "host2", type = "t3a.micro", az = "eu_west_2b", ami_id = "ami-01234def"}, {Name = "host3", type = "t3a.medium", az = "eu_west_2b", ami_id = "ami-01234gef"}, {Name = "host4", type =

How to structure terraform code to get Lambda ARN after creation?

你。 提交于 2021-01-24 07:19:17
问题 This was a previous question I asked: How to get AWS Lambda ARN using Terraform? This question was answered but turns out didn't actually solve my problem so this is a follow up. The terraform code I have written provisions a Lambda function: Root module: terraform { required_providers { aws = { source = "hashicorp/aws" } } } provider "aws" { region = var.region profile = var.aws_profile } module "aws_lambda_function" { source = "./modules/lambda_function" } Child module: resource "aws_lambda

How to structure terraform code to get Lambda ARN after creation?

浪子不回头ぞ 提交于 2021-01-24 07:19:10
问题 This was a previous question I asked: How to get AWS Lambda ARN using Terraform? This question was answered but turns out didn't actually solve my problem so this is a follow up. The terraform code I have written provisions a Lambda function: Root module: terraform { required_providers { aws = { source = "hashicorp/aws" } } } provider "aws" { region = var.region profile = var.aws_profile } module "aws_lambda_function" { source = "./modules/lambda_function" } Child module: resource "aws_lambda

How to structure terraform code to get Lambda ARN after creation?

余生长醉 提交于 2021-01-24 07:17:25
问题 This was a previous question I asked: How to get AWS Lambda ARN using Terraform? This question was answered but turns out didn't actually solve my problem so this is a follow up. The terraform code I have written provisions a Lambda function: Root module: terraform { required_providers { aws = { source = "hashicorp/aws" } } } provider "aws" { region = var.region profile = var.aws_profile } module "aws_lambda_function" { source = "./modules/lambda_function" } Child module: resource "aws_lambda

DevOps“五宗罪”,这样向DevOps过渡注定会失败

橙三吉。 提交于 2021-01-24 01:25:56
云计算提供的速度响应、敏捷性和规模效应,契合了如今不断变化的数字商业环境。企业基于最新的IT技术,重构IT架构,加速产品创新和服务交付的速度,从而提高运营效率和市场占有。 不过,企业IT管理者在利用云计算进行数字化转型时,往往会面临两方面的挑战:一是技术,一是企业固有的流程、文化和组织架构。许多公司仍然运转于各个“信息孤岛”,陷入依赖“瀑布式”软件开发的泥潭中,这与技术本身提供的巨大灵活性背道而驰。 在数字化时代,速度和敏捷性是企业领跑和打造核心竞争力的关键。DevOps通过打破开发与运维之间的隔阂,大大缩短软件的开发周期,并快速部署到生产环境,对企业的数字化转型至关重要。 DevOps就像一座现代软件开发的圣杯。许多人都在积极寻找,有些人声称已经找到,而更多人还在寻找中。 由于每家公司都有其独特的运营方式,通往 DevOps 成功之路上,没有一步步的标准化指导。但是,可以肯定以下这5种方式是无法过渡到DevOps的,DevOps不应该做什么,希望本文能够给企业客户以启示。 不确定DevOps对企业的业务意味着什么 DevOps并没有严格的定义,它为什么会出现,采用DevOps可以解决什么问题,有多种解释。从2010年起,DevOps运动的创始人之一斯蒂芬·尼尔森·史密斯(StephenNelson-Smith)就发布了一篇有关DevOps的很漂亮的帖子。清楚地说明了,开发

Obtain Slack auth_token for Terraform google_monitoring_notification_channel resource

邮差的信 提交于 2021-01-21 06:32:04
问题 I'm looking to set up some alerts from gcloud -> slack, and so far have a test up and running having followed these instructions: https://cloud.google.com/monitoring/support/notification-options?_ga=2.190773474.-879257953.1550134526#slack However, ideally I'd store the config for these notifications in a terraform script so that I don't have manual steps to follow if things need setting up again. It looks like this should be possible: https://www.terraform.io/docs/providers/google/r

How to for_each through a list(objects) in Terraform 0.12

会有一股神秘感。 提交于 2021-01-20 16:22:39
问题 I need to deploy a list of GCP compute instances. How do I loop for_each through the "vms" in a list of objects like this: "gcp_zone": "us-central1-a", "image_name": "centos-cloud/centos-7", "vms": [ { "hostname": "test1-srfe", "cpu": 1, "ram": 4, "hdd": 15, "log_drive": 300, "template": "Template-New", "service_types": [ "sql", "db01", "db02" ] }, { "hostname": "test1-second", "cpu": 1, "ram": 4, "hdd": 15, "template": "APPs-Template", "service_types": [ "configs" ] } ] } 回答1: Seem's like I

How to append stepfunction execution id to SageMaker job names?

心不动则不痛 提交于 2021-01-20 13:16:09
问题 I have a step function statemachine which creates SageMaker batch transform job, the definition is written in Terraform, I wanted to add the stepfunction execution id to the batch transform job names: in stepfunction terraform file: definition = templatefile("stepfuntion.json", { xxxx ) in the "stepfuntion.json": {... "TransformJobName": "jobname-$$.Execution.Id", } }, "End": true } } } But after terraform apply, it didn't generate the actual id, it gave me jobname-$$.Execution.Id , can

Terraform EKS tagging

匆匆过客 提交于 2021-01-20 11:37:28
问题 I am having this issue of Terraform EKS tagging and don't seem to find workable solution to tag all the VPC subnets when a new cluster is created. To provide some context: We have one AWS VPC where we deployment several EKS cluster into the subnets. We do not create VPC or subnets are part of the EKS cluster creation. Therefore, the terraform code creating a cluster doesn't get to tag existing subnets and VPC. Although EKS will add the required tags, they are automatically removed next time