DEV Community

Part2 - AWS APP Runner -Terraform (IAC)

AWS APP Runner Terraform scripts
Prerequisites : Configured my AWS Credentials using aws configure

1.Create a file and name it as - provider.tf

provider "aws" {
  region = "eu-west-1"
}
Enter fullscreen mode Exit fullscreen mode

2.Create a file and name it as - main.tf

resource "aws_apprunner_service" "example" {
  service_name = "example"

  source_configuration {
    image_repository {
      image_configuration {
        port = "8000"
      }
      image_identifier      = "public.ecr.aws/aws-containers/hello-app-runner:latest"
      image_repository_type = "ECR_PUBLIC"
    }
    auto_deployments_enabled = false
  }

  tags = {
    Name = "example-apprunner-service"
  }
}
Enter fullscreen mode Exit fullscreen mode

3. Apply the terraform changes

Image description

4. Changes visible in aws console
Image description

and render the url https://3vizispdgx.eu-west-1.awsapprunner.com

Image description

5. Destroy APP Runner

Image description

Image description

Conclusion : Provisioned and destroyed AWS APP Runner using terraform scripts

💬 If you enjoyed reading this blog post and found it informative, please take a moment to share your thoughts by leaving a review and liking it 😀 and follow me in linkedin

Top comments (0)