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

aws_ami_launch_permission: support group permissions #20677

Conversation

grahamc
Copy link
Contributor

@grahamc grahamc commented Aug 25, 2021

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment 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 pull request followers and do not help prioritize the request

Closes #11101

$ time make fmt testacc TESTARGS='-run=TestAccAWSAMILaunchPermission'
==> Fixing source code with gofmt...
gofmt -s -w ./aws ./awsproviderlint/helper ./awsproviderlint/main.go ./awsproviderlint/passes
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSAMILaunchPermission -timeout 180m
=== RUN   TestAccAWSAMILaunchPermission_Account_basic
=== PAUSE TestAccAWSAMILaunchPermission_Account_basic
=== RUN   TestAccAWSAMILaunchPermission_Group_basic
=== PAUSE TestAccAWSAMILaunchPermission_Group_basic
=== RUN   TestAccAWSAMILaunchPermission_Account_Disappears_LaunchPermission
=== PAUSE TestAccAWSAMILaunchPermission_Account_Disappears_LaunchPermission
=== RUN   TestAccAWSAMILaunchPermission_Group_Disappears_LaunchPermission
=== PAUSE TestAccAWSAMILaunchPermission_Group_Disappears_LaunchPermission
=== RUN   TestAccAWSAMILaunchPermission_Account_Disappears_LaunchPermission_Public
=== PAUSE TestAccAWSAMILaunchPermission_Account_Disappears_LaunchPermission_Public
=== RUN   TestAccAWSAMILaunchPermission_Account_Disappears_AMI
=== PAUSE TestAccAWSAMILaunchPermission_Account_Disappears_AMI
=== RUN   TestAccAWSAMILaunchPermission_Group_Disappears_AMI
=== PAUSE TestAccAWSAMILaunchPermission_Group_Disappears_AMI
=== CONT  TestAccAWSAMILaunchPermission_Account_basic
=== CONT  TestAccAWSAMILaunchPermission_Group_Disappears_AMI
=== CONT  TestAccAWSAMILaunchPermission_Account_Disappears_LaunchPermission
=== CONT  TestAccAWSAMILaunchPermission_Group_Disappears_LaunchPermission
=== CONT  TestAccAWSAMILaunchPermission_Account_Disappears_LaunchPermission_Public
=== CONT  TestAccAWSAMILaunchPermission_Account_Disappears_AMI
=== CONT  TestAccAWSAMILaunchPermission_Group_basic
--- PASS: TestAccAWSAMILaunchPermission_Group_Disappears_LaunchPermission (361.20s)
--- PASS: TestAccAWSAMILaunchPermission_Account_Disappears_LaunchPermission (361.62s)
--- PASS: TestAccAWSAMILaunchPermission_Account_Disappears_LaunchPermission_Public (362.57s)
--- PASS: TestAccAWSAMILaunchPermission_Group_basic (366.17s)
--- PASS: TestAccAWSAMILaunchPermission_Account_basic (374.68s)
--- PASS: TestAccAWSAMILaunchPermission_Account_Disappears_AMI (404.18s)
--- PASS: TestAccAWSAMILaunchPermission_Group_Disappears_AMI (404.45s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	404.495s

real	6m55.521s
user	1m54.557s
sys	0m8.773s

@github-actions github-actions bot added documentation Introduces or discusses updates to documentation. service/ec2 Issues and PRs that pertain to the ec2 service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. needs-triage Waiting for first response or review from a maintainer. size/L Managed by automation to categorize the size of a PR. labels Aug 25, 2021
@grahamc grahamc force-pushed the f-aws_launch_permission-groups branch from 023f30d to 1cb51f2 Compare August 25, 2021 03:01
@grahamc
Copy link
Contributor Author

grahamc commented Aug 25, 2021

fwiw I've deployed this to my prod env via curl -L https://github.com/hashicorp/terraform-provider-aws/pull/20677.patch > public-amis.patch and:

pkgs.mkShell {
  buildInputs = [
    pkgs.awscli2
    pkgs.jq
    (pkgs.terraform_1_0.withPlugins (p: [
      (p.aws.overrideAttrs ({ patches ? [], ... }: {
        patches = patches ++ [ ./public-amis.patch ];
      }))
      p.local
    ]))
  ];
}

@grahamc
Copy link
Contributor Author

grahamc commented Aug 25, 2021

One side effect of this PR is it causes aws_ami's public attribute to change, which Terraform is a bit unhappy about:

Note: Objects have changed outside of Terraform

Terraform detected the following changes made outside of Terraform since the last "terraform apply":

  # aws_ami.ami["21.11pre311304.71b3d18-zfs-arm64"] has been changed
  ~ resource "aws_ami" "ami" {
        id                  = "ami-0ee39fc86f37d667b"
        name                = "21.11pre311304.71b3d18-zfs-arm64"
      ~ public              = true -> false
        tags                = {
            "architecture" = "arm64"
            "built"        = "2021-08-25T15:40:16Z"
            "os"           = "NixOS"
            "root_fs"      = "zfs"
        }
        # (14 unchanged attributes hidden)


        # (6 unchanged blocks hidden)
    }
  # aws_ami.ami["21.11pre311304.71b3d18-zfs-x86_64"] has been changed
  ~ resource "aws_ami" "ami" {
        id                  = "ami-063d1014ff68c9adf"
        name                = "21.11pre311304.71b3d18-zfs-x86_64"
      ~ public              = true -> false
        tags                = {
            "architecture" = "x86_64"
            "built"        = "2021-08-25T15:40:16Z"
            "os"           = "NixOS"
            "root_fs"      = "zfs"
        }
        # (14 unchanged attributes hidden)


        # (6 unchanged blocks hidden)
    }

I'm not totally sure what to do about that, if anything.

@grahamc grahamc marked this pull request as ready for review August 25, 2021 16:41
@breathingdust breathingdust added enhancement Requests to existing resources that expand the functionality or scope. and removed needs-triage Waiting for first response or review from a maintainer. labels Aug 26, 2021
@zhelding
Copy link
Contributor

Pull request #21306 has significantly refactored the AWS Provider codebase. As a result, most PRs opened prior to the refactor now have merge conflicts that must be resolved before proceeding.

Specifically, PR #21306 relocated the code for all AWS resources and data sources from a single aws directory to a large number of separate directories in internal/service, each corresponding to a particular AWS service. This separation of code has also allowed for us to simplify the names of underlying functions -- while still avoiding namespace collisions.

We recognize that many pull requests have been open for some time without yet being addressed by our maintainers. Therefore, we want to make it clear that resolving these conflicts in no way affects the prioritization of a particular pull request. Once a pull request has been prioritized for review, the necessary changes will be made by a maintainer -- either directly or in collaboration with the pull request author.

For a more complete description of this refactor, including examples of how old filepaths and function names correspond to their new counterparts: please refer to issue #20000.

For a quick guide on how to amend your pull request to resolve the merge conflicts resulting from this refactor and bring it in line with our new code patterns: please refer to our Service Package Refactor Pull Request Guide.

@ewbankkit
Copy link
Contributor

This functionality has been rolled into #21694.

@ewbankkit ewbankkit closed this Apr 13, 2022
@cole-h cole-h deleted the f-aws_launch_permission-groups branch April 17, 2022 22:15
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. enhancement Requests to existing resources that expand the functionality or scope. service/ec2 Issues and PRs that pertain to the ec2 service. size/L Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing public for aws_ami and aws_ami_from_instance
4 participants