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: Add elb_account_id data source #8221

Merged
merged 1 commit into from
Aug 16, 2016

Conversation

radeksimko
Copy link
Member

I'm not sure if data source is the right place for such static lookup, but I can't think of a better place right now.

http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-access-logs.html#attach-bucket-policy

@jen20
Copy link
Contributor

jen20 commented Aug 16, 2016

I am generally 👍 on this - exposing as much information as possible via data sources to prevent hard coded values is a good idea IMO!

@jen20
Copy link
Contributor

jen20 commented Aug 16, 2016

LGTM pending Travis and running acctests - sorry about the merge conflict there!

@jen20
Copy link
Contributor

jen20 commented Aug 16, 2016

› envchain aws.terraform make testacc TEST=./builtin/providers/aws TESTARGS="-run TestAccAWSElbAccountId_basic"
==> Checking that code complies with gofmt requirements...
/Users/James/Code/go/bin/stringer
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/08/16 11:43:39 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run TestAccAWSElbAccountId_basic -timeout 120m
=== RUN   TestAccAWSElbAccountId_basic
--- PASS: TestAccAWSElbAccountId_basic (19.17s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    19.187s

@jen20 jen20 merged commit 2d8e3b1 into hashicorp:master Aug 16, 2016
@radeksimko radeksimko deleted the f-aws-elb-accid branch August 16, 2016 10:56
@apparentlymart
Copy link
Contributor

I was initially kinda confused by the name of this, thinking to myself "What is an ELB account?"

After reading the linked docs I understand now that this is the account id of the ELB service itself, for each region.

So with that definition in mind, could we instead call this aws_elb_service_account? (The _id suffix is also redundant, since id is an attribute so it causes "stutter".)

So this would look like:

data "aws_elb_service_account" "current_region" {
}
data "aws_iam_policy_document" "elb_access" {
  statement {
    principals {
        type        = "AWS"
        identifiers = "${data.aws_elb_service_account.current_region.id}"
    }
    # etc
  }
}

(Sorry this is a bit of a nit... just concerned that the naming as merged will be misleading and cause people to misunderstand what this is for.)


## Argument Reference

* `region` - (Optional) Region of a given AWS ELB Account
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe clearer to say: "Name of the region whose ELB account id is desired. If not specified, default's to the region from the AWS provider configuration."

@radeksimko
Copy link
Member Author

radeksimko commented Aug 16, 2016

@apparentlymart Thanks for all the comments, agreed to all points. I'll address that in a separate PR.

@radeksimko
Copy link
Member Author

^ @stack72 FYI - I know there's a decent portion of code you copied from here, so it would be good to make similar changes in #8224

@ghost
Copy link

ghost commented Apr 23, 2020

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.

@ghost ghost locked and limited conversation to collaborators Apr 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants