Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Resource and Data Source: aws_eks_cluster #4749

Merged
merged 3 commits into from
Jun 5, 2018
Merged

Conversation

bflad
Copy link
Contributor

@bflad bflad commented Jun 5, 2018

Closes #2473

Changes proposed in this pull request:

  • New Resource: aws_eks_cluster
  • New Data Source: aws_eks_cluster
  • New Guide: EKS Getting Started

Output from acceptance testing:

Pending in TeamCity

Also includes EKS Getting Started Guide
@bflad bflad added new-resource Introduces a new resource. new-data-source Introduces a new data source. service/eks Issues and PRs that pertain to the eks service. labels Jun 5, 2018
@bflad bflad added this to the v1.22.0 milestone Jun 5, 2018
@ghost ghost added the size/XXL Managed by automation to categorize the size of a PR. label Jun 5, 2018
@bflad bflad requested review from a team and radeksimko June 5, 2018 17:43
@mechastorm
Copy link

Wow this is the fastest I've seen an AWS service integrated into the terraform provider. Great work and thanks for the prompt update!

@bflad
Copy link
Contributor Author

bflad commented Jun 5, 2018

FYI I'm just waiting for the official EKS User Guide to be published so I can verify some pieces of the getting started guide. Some pieces might have changed between preview and general availability.

@ghost ghost added the size/XXL Managed by automation to categorize the size of a PR. label Jun 5, 2018
Copy link
Member

@radeksimko radeksimko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few comments, but nothing major, overall good job, LGTM!

},
},
},
"created_at": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this field actually useful for anyone/anything? Not a big deal if not, but I thought historically we avoided encoding fields which aren't useful from user's perspective to the schema.

// InvalidParameterException: The provided role doesn't have the Amazon EKS Managed Policies associated with it. Please ensure the following policies [arn:aws:iam::aws:policy/AmazonEKSClusterPolicy, arn:aws:iam::aws:policy/AmazonEKSServicePolicy] are attached
if isAWSErr(err, eks.ErrCodeInvalidParameterException, "The provided role doesn't have the Amazon EKS Managed Policies associated with it") {
return resource.RetryableError(err)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😭

}
// Sometimes the EKS API returns the ResourceNotFound error in this form:
// ClientException: No cluster found for name: tf-acc-test-0o1f8
if isAWSErr(err, eks.ErrCodeClientException, "No cluster found for name:") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😭

return nil
}

func TestAccAWSEksCluster_Basic(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick, but AFAIK all our tests use _basic, not _Basic.


conn := testAccProvider.Meta().(*AWSClient).eksconn

// Handle eventual consistency
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😭

manage or retrieve data from other AWS services. It is also possible to create
these policies with the [`aws_iam_policy_document` data source](/docs/providers/aws/d/iam_policy_document.html)

For the latest required policy, see the EKS User Guide.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick, but link to the EKS User Guide may be useful here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ha! Great catch. I was waiting for the official URL. I'll add it.

locals {
kubeconfig = <<KUBECONFIG


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the two empty lines desired here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I was developing the original demo configuration, the extra lines were helpful for distinguishing the "config" output from the "TF" output in the terminal. I don't think they'll hurt anything being in here still.

to allow worker nodes to join the cluster. It is also possible to create
these policies with the [`aws_iam_policy_document` data source](/docs/providers/aws/d/iam_policy_document.html)

For the latest required policy, see the EKS User Guide.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likewise, link to the user guide would be nice to have.

data "aws_ami" "eks-worker" {
filter {
name = "name"
values = ["eks-worker-*"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious - this is version agnostic intentionally? i.e. is the data source always going to fetch a valid AMI regardless of the K8S version (currently 1.10)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can address this at a later time by updating the various pieces that might be version specific. 👍 Currently the guide is version agnostic.


While managing the underlying Kubernetes cluster configuration is beyond the
scope of this guide, we provide an example of how to apply the required
Kubernetes `ConfigMap` via `kubectl` below for completeness.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A link to Config Map would be nice to have here.
https://cloud.google.com/kubernetes-engine/docs/concepts/configmap

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Will add.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI we'll update the link to the one from @errm post-merge 👍

@ghost ghost added the size/XXL Managed by automation to categorize the size of a PR. label Jun 5, 2018
@bflad bflad merged commit d34f081 into master Jun 5, 2018
@bflad bflad deleted the f-aws_eks_cluster branch June 5, 2018 18:54
bflad added a commit that referenced this pull request Jun 5, 2018
@ghost
Copy link

ghost commented Apr 5, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
new-data-source Introduces a new data source. new-resource Introduces a new resource. service/eks Issues and PRs that pertain to the eks service. size/XXL Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Amazon EKS Resource (Elastic Container Service for Kubernetes)
5 participants