简体   繁体   中英

Cloudformation to terraform conversion of SSM parameter

I am converting a Cloudformation template to terraform. following CF code:

Cloudformation:

lbdServicesBInfoParameter:
    Type: 'AWS::SSM::Parameter'
    Properties:
      Type: String
      Name: !Join 
        - ''
        - - /DepConf/
          - !Ref EnvName
          - /LKDs/lbdServicesBInfo
      Value: !Ref lbdServicesBInfo

Terraform

resource "aws_ssm_parameter" "lbdServicesBInfoParameter" {
  name  = "lbdServicesBInfoParameter"
  type  = "String"
  value = "/LKDs/lbdServicesBInfo"
}

I am not sure whether the above conversion is right. Can you please correct me iff I am wrong.

Based on our lbdServicesBInfoParameter CFN template, the terraform should be:

variable "EnvName" {
    default = some-name
}

variable "lbdServicesBInfo" {
    default = some-value
}

resource "aws_ssm_parameter" "lbdServicesBInfoParameter" {
  name  = "/DepConf/${var.EnvName}/LKDs/lbdServicesBInfo"
  type  = "String"
  value =  var.lbdServicesBInfo
}

Obviously, var.EnvName and var.lbdServicesBInfo should be set with correct values.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM