Skip to content

Commit

Permalink
Merge pull request #4766 from terraform-providers/b-aws_eks_cluster-arn
Browse files Browse the repository at this point in the history
aws_eks_cluster: Ensure arn is available as an attribute
  • Loading branch information
bflad authored Jun 6, 2018
2 parents 1fc685c + 4237db6 commit c4e687c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions aws/data_source_aws_eks_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ func dataSourceAwsEksCluster() *schema.Resource {
Read: dataSourceAwsEksClusterRead,

Schema: map[string]*schema.Schema{
"arn": {
Type: schema.TypeString,
Computed: true,
},
"certificate_authority": {
Type: schema.TypeList,
MaxItems: 1,
Expand Down
1 change: 1 addition & 0 deletions aws/data_source_aws_eks_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ func TestAccAWSEksClusterDataSource_basic(t *testing.T) {
{
Config: testAccAWSEksClusterDataSourceConfig_Basic(rName),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrPair(resourceName, "arn", dataSourceResourceName, "arn"),
resource.TestCheckResourceAttr(dataSourceResourceName, "certificate_authority.#", "1"),
resource.TestCheckResourceAttrPair(resourceName, "certificate_authority.0.data", dataSourceResourceName, "certificate_authority.0.data"),
resource.TestCheckResourceAttrPair(resourceName, "created_at", dataSourceResourceName, "created_at"),
Expand Down
4 changes: 4 additions & 0 deletions aws/resource_aws_eks_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ func resourceAwsEksCluster() *schema.Resource {
},

Schema: map[string]*schema.Schema{
"arn": {
Type: schema.TypeString,
Computed: true,
},
"certificate_authority": {
Type: schema.TypeList,
MaxItems: 1,
Expand Down
1 change: 1 addition & 0 deletions aws/resource_aws_eks_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ func TestAccAWSEksCluster_basic(t *testing.T) {
Config: testAccAWSEksClusterConfig_Required(rName),
Check: resource.ComposeTestCheckFunc(
testAccCheckAWSEksClusterExists(resourceName, &cluster),
resource.TestMatchResourceAttr(resourceName, "arn", regexp.MustCompile(fmt.Sprintf("^arn:[^:]+:eks:[^:]+:[^:]+:cluster/%s$", rName))),
resource.TestCheckResourceAttr(resourceName, "certificate_authority.#", "1"),
resource.TestCheckResourceAttrSet(resourceName, "certificate_authority.0.data"),
resource.TestMatchResourceAttr(resourceName, "endpoint", regexp.MustCompile(`^https://`)),
Expand Down

0 comments on commit c4e687c

Please sign in to comment.