Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for gp3 volume type in aws_imagebuilder__image_reciepe resource #17274

Closed
nrohankar29 opened this issue Jan 25, 2021 · 7 comments · Fixed by #17286
Closed

Support for gp3 volume type in aws_imagebuilder__image_reciepe resource #17274

nrohankar29 opened this issue Jan 25, 2021 · 7 comments · Fixed by #17286
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/imagebuilder Issues and PRs that pertain to the imagebuilder service. upstream Addresses functionality related to the cloud provider.
Milestone

Comments

@nrohankar29
Copy link
Contributor

nrohankar29 commented Jan 25, 2021

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

Support for gp3 volume type in aws_imagebuilder__image_reciepe resource

New or Affected Resource(s)

  • aws_imagebuilder__image_reciepe

References

The change has to be done in the aws-sdk-go. I have created an issue and raised a PR for that.
aws/aws-sdk-go#3751
https://github.com/aws/aws-sdk-go/pull/3750/files

Probably we will need a new release for the aws provider

@nrohankar29 nrohankar29 added the enhancement Requests to existing resources that expand the functionality or scope. label Jan 25, 2021
@ghost ghost added the service/imagebuilder Issues and PRs that pertain to the imagebuilder service. label Jan 25, 2021
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Jan 25, 2021
@ewbankkit
Copy link
Contributor

@nrohankar29
Copy link
Contributor Author

@ewbankkit The aws_imagebuilder_image_recipe resource seems to be missing from this related issue.

@ewbankkit
Copy link
Contributor

ewbankkit commented Jan 26, 2021

@nrohankar29 Thanks for raising this issue.

I didn't include aws_imagebuilder_image_recipe in the original issue as the AWS API says

volumeType
Use to override the device's volume type.

Type: String

Valid Values: standard | io1 | io2 | gp2 | sc1 | st1

Required: No

I'll verify that gp3 is a valid value.

Note that there is not yet support for specifying any throughput value for gp3 volumes.

@ewbankkit ewbankkit removed the needs-triage Waiting for first response or review from a maintainer. label Jan 26, 2021
@ewbankkit
Copy link
Contributor

ewbankkit commented Jan 26, 2021

Verified that gp3 is supported:

provider "aws" {
  region = "us-west-2"
}

data "aws_region" "current" {}

data "aws_partition" "current" {}

resource "aws_imagebuilder_component" "test" {
  data = yamlencode({
    phases = [{
      name = "build"
      steps = [{
        action = "ExecuteBash"
        inputs = {
          commands = ["echo 'hello world'"]
        }
        name      = "example"
        onFailure = "Continue"
      }]
    }]
    schemaVersion = 1.0
  })
  name     = "test001"
  platform = "Linux"
  version  = "1.0.0"
}

resource "aws_imagebuilder_image_recipe" "test" {
  block_device_mapping {
    ebs {
      volume_type = "gp3"
    }
  }

  component {
    component_arn = aws_imagebuilder_component.test.arn
  }

  name         = "test001"
  parent_image = "arn:${data.aws_partition.current.partition}:imagebuilder:${data.aws_region.current.name}:aws:image/amazon-linux-2-x86/x.x.x"
  version      = "1.0.0"
}
$ terraform apply
data.aws_region.current: Refreshing state...
data.aws_partition.current: Refreshing state...

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # aws_imagebuilder_component.test will be created
  + resource "aws_imagebuilder_component" "test" {
      + arn          = (known after apply)
      + data         = <<~EOT
            "phases":
            - "name": "build"
              "steps":
              - "action": "ExecuteBash"
                "inputs":
                  "commands":
                  - "echo 'hello world'"
                "name": "example"
                "onFailure": "Continue"
            "schemaVersion": 1
        EOT
      + date_created = (known after apply)
      + encrypted    = (known after apply)
      + id           = (known after apply)
      + name         = "test001"
      + owner        = (known after apply)
      + platform     = "Linux"
      + type         = (known after apply)
      + version      = "1.0.0"
    }

  # aws_imagebuilder_image_recipe.test will be created
  + resource "aws_imagebuilder_image_recipe" "test" {
      + arn          = (known after apply)
      + date_created = (known after apply)
      + id           = (known after apply)
      + name         = "test001"
      + owner        = (known after apply)
      + parent_image = "arn:aws:imagebuilder:us-west-2:aws:image/amazon-linux-2-x86/x.x.x"
      + platform     = (known after apply)
      + version      = "1.0.0"

      + block_device_mapping {
          + ebs {
              + volume_type = "gp3"
            }
        }

      + component {
          + component_arn = (known after apply)
        }
    }

Plan: 2 to add, 0 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

aws_imagebuilder_component.test: Creating...
aws_imagebuilder_component.test: Creation complete after 2s [id=arn:aws:imagebuilder:us-west-2:123456789012:component/test001/1.0.0/1]
aws_imagebuilder_image_recipe.test: Creating...
aws_imagebuilder_image_recipe.test: Creation complete after 3s [id=arn:aws:imagebuilder:us-west-2:123456789012:image-recipe/test001/1.0.0]

Apply complete! Resources: 2 added, 0 changed, 0 destroyed.
$ aws --region us-west-2 imagebuilder get-image-recipe --image-recipe-arn "arn:aws:imagebuilder:us-west-2:123456789012:image-recipe/test001/1.0.0"
{
    "requestId": "094635fa-97ef-44cf-8001-b84d6d1719ac",
    "imageRecipe": {
        "arn": "arn:aws:imagebuilder:us-west-2:123456789012:image-recipe/test001/1.0.0",
        "name": "test001",
        "platform": "Linux",
        "owner": "123456789012",
        "version": "1.0.0",
        "components": [
            {
                "componentArn": "arn:aws:imagebuilder:us-west-2:123456789012:component/test001/1.0.0/1"
            }
        ],
        "parentImage": "arn:aws:imagebuilder:us-west-2:aws:image/amazon-linux-2-x86/x.x.x",
        "blockDeviceMappings": [
            {
                "ebs": {
                    "volumeType": "gp3"
                }
            }
        ],
        "dateCreated": "2021-01-26T14:32:08.662Z",
        "tags": {}
    }
}

@ewbankkit ewbankkit added the upstream Addresses functionality related to the cloud provider. label Jan 26, 2021
@nrohankar29
Copy link
Contributor Author

@ewbankkit Thank you very much.

@github-actions github-actions bot added this to the v3.28.0 milestone Feb 11, 2021
@ghost
Copy link

ghost commented Feb 12, 2021

This has been released in version 3.28.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented Mar 14, 2021

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Mar 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/imagebuilder Issues and PRs that pertain to the imagebuilder service. upstream Addresses functionality related to the cloud provider.
Projects
None yet
2 participants