Skip to content

Latest commit

 

History

History
37 lines (28 loc) · 988 Bytes

Ex-8.md

File metadata and controls

37 lines (28 loc) · 988 Bytes

Working with Terraform Providers (AWS Provider: Creating SNS Topic)

Prerequisites

  • AWS account
  • Terraform installed
  • AWS CLI installed
  • AWS CLI configured with your credentials

Procedure

  1. Create a directory for your project and change into it.
  2. Create a file named main.tf and add the following code to it:
provider "aws" {
  region = "us-east-1"
}

resource "aws_sns_topic" "devops-ex-8" {
  name = "devops-ex-8"
}
  1. Run terraform init to initialize the directory. terraform init

  2. Run terraform plan to see what Terraform will do. terraform plan

  3. Run terraform apply to create the resources. terraform apply AWS SNS

  4. Run terraform destroy to destroy the resources. terraform destroy terraform destroy

  5. Success! You have created an SNS topic using Terraform.