Skip to content

Commit

Permalink
Merge #9390: arn attribute for AWS Lambda alias
Browse files Browse the repository at this point in the history
  • Loading branch information
apparentlymart committed Oct 16, 2016
2 parents 94ba00b + 8ec06e8 commit f86198c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ BUG FIXES:
* core: List and map indexes are implicitly converted to the correct type if possible [GH-9372]
* provider/google: Fixed a bug causing a crash when migrating `google_compute_target_pool` resources from 0.6.x releases [GH-9370]

IMPROVEMENTS:

* provider/aws: Expose ARN for aws_lambda_alias [GH-9390]

## 0.7.6 (October 14, 2016)

BACKWARDS INCOMPATIBILITIES / NOTES:
Expand Down
5 changes: 5 additions & 0 deletions builtin/providers/aws/resource_aws_lambda_alias.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ func resourceAwsLambdaAlias() *schema.Resource {
Type: schema.TypeString,
Required: true,
},
"arn": &schema.Schema{
Type: schema.TypeString,
Computed: true,
},
},
}
}
Expand Down Expand Up @@ -84,6 +88,7 @@ func resourceAwsLambdaAliasRead(d *schema.ResourceData, meta interface{}) error
d.Set("description", aliasConfiguration.Description)
d.Set("function_version", aliasConfiguration.FunctionVersion)
d.Set("name", aliasConfiguration.Name)
d.Set("arn", aliasConfiguration.AliasArn)

return nil
}
Expand Down
2 changes: 2 additions & 0 deletions builtin/providers/aws/resource_aws_lambda_alias_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package aws

import (
"fmt"
"regexp"
"testing"

"github.com/aws/aws-sdk-go/aws"
Expand All @@ -23,6 +24,7 @@ func TestAccAWSLambdaAlias_basic(t *testing.T) {
Check: resource.ComposeTestCheckFunc(
testAccCheckAwsLambdaAliasExists("aws_lambda_alias.lambda_alias_test", &conf),
testAccCheckAwsLambdaAttributes(&conf),
resource.TestMatchResourceAttr("aws_lambda_alias.lambda_alias_test", "arn", regexp.MustCompile(`^arn:aws:lambda:[a-z]+-[a-z]+-[0-9]+:\d{12}:function:example_lambda_name_create:testalias$`)),
),
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,9 @@ resource "aws_lambda_alias" "test_alias" {
* `function_name` - (Required) The function ARN of the Lambda function for which you want to create an alias.
* `function_version` - (Required) Lambda function version for which you are creating the alias. Pattern: `(\$LATEST|[0-9]+)`.

## Attributes Reference

* `arn` - The Amazon Resource Name (ARN) identifying your Lambda function alias.

[1]: http://docs.aws.amazon.com/lambda/latest/dg/welcome.html
[2]: http://docs.aws.amazon.com/lambda/latest/dg/API_CreateAlias.html

0 comments on commit f86198c

Please sign in to comment.