-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
provider/aws: Implementing aws_ami_launch_permission resource #7365
Conversation
f1f4bd0
to
0b17c69
Compare
375b4a7
to
7837786
Compare
@stack72 ready for review |
Hi @BSick7 Unfortunately, when running the tests, I get the following:
|
@stack72 That's odd that the travis build succeeded, but yours didn't |
@BSick7 the travis build doesn't run the acceptance tests :) The cmd i ran does. So there may be someone missed P. |
Ahh right on. Thanks! Fixing. |
@stack72 I found the issue. I thought I could rely on the aws provider being "ready" to issue aws calls in my test. The only reason I am doing this is to use the account id from the current aws caller identity to verify this resource. Any thoughts on other ways to get the account id? |
c78efa1
to
3009830
Compare
Hey @BSick7 Tests still fail for me I'm afraid
Is there something missing here? P. |
3009830
to
ef77f92
Compare
@stack72 Ya, I still haven't fixed it. The resource relies on an "account_id". I suppose I could use the env vars to retrieve the account id without the use of a provider. |
ef77f92
to
03547e5
Compare
@BSick7 some of the other code we have already has an Env Var for Account Id. Therefore, there is a chance that we could effectively add our own AccountID to this resource and share the AMI with ourselves :) |
@stack72 I was looking for that! Can you point me to that account id? |
@BSick7 look for resource_aws_vpc_peering_connection.go |
2de31e7
to
7521f90
Compare
@stack72 Finally got my tests running the way I intended. It's annoying when it takes almost 5-10 minutes to run the test. |
|
Hi @BSick7 So I am slightly confused here, in the test, you are doing the following:
Thoughts? Paul |
@stack72 The acceptance test is really just ensuring that communication with aws is configured properly. I believe a better acceptance test would share with another account and build an instance using that account; however, I didn't think terraform acceptance tests were in a position to do that. |
|
||
func testAccAWSAMILaunchPermissionConfig(account_id string, includeLaunchPermission bool) string { | ||
base := ` | ||
provider "aws" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't need to worry about specifying the provider block and region here :)
We only specify it if we need to run it against a particular env
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Dropping. I originally was using an AMI in us-east-1, but upon massive changes yesterday, forgot to remove that block.
7521f90
to
390d3b9
Compare
@stack72 do you think this PR will make the 0.7 release? |
Hi @BSick7 This is looking good now :)
|
* master: (34 commits) Update CHANGELOG.md provider/aws: Delete access keys before deleting IAM user (hashicorp#7766) Fix broken link to Consul demo (hashicorp#7789) provider/aws: `aws_redshift_cluster` `number_of_nodes` was having the (hashicorp#7771) provider/aws: Restore lost client.simpledbconn initialization Update vendored atlas client Make using `ssl_verify_mode` more robust (hashicorp#7769) Update CHANGELOG.md provider/aws: Rename the ECS Container Data Source test docs/azure: Small changes to remove the use of double Update docs to centralize on ARM-based Azure provider (hashicorp#7767) Update CHANGELOG.md Update CHANGELOG.md Add support for Kinesis streams shard-level metrics (hashicorp#7684) Update CHANGELOG.md Implementing aws_ami_launch_permission. (hashicorp#7365) Update CHANGELOG.md Add VersionString provider/aws: Set `storage_encrypted` to state in (hashicorp#7751) provider/fastly: Update go-fastly SDK (hashicorp#7747) ...
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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Overview
There is currently no way to manage AMI Launch Permissions in terraform.
This PR introduces
aws_ami_launch_permission
which allows a user to provision launch permissions to other aws accounts.Syntax
Checklist