Skip to content

Commit

Permalink
Merge pull request #26521 from cookielab/eks-node-group-capacity-type
Browse files Browse the repository at this point in the history
d/aws_eks_node_group: Add capacity_type attribute
  • Loading branch information
ewbankkit authored Aug 30, 2022
2 parents bffcfc9 + bea2db6 commit af608d0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .changelog/26521.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
data-source/aws_eks_node_group: Add `capacity_type` attribute
```
5 changes: 5 additions & 0 deletions internal/service/eks/node_group_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ func DataSourceNodeGroup() *schema.Resource {
Type: schema.TypeString,
Computed: true,
},
"capacity_type": {
Type: schema.TypeString,
Computed: true,
},
"cluster_name": {
Type: schema.TypeString,
Required: true,
Expand Down Expand Up @@ -172,6 +176,7 @@ func dataSourceNodeGroupRead(ctx context.Context, d *schema.ResourceData, meta i

d.Set("ami_type", nodeGroup.AmiType)
d.Set("arn", nodeGroup.NodegroupArn)
d.Set("capacity_type", nodeGroup.CapacityType)
d.Set("cluster_name", nodeGroup.ClusterName)
d.Set("disk_size", nodeGroup.DiskSize)
d.Set("instance_types", nodeGroup.InstanceTypes)
Expand Down
1 change: 1 addition & 0 deletions internal/service/eks/node_group_data_source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ func TestAccEKSNodeGroupDataSource_basic(t *testing.T) {
testAccCheckNodeGroupExists(resourceName, &nodeGroup),
resource.TestCheckResourceAttrPair(resourceName, "ami_type", dataSourceResourceName, "ami_type"),
resource.TestCheckResourceAttrPair(resourceName, "arn", dataSourceResourceName, "arn"),
resource.TestCheckResourceAttrPair(resourceName, "capacity_type", dataSourceResourceName, "capacity_type"),
resource.TestCheckResourceAttrPair(resourceName, "cluster_name", dataSourceResourceName, "cluster_name"),
resource.TestCheckResourceAttrPair(resourceName, "disk_size", dataSourceResourceName, "disk_size"),
resource.TestCheckResourceAttr(dataSourceResourceName, "instance_types.#", "1"),
Expand Down
1 change: 1 addition & 0 deletions website/docs/d/eks_node_group.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ data "aws_eks_node_group" "example" {
* `id` - EKS Cluster name and EKS Node Group name separated by a colon (`:`).
* `ami_type` - Type of Amazon Machine Image (AMI) associated with the EKS Node Group.
* `arn` - Amazon Resource Name (ARN) of the EKS Node Group.
* `capacity_type` - Type of capacity associated with the EKS Node Group. Valid values: `ON_DEMAND`, `SPOT`.
* `disk_size` - Disk size in GiB for worker nodes.
* `instance_types` - Set of instance types associated with the EKS Node Group.
* `labels` - Key-value map of Kubernetes labels. Only labels that are applied with the EKS API are managed by this argument. Other Kubernetes labels applied to the EKS Node Group will not be managed.
Expand Down

0 comments on commit af608d0

Please sign in to comment.