github.com/ves/terraform@v0.8.0-beta2/website/source/docs/providers/aws/d/elb_service_account.html.markdown (about) 1 --- 2 layout: "aws" 3 page_title: "AWS: aws_elb_service_account" 4 sidebar_current: "docs-aws-datasource-elb-service-account" 5 description: |- 6 Get AWS Elastic Load Balancing Service Account 7 --- 8 9 # aws\_elb\_service\_account 10 11 Use this data source to get the Account ID of the [AWS Elastic Load Balancing Service Account](http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-access-logs.html#attach-bucket-policy) 12 in a given region for the purpose of whitelisting in S3 bucket policy. 13 14 ## Example Usage 15 16 ``` 17 data "aws_elb_service_account" "main" { } 18 19 resource "aws_s3_bucket" "elb_logs" { 20 bucket = "my-elb-tf-test-bucket" 21 acl = "private" 22 policy = <<POLICY 23 { 24 "Id": "Policy", 25 "Version": "2012-10-17", 26 "Statement": [ 27 { 28 "Action": [ 29 "s3:PutObject" 30 ], 31 "Effect": "Allow", 32 "Resource": "arn:aws:s3:::my-elb-tf-test-bucket/AWSLogs/*", 33 "Principal": { 34 "AWS": [ 35 "${data.aws_elb_service_account.main.id}" 36 ] 37 } 38 } 39 ] 40 } 41 POLICY 42 } 43 44 resource "aws_elb" "bar" { 45 name = "my-foobar-terraform-elb" 46 availability_zones = ["us-west-2a"] 47 48 access_logs { 49 bucket = "${aws_s3_bucket.elb_logs.bucket}" 50 interval = 5 51 } 52 53 listener { 54 instance_port = 8000 55 instance_protocol = "http" 56 lb_port = 80 57 lb_protocol = "http" 58 } 59 } 60 ``` 61 62 ## Argument Reference 63 64 * `region` - (Optional) Name of the region whose AWS ELB account ID is desired. 65 Defaults to the region from the AWS provider configuration. 66 67 68 ## Attributes Reference 69 70 * `id` - The ID of the AWS ELB service account in the selected region. 71 * `arn` - The ARN of the AWS ELB service account in the selected region.