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

[New Resource]: aws_imagebuilder_lifecycle_policy #34854

Closed
seanturner026 opened this issue Dec 11, 2023 · 14 comments · Fixed by #35674
Closed

[New Resource]: aws_imagebuilder_lifecycle_policy #34854

seanturner026 opened this issue Dec 11, 2023 · 14 comments · Fixed by #35674
Assignees
Labels
new-resource Introduces a new resource. service/imagebuilder Issues and PRs that pertain to the imagebuilder service.
Milestone

Comments

@seanturner026
Copy link

seanturner026 commented Dec 11, 2023

Description

Image Builder recently added a lifecycle manager that would be super handy in preventing the accumulation of AMIs (and EBS Snapshots?) which cost $$.

https://aws.amazon.com/about-aws/whats-new/2023/11/ec2-image-builder-lifecycle-management-deletion/

Requested Resource(s) and/or Data Source(s)

aws_imagebuild_lifecycle_policy

Potential Terraform Configuration

resource "aws_imagebuilder_lifecycle_policy" "this" {
  name          = string
  enabled       = bool
  description   = string
  resource_type = string // AMI_IMAGE | CONTAINER_IMAGE
  iam_role      = string // name or arn in awscli docs

  // Mutually exclusive?
  resource_selection {
    recipes {
      name             = string
      semantic_version = string
    }

    tags {
      key   = string
      value = string
    }
  }

  // See JSON Syntax in awscli docs
  policy_details {
  }

  lifecycle_rules {
    delete_rule    = bool
    deprecate_rule = bool
    disable_rule   = bool
  }

  tags = map(string)
}

References

https://aws.amazon.com/about-aws/whats-new/2023/11/ec2-image-builder-lifecycle-management-deletion/

Would you like to implement a fix?

No

Copy link

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • 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.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added the service/imagebuilder Issues and PRs that pertain to the imagebuilder service. label Dec 11, 2023
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Dec 11, 2023
@bschaatsbergen
Copy link
Member

bschaatsbergen commented Dec 11, 2023

Hey @seanturner026 thanks for taking the time to raise this issue! 👏🏼 Correct me if I'm wrong, but you're pointing to the EC2 Image Builder Lifecycle Policy right?

In that case, I think we should rename the resource: aws_imagebuilder_lifecycle_policy 👍🏼

API reference:

@bschaatsbergen bschaatsbergen removed the needs-triage Waiting for first response or review from a maintainer. label Dec 11, 2023
@seanturner026
Copy link
Author

Sounds good! Will update the original post to reflect that. I was looking in the AWS Console when I originally started creating this issue which refers to the resource as a lifecycle I believe.

@seanturner026 seanturner026 changed the title [New Resource]: aws_imagebuilder_lifecycle [New Resource]: aws_imagebuilder_lifecycle_policy Dec 11, 2023
@bschaatsbergen
Copy link
Member

I'll happily pick this up too 🚀

@sophiecosgrove
Copy link

Hey, are there any updates on this?

@bschaatsbergen
Copy link
Member

Hey @sophiecosgrove, I'm still working on this - it's just in my "todo" of provider tickets I'm currently working on. I aim to have this done next week.

@bschaatsbergen
Copy link
Member

bschaatsbergen commented Feb 19, 2024

Just a quick update: We're actively working on the issue in the background. However, it's taking a bit longer than expected because we need to update the entire image builder service in this provider to use the AWS SDK v2. Thanks for your patience.

Update as of March 1st: We're almost finished moving the imagebuilder service to V2. @DanielRieske has been helping me with this because there's a lot of work to be done.

Update as of March 11: We've implementation work and migration to the aws-sdk-v2, it became a really large PR and we need to loop in the core team for this change.

Update as of April 5: @DanielRieske is finalizing the last acceptance tests.

cc @ewbankkit

@sethbacon
Copy link

Any updates? Trying to wait patiently on this one :) ...

@nestorcolt
Copy link

a new AWS provider has been introduced "awscc" which hosts this feature with:
https://registry.terraform.io/providers/hashicorp/awscc/latest/docs/resources/imagebuilder_lifecycle_policy

awscc_imagebuilder_lifecycle_policy (Resource)
Resource schema for AWS::ImageBuilder::LifecyclePolicy

@DanielRieske
Copy link
Contributor

DanielRieske commented May 6, 2024

Hi everyone, small update on this.

We are still actively working on getting this merged however we are running in a problem with certain arguments not being serialized.
For this we have created an issue upstream aws/aws-sdk#736 to fix for which we are waiting.
As soon as this is picked up we will continue on the PR,

@mobious999
Copy link

any updates?

@sophiecosgrove
Copy link

Hi, any updates on this please?

@bschaatsbergen
Copy link
Member

bschaatsbergen commented Sep 25, 2024

Hey @sophiecosgrove 👋🏼,

Thank you for checking in! We’re currently awaiting a fix for this AWS SDK issue and a related issue for AWS SDK Go V2. Our pull request is being closely monitored and will be merged as soon as these SDK issues are resolved. If you have any urgent concerns, it would be best to raise them directly in those issues or reach out to AWS support.

Copy link

Warning

This issue has been closed, meaning that any additional comments are hard for our team to see. Please assume that the maintainers will not see them.

Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed.

@github-actions github-actions bot added this to the v5.73.0 milestone Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-resource Introduces a new resource. service/imagebuilder Issues and PRs that pertain to the imagebuilder service.
Projects
None yet
8 participants