data "aws_ami" "${ami-name}" {
        most_recent = true
        executable_users = ["self"]
        filter {
          name = "owner-alias"
          values = ["amazon"]
        filter {
          name = "name"
          values = ["amzn-ami-vpc-nat*"]
        owners = ["self"]
      Terraform language logo


      Terraform snippets

      This codecreates an Amazon EC2 AMI. The most_recent attribute is set to true, meaning the AMI will be the most recent one. The executable_users attribute includes a list of users who are allowed to run the AMI. The filter attributes specify which AWS resources the AMI can use. The owners attribute specifies the user who created the AMI.

      Shortcut: tf_aws_ami


        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.