Skip to content

Commit

Permalink
add name for use with resouce id
Browse files Browse the repository at this point in the history
  • Loading branch information
m-s-austin committed May 13, 2015
1 parent b41c737 commit 31ffdea
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions builtin/providers/aws/resource_aws_s3_bucket_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package aws
import (
"fmt"
"log"

"github.com/hashicorp/terraform/helper/schema"

"github.com/awslabs/aws-sdk-go/aws"
Expand All @@ -26,6 +27,10 @@ func resourceAwsS3BucketPolicy() *schema.Resource {
Type: schema.TypeString,
Required: true,
},
"name": &schema.Schema{
Type: schema.TypeString,
Required: true,
},
},
}
}
Expand All @@ -35,6 +40,7 @@ func resourceAwsS3BucketPolicyPut(d *schema.ResourceData, meta interface{}) erro
s3conn := meta.(*AWSClient).s3conn
bucket := d.Get("bucket").(string)
policy := d.Get("policy").(string)
name := d.Get("name").(string)

resp, err := s3conn.PutBucketPolicy(
&s3.PutBucketPolicyInput{
Expand All @@ -48,6 +54,7 @@ func resourceAwsS3BucketPolicyPut(d *schema.ResourceData, meta interface{}) erro
return fmt.Errorf("Error adding policy to S3 bucket: %s", err)
}

d.SetId(fmt.Sprintf("%s:%s", bucket, ))
return nil
}

Expand Down

0 comments on commit 31ffdea

Please sign in to comment.