Lab 20: Create SSM Parameter Using Terraform
The Nautilus DevOps team needs to create an SSM parameter in AWS with the following requirements:
-
The name of the parameter should be
devops-ssm-parameter. -
Set the parameter type to
String. -
Set the parameter value to
devops-value. -
The parameter should be created in the
us-east-1region. -
Ensure the parameter is successfully created using
terraformand can be retrieved when the task is completed.
The Terraform working directory is /home/bob/terraform. Create the main.tf file (do not create a different .tf file) to accomplish this task.
Note: Right-click under the EXPLORER section in VS Code and select Open in Integrated Terminal to launch the terminal.
Create main.tf
resource "aws_ssm_parameter" "devops-ssm-parameter" {
name = "devops-ssm-parameter"
type = "String"
value = "devops-value"
}
terraform init
terraform plan -out kke.plan && terraform apply kke.plan
# or apply forcefully without creating plan and applying it
terraform apply -auto-approve