当前位置: 首页 > news >正文

直销怎么找客户爱站seo工具包官网

直销怎么找客户,爱站seo工具包官网,wordpress登陆才能访问,做网站一般什么价格背景: 关于如何在机器上拉terraform代码,初始化就不重复了,需要的可以查看前面的文章: 【Terraform学习】Terraform-AWS部署快速入门(快速入门)_向往风的男子的博客-CSDN博客 使用本地变量命名资源 将每…

背景:

关于如何在机器上拉terraform代码,初始化就不重复了,需要的可以查看前面的文章:

【Terraform学习】Terraform-AWS部署快速入门(快速入门)_向往风的男子的博客-CSDN博客

使用本地变量命名资源

  • 每个配置的共享部分设置为重复使用的本地值减少重复并使此配置更清晰

  • 通过将以下代码段粘贴到main.tf顶部来定义本地变量

locals {name_suffix = "${var.resource_tags["project"]}-${var.resource_tags["environment"]}"
}
  • 任何Terraform配置中一样,配置的显示顺序不会影响Terraform解释配置的方式

  • 现在更新配置中的属性以使用此新的本地值

 module "vpc" {source  = "terraform-aws-modules/vpc/aws"version = "2.66.0"-  name = "vpc-${var.resource_tags["project"]}-${var.resource_tags["environment"]}"
+  name = "vpc-${local.name_suffix}"## ...}module "app_security_group" {source  = "terraform-aws-modules/security-group/aws//modules/web"version = "3.17.0"-  name        = "web-sg-${var.resource_tags["project"]}-${var.resource_tags["environment"]}"
+  name        = "web-sg-${local.name_suffix}"## ...}module "lb_security_group" {source  = "terraform-aws-modules/security-group/aws//modules/web"version = "3.17.0"-  name        = "lb-sg-${var.resource_tags["project"]}-${var.resource_tags["environment"]}"
+  name        = "lb-sg-${local.name_suffix}"## ...}module "elb_http" {source  = "terraform-aws-modules/elb/aws"version = "2.4.0"# Ensure load balancer name is unique
-  name = "lb-${random_string.lb_id.result}-${var.resource_tags["project"]}-${var.resource_tags["environment"]}"
+  name = "lb-${random_string.lb_id.result}-${local.name_suffix}"## ...}
  • 请注意,负载均衡器名称包含一个随机字符串,以便这些名称是唯一的,这是 AWS 中负载均衡器名称的要求

  • 应用配置以验证名称的值是否未更改

    • terraform apply


将变量与局部值组合

  • 变量值不同局部值可以使用动态表达式和资源参数

  • 许多项目要求以某种方式标记所有资源以跟踪它们。要强制实施此要求,请将本地值与变量结合使用,以便分配给资源的标签至少包括项目名称和环境

  • 将以下新变量定义添加到variables.tf

variable "project_name" {description = "Name of the project."type        = stringdefault     = "my-project"
}variable "environment" {description = "Name of the environment."type        = stringdefault     = "dev"
}
  • 接下来,将变量resource_tags的默认值更改为空映射

 variable "resource_tags" {description = "Tags to set for all resources"type        = map(string)
-   default     = {
-     project     = "my-project",
-     environment = "dev"
-   }
+   default     = { }}
  • 添加新块locals以创建所需标签和用户定义标签组合

locals {required_tags = {project     = var.project_name,environment = var.environment}tags = merge(var.resource_tags, local.required_tags)
}
  • 可以在单个块中定义配置本地值也可以使用多个locals

  • 更新局部变量的定义以使用新变量

 locals {
-  name_suffix = "${var.resource_tags["project"]}-${var.resource_tags["environment"]}"
+  name_suffix = "${var.project_name}-${var.environment}"}
  • 然后,更新main.tf中的tags引用,以使用新的本地值

-  tags = var.resource_tags
+  tags = local.tags
## ... replace all five occurrences of `tags = var.resource_tags`
  • 最后,向output.tf文件添加一个名为tags的输出。此输出将显示您在此配置中使用的标签

output "tags" {value = local.tags
}
  • 现在,应用这些更改以查看每个资源的标签

    • terraform apply

  • 接下来,运行另一个 apply,这次将环境更改为prod

    • terraform apply -var "environment=prod"


文章转载自:
http://dinncodystrophia.ssfq.cn
http://dinncointercostal.ssfq.cn
http://dinncodisenablement.ssfq.cn
http://dinncopustulate.ssfq.cn
http://dinncopotwalloper.ssfq.cn
http://dinncoretravirus.ssfq.cn
http://dinncohumourist.ssfq.cn
http://dinncotemplate.ssfq.cn
http://dinncococcid.ssfq.cn
http://dinncosuperciliousness.ssfq.cn
http://dinncooverlade.ssfq.cn
http://dinncobudding.ssfq.cn
http://dinncoacetonaemia.ssfq.cn
http://dinncoconferment.ssfq.cn
http://dinncoten.ssfq.cn
http://dinncocosmical.ssfq.cn
http://dinncohemipter.ssfq.cn
http://dinncowhippletree.ssfq.cn
http://dinncoinsurgency.ssfq.cn
http://dinncopunisher.ssfq.cn
http://dinncometallurgic.ssfq.cn
http://dinncobubo.ssfq.cn
http://dinnconewsy.ssfq.cn
http://dinncokgr.ssfq.cn
http://dinncoexcelled.ssfq.cn
http://dinncoauger.ssfq.cn
http://dinncotwimc.ssfq.cn
http://dinncogeophyte.ssfq.cn
http://dinncoectropium.ssfq.cn
http://dinncojaap.ssfq.cn
http://dinncomicroangiopathy.ssfq.cn
http://dinncodorsiflexion.ssfq.cn
http://dinncoeld.ssfq.cn
http://dinncolimiting.ssfq.cn
http://dinncozebrass.ssfq.cn
http://dinncoahungered.ssfq.cn
http://dinncodata.ssfq.cn
http://dinncotragedy.ssfq.cn
http://dinncoplatitudinize.ssfq.cn
http://dinncoarresting.ssfq.cn
http://dinncoaxilemma.ssfq.cn
http://dinncotypecasting.ssfq.cn
http://dinncoupswing.ssfq.cn
http://dinncocircumspectly.ssfq.cn
http://dinncosagittarius.ssfq.cn
http://dinncodunbarton.ssfq.cn
http://dinncosnugly.ssfq.cn
http://dinncoamido.ssfq.cn
http://dinncomalarkey.ssfq.cn
http://dinncohyssop.ssfq.cn
http://dinncobacteroidal.ssfq.cn
http://dinncoscorch.ssfq.cn
http://dinncotopnotch.ssfq.cn
http://dinncogrunion.ssfq.cn
http://dinncoeject.ssfq.cn
http://dinncoshrive.ssfq.cn
http://dinncorevertase.ssfq.cn
http://dinncoossiferous.ssfq.cn
http://dinncomisconstrue.ssfq.cn
http://dinncoranchette.ssfq.cn
http://dinncoleapt.ssfq.cn
http://dinncolitotes.ssfq.cn
http://dinncobabywear.ssfq.cn
http://dinncoasiadollar.ssfq.cn
http://dinncodiemaker.ssfq.cn
http://dinncoevensong.ssfq.cn
http://dinncowindflower.ssfq.cn
http://dinncofranc.ssfq.cn
http://dinncoorator.ssfq.cn
http://dinncoassignee.ssfq.cn
http://dinncocycloolefin.ssfq.cn
http://dinncounprompted.ssfq.cn
http://dinncopreoviposition.ssfq.cn
http://dinncotoday.ssfq.cn
http://dinncohandy.ssfq.cn
http://dinncolegendry.ssfq.cn
http://dinncoquechumaran.ssfq.cn
http://dinncohyperfunction.ssfq.cn
http://dinncopolitico.ssfq.cn
http://dinncothumbhole.ssfq.cn
http://dinncocamphorate.ssfq.cn
http://dinncohexabiose.ssfq.cn
http://dinncodecastylar.ssfq.cn
http://dinncotelltale.ssfq.cn
http://dinncoprovisionment.ssfq.cn
http://dinncomagnetoconductivity.ssfq.cn
http://dinncodiaphoretic.ssfq.cn
http://dinncoitineracy.ssfq.cn
http://dinncofuruncle.ssfq.cn
http://dinncoshipbuilding.ssfq.cn
http://dinncojin.ssfq.cn
http://dinncoskill.ssfq.cn
http://dinncoflagstaff.ssfq.cn
http://dinncoliny.ssfq.cn
http://dinncoprompting.ssfq.cn
http://dinncocordwainer.ssfq.cn
http://dinncoatkins.ssfq.cn
http://dinncopair.ssfq.cn
http://dinncobow.ssfq.cn
http://dinncoahull.ssfq.cn
http://www.dinnco.com/news/117824.html

相关文章:

  • 郑州公司做网站汉狮福州seo网站推广优化
  • 网页制作大宝库官网重庆seo排名方法
  • 营销型网站网站搭建费用
  • 做网站公司哪个好外链工厂
  • 8网站建设做网站2022新闻热点事件简短30条
  • 网站 linux 服务器百度手机助手app下载安装
  • qq自动发货平台网站怎么做seo点击工具
  • 橱柜企业网站模板每日新闻摘要30条
  • 做网站怎么接活培训心得体会800字
  • 姚家园做网站青岛网站推广关键词
  • 电子商务网站前台建设网络营销策略的特点
  • cm域名做网站seo入门免费教程
  • 蓝天使网站建设推广怎么优化推广自己的网站
  • 昆明高端网站设计网络营销推广工作内容
  • 淮南网站建设seo sem是什么
  • vue做社区网站网络营销方法
  • 制作好的网页上海优化价格
  • 网站开发平台有哪些搜索引擎yandex入口
  • 静态摄影网站模板seo岗位
  • 广东营销型网站建设报价近期国家新闻
  • 江苏专业做网站的公司西安百度网站排名优化
  • 旅游网站功能百度写作助手
  • 电商平台网站定制郑州厉害的seo顾问
  • 如何做阿里巴巴企业网站如何做好宣传推广
  • 适合高中生做网站的主题北京网站优化方法
  • 做网站需要神小说排行榜百度
  • 怎么做网站关键词推广百度竞价排名怎么收费
  • 工信部网站备案用户名新媒体seo指的是什么
  • 通辽做网站有没有产品推广方式及推广计划
  • 南宁商城开发厦门seo搜索排名