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

Add support for cluster authentication mode and access entries #1171

Merged
merged 23 commits into from
Jun 4, 2024

Conversation

flostadler
Copy link
Contributor

@flostadler flostadler commented May 28, 2024

Proposed changes

AWS recently introduced a new method for granting IAM principals access to Kubernetes resources called Access Entries. These resources are now the recommended approach for controlling access to EKS clusters.

Previously, the aws-auth ConfigMap was the sole method for mapping IAM principals to Kubernetes RBAC. Now, users can choose between using the ConfigMap (access mode CONFIG_MAP), Access Entries (access mode API), or both (access mode API_AND_CONFIG_MAP).

This PR adds support for the new access modes as described in this internal doc: https://docs.google.com/document/d/1QS7h2E6lVTf8F6eVoHJOX3KowufvbhLqgRFFzTSb-SU/edit#heading=h.3b4er6mf60f5

How to review?

Start by reviewing the schema changes (provider/cmd/pulumi-gen-eks/main.go) and then have a look at the changes to the cluster (nodejs/eks/cluster.ts).

After that have a look at the user facing documentation for migrating between access modes (docs/authentication-mode-migration.md) and the accompanying test for it (examples/tests/authentication-mode-migration/README.md).

Related issues (optional)

Closes #1027

@flostadler flostadler self-assigned this May 28, 2024
@pulumi pulumi deleted a comment from github-actions bot May 29, 2024
@pulumi pulumi deleted a comment from github-actions bot May 29, 2024
@pulumi pulumi deleted a comment from github-actions bot May 29, 2024
@pulumi pulumi deleted a comment from github-actions bot May 29, 2024
@pulumi pulumi deleted a comment from github-actions bot May 29, 2024
@@ -533,14 +570,55 @@ func mapClusterToKubeAccess(kubeconfigs ...interface{}) (clusterKubeAccessMap, e
}

// Parse the kubeconfig user auth exec args for the cluster name.
clusterNameIndex := len(kubeAccess.RESTConfig.ExecProvider.Args) - 1
var clusterNameIndex int
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This previously assumed that the cluster name is always the last parameter in the list, but that's not true (with the current aws cli version it's the output type for example).

This now retrieves the correct positional argument

roleMappings: pulumi.Input<pulumi.Input<RoleMapping>[]> | undefined,
userMappings: pulumi.Input<pulumi.Input<UserMapping>[]> | undefined,
): pulumi.Input<{ [key: string]: pulumi.Input<string> }> {
const instanceRoleMappings = instanceRoles.apply((roles) =>
Copy link
Contributor Author

@flostadler flostadler May 30, 2024

Choose a reason for hiding this comment

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

This is the same as before, just extracted it to here to slim down cluster.ts a bit and make it more manageable

monitoring: {
enabled: args.enableDetailedMonitoring,
},
monitoring:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This changed by pulling the new upstream provider version. Without this we're always getting diffs when the monitoring block is empty (i.e. all it's properties are undefined`

Copy link
Member

Choose a reason for hiding this comment

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

You can throw an issue in pulumi-aws if relevant happy to dig deep into that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's one of the permadiffs on empty objects that we've already found some of (empty blocks are not saved to state).

I can cut a ticket to look into it holistically

@pulumi pulumi deleted a comment from github-actions bot May 30, 2024
@pulumi pulumi deleted a comment from github-actions bot May 30, 2024
@pulumi pulumi deleted a comment from github-actions bot May 30, 2024
@@ -19,7 +19,7 @@
},
"bugs": "https://github.com/pulumi/pulumi-eks/issues",
"dependencies": {
"@pulumi/aws": "^6.0.4",
"@pulumi/aws": "^6.18.2",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the first version supporting access entries

@pulumi pulumi deleted a comment from github-actions bot May 30, 2024
These map to Access Entries of type `STANDARD`, which is the default.

The following shows how you'd add access entries for the role and user mappings:
```
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
```
```ts

These map to Access Entries of type `EC2_LINUX`.

The following shows how you'd add access entries for the instance roles:
```
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
```
```ts

Copy link

Does the PR have any schema changes?

Found 54 breaking changes:
Resource "eks:index:NodeGroupV2" input "clusterIngressRule" type changed from "/aws/v6.5.0/schema.json#/resources/aws:ec2%2FsecurityGroupRule:SecurityGroupRule" to "/aws/v6.18.2/schema.json#/resources/aws:ec2%2FsecurityGroupRule:SecurityGroupRule"
Resource "eks:index:NodeGroupV2" input "extraNodeSecurityGroups" items type changed from "/aws/v6.5.0/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup" to "/aws/v6.18.2/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup"
Resource "eks:index:NodeGroupV2" input "launchTemplateTagSpecifications" items type changed from "/aws/v6.5.0/schema.json#/types/aws:ec2%2FLaunchTemplateTagSpecification:LaunchTemplateTagSpecification" to "/aws/v6.18.2/schema.json#/types/aws:ec2%2FLaunchTemplateTagSpecification:LaunchTemplateTagSpecification"
Resource "eks:index:NodeGroupV2" input "instanceProfile" type changed from "/aws/v6.5.0/schema.json#/resources/aws:iam%2FinstanceProfile:InstanceProfile" to "/aws/v6.18.2/schema.json#/resources/aws:iam%2FinstanceProfile:InstanceProfile"
Resource "eks:index:NodeGroupV2" input "nodeSecurityGroup" type changed from "/aws/v6.5.0/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup" to "/aws/v6.18.2/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup"
Resource "eks:index:NodeGroupV2" output "autoScalingGroup" type changed from "/aws/v6.5.0/schema.json#/resources/aws:autoscaling%2Fgroup:Group" to "/aws/v6.18.2/schema.json#/resources/aws:autoscaling%2Fgroup:Group"
Resource "eks:index:NodeGroupV2" output "extraNodeSecurityGroups" items type changed from "/aws/v6.5.0/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup" to "/aws/v6.18.2/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup"
Resource "eks:index:NodeGroupV2" output "nodeSecurityGroup" type changed from "/aws/v6.5.0/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup" to "/aws/v6.18.2/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup"
Resource "eks:index:Cluster" input "clusterSecurityGroup" type changed from "/aws/v6.5.0/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup" to "/aws/v6.18.2/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup"
Resource "eks:index:Cluster" input "serviceRole" type changed from "/aws/v6.5.0/schema.json#/resources/aws:iam%2Frole:Role" to "/aws/v6.18.2/schema.json#/resources/aws:iam%2Frole:Role"
Resource "eks:index:Cluster" input "instanceRoles" items type changed from "/aws/v6.5.0/schema.json#/resources/aws:iam%2Frole:Role" to "/aws/v6.18.2/schema.json#/resources/aws:iam%2Frole:Role"
Resource "eks:index:Cluster" input "instanceRole" type changed from "/aws/v6.5.0/schema.json#/resources/aws:iam%2Frole:Role" to "/aws/v6.18.2/schema.json#/resources/aws:iam%2Frole:Role"
Resource "eks:index:Cluster" output "awsProvider" type changed from "/aws/v6.5.0/schema.json#/provider" to "/aws/v6.18.2/schema.json#/provider"
Resource "eks:index:Cluster" output "clusterSecurityGroup" type changed from "/aws/v6.5.0/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup" to "/aws/v6.18.2/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup"
Resource "eks:index:Cluster" output "eksCluster" type changed from "/aws/v6.5.0/schema.json#/resources/aws:eks%2Fcluster:Cluster" to "/aws/v6.18.2/schema.json#/resources/aws:eks%2Fcluster:Cluster"
Resource "eks:index:Cluster" output "eksClusterIngressRule" type changed from "/aws/v6.5.0/schema.json#/resources/aws:ec2%2FsecurityGroupRule:SecurityGroupRule" to "/aws/v6.18.2/schema.json#/resources/aws:ec2%2FsecurityGroupRule:SecurityGroupRule"
Resource "eks:index:Cluster" output "instanceRoles" items type changed from "/aws/v6.5.0/schema.json#/resources/aws:iam%2Frole:Role" to "/aws/v6.18.2/schema.json#/resources/aws:iam%2Frole:Role"
Resource "eks:index:Cluster" output "nodeSecurityGroup" type changed from "/aws/v6.5.0/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup" to "/aws/v6.18.2/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup"
Resource "eks:index:ClusterCreationRoleProvider" output "role" type changed from "/aws/v6.5.0/schema.json#/resources/aws:iam%2Frole:Role" to "/aws/v6.18.2/schema.json#/resources/aws:iam%2Frole:Role"
Resource "eks:index:ManagedNodeGroup" input "launchTemplate" type changed from "/aws/v6.5.0/schema.json#/types/aws:eks%2FNodeGroupLaunchTemplate:NodeGroupLaunchTemplate" to "/aws/v6.18.2/schema.json#/types/aws:eks%2FNodeGroupLaunchTemplate:NodeGroupLaunchTemplate"
Resource "eks:index:ManagedNodeGroup" input "remoteAccess" type changed from "/aws/v6.5.0/schema.json#/types/aws:eks%2FNodeGroupRemoteAccess:NodeGroupRemoteAccess" to "/aws/v6.18.2/schema.json#/types/aws:eks%2FNodeGroupRemoteAccess:NodeGroupRemoteAccess"
Resource "eks:index:ManagedNodeGroup" input "scalingConfig" type changed from "/aws/v6.5.0/schema.json#/types/aws:eks%2FNodeGroupScalingConfig:NodeGroupScalingConfig" to "/aws/v6.18.2/schema.json#/types/aws:eks%2FNodeGroupScalingConfig:NodeGroupScalingConfig"
Resource "eks:index:ManagedNodeGroup" input "nodeRole" type changed from "/aws/v6.5.0/schema.json#/resources/aws:iam%2Frole:Role" to "/aws/v6.18.2/schema.json#/resources/aws:iam%2Frole:Role"
Resource "eks:index:ManagedNodeGroup" input "taints" items type changed from "/aws/v6.5.0/schema.json#/types/aws:eks%2FNodeGroupTaint:NodeGroupTaint" to "/aws/v6.18.2/schema.json#/types/aws:eks%2FNodeGroupTaint:NodeGroupTaint"
Resource "eks:index:ManagedNodeGroup" output "nodeGroup" type changed from "/aws/v6.5.0/schema.json#/resources/aws:eks%2FnodeGroup:NodeGroup" to "/aws/v6.18.2/schema.json#/resources/aws:eks%2FnodeGroup:NodeGroup"
Resource "eks:index:NodeGroup" input "instanceProfile" type changed from "/aws/v6.5.0/schema.json#/resources/aws:iam%2FinstanceProfile:InstanceProfile" to "/aws/v6.18.2/schema.json#/resources/aws:iam%2FinstanceProfile:InstanceProfile"
Resource "eks:index:NodeGroup" input "nodeSecurityGroup" type changed from "/aws/v6.5.0/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup" to "/aws/v6.18.2/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup"
Resource "eks:index:NodeGroup" input "clusterIngressRule" type changed from "/aws/v6.5.0/schema.json#/resources/aws:ec2%2FsecurityGroupRule:SecurityGroupRule" to "/aws/v6.18.2/schema.json#/resources/aws:ec2%2FsecurityGroupRule:SecurityGroupRule"
Resource "eks:index:NodeGroup" input "extraNodeSecurityGroups" items type changed from "/aws/v6.5.0/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup" to "/aws/v6.18.2/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup"
Resource "eks:index:NodeGroup" output "cfnStack" type changed from "/aws/v6.5.0/schema.json#/resources/aws:cloudformation%2Fstack:Stack" to "/aws/v6.18.2/schema.json#/resources/aws:cloudformation%2Fstack:Stack"
Resource "eks:index:NodeGroup" output "extraNodeSecurityGroups" items type changed from "/aws/v6.5.0/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup" to "/aws/v6.18.2/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup"
Resource "eks:index:NodeGroup" output "nodeSecurityGroup" type changed from "/aws/v6.5.0/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup" to "/aws/v6.18.2/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup"
Resource "eks:index:NodeGroupSecurityGroup" input "eksCluster" type changed from "/aws/v6.5.0/schema.json#/resources/aws:eks%2Fcluster:Cluster" to "/aws/v6.18.2/schema.json#/resources/aws:eks%2Fcluster:Cluster"
Resource "eks:index:NodeGroupSecurityGroup" input "clusterSecurityGroup" type changed from "/aws/v6.5.0/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup" to "/aws/v6.18.2/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup"
Resource "eks:index:NodeGroupSecurityGroup" output "securityGroupRule" type changed from "/aws/v6.5.0/schema.json#/resources/aws:ec2%2FsecurityGroupRule:SecurityGroupRule" to "/aws/v6.18.2/schema.json#/resources/aws:ec2%2FsecurityGroupRule:SecurityGroupRule"
Resource "eks:index:NodeGroupSecurityGroup" output "securityGroup" type changed from "/aws/v6.5.0/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup" to "/aws/v6.18.2/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup"
Type "eks:index:NodeGroupData" input "extraNodeSecurityGroups" items type changed from "/aws/v6.5.0/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup" to "/aws/v6.18.2/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup"
Type "eks:index:NodeGroupData" input "nodeSecurityGroup" type changed from "/aws/v6.5.0/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup" to "/aws/v6.18.2/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup"
Type "eks:index:NodeGroupData" input "cfnStack" type changed from "/aws/v6.5.0/schema.json#/resources/aws:cloudformation%2Fstack:Stack" to "/aws/v6.18.2/schema.json#/resources/aws:cloudformation%2Fstack:Stack"
Type "eks:index:ClusterNodeGroupOptions" input "clusterIngressRule" type changed from "/aws/v6.5.0/schema.json#/resources/aws:ec2%2FsecurityGroupRule:SecurityGroupRule" to "/aws/v6.18.2/schema.json#/resources/aws:ec2%2FsecurityGroupRule:SecurityGroupRule"
Type "eks:index:ClusterNodeGroupOptions" input "nodeSecurityGroup" type changed from "/aws/v6.5.0/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup" to "/aws/v6.18.2/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup"
Type "eks:index:ClusterNodeGroupOptions" input "extraNodeSecurityGroups" items type changed from "/aws/v6.5.0/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup" to "/aws/v6.18.2/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup"
Type "eks:index:ClusterNodeGroupOptions" input "instanceProfile" type changed from "/aws/v6.5.0/schema.json#/resources/aws:iam%2FinstanceProfile:InstanceProfile" to "/aws/v6.18.2/schema.json#/resources/aws:iam%2FinstanceProfile:InstanceProfile"
Type "eks:index:CreationRoleProvider" input "provider" type changed from "/aws/v6.5.0/schema.json#/provider" to "/aws/v6.18.2/schema.json#/provider"
Type "eks:index:CreationRoleProvider" input "role" type changed from "/aws/v6.5.0/schema.json#/resources/aws:iam%2Frole:Role" to "/aws/v6.18.2/schema.json#/resources/aws:iam%2Frole:Role"
Type "eks:index:CoreData" input "cluster" type changed from "/aws/v6.5.0/schema.json#/resources/aws:eks%2Fcluster:Cluster" to "/aws/v6.18.2/schema.json#/resources/aws:eks%2Fcluster:Cluster"
Type "eks:index:CoreData" input "oidcProvider" type changed from "/aws/v6.5.0/schema.json#/resources/aws:iam%2FopenIdConnectProvider:OpenIdConnectProvider" to "/aws/v6.18.2/schema.json#/resources/aws:iam%2FopenIdConnectProvider:OpenIdConnectProvider"
Type "eks:index:CoreData" input "fargateProfile" type changed from "/aws/v6.5.0/schema.json#/resources/aws:eks%2FfargateProfile:FargateProfile" to "/aws/v6.18.2/schema.json#/resources/aws:eks%2FfargateProfile:FargateProfile"
Type "eks:index:CoreData" input "clusterSecurityGroup" type changed from "/aws/v6.5.0/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup" to "/aws/v6.18.2/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup"
Type "eks:index:CoreData" input "awsProvider" type changed from "/aws/v6.5.0/schema.json#/provider" to "/aws/v6.18.2/schema.json#/provider"
Type "eks:index:CoreData" input "clusterIamRole" type changed from "/aws/v6.5.0/schema.json#/resources/aws:iam%2Frole:Role" to "/aws/v6.18.2/schema.json#/resources/aws:iam%2Frole:Role"
Type "eks:index:CoreData" input "encryptionConfig" type changed from "/aws/v6.5.0/schema.json#/types/aws:eks%2FClusterEncryptionConfig:ClusterEncryptionConfig" to "/aws/v6.18.2/schema.json#/types/aws:eks%2FClusterEncryptionConfig:ClusterEncryptionConfig"
Type "eks:index:CoreData" input "instanceRoles" items type changed from "/aws/v6.5.0/schema.json#/resources/aws:iam%2Frole:Role" to "/aws/v6.18.2/schema.json#/resources/aws:iam%2Frole:Role"
Type "eks:index:FargateProfile" input "selectors" items type changed from "/aws/v6.5.0/schema.json#/types/aws:eks%2FFargateProfileSelector:FargateProfileSelector" to "/aws/v6.18.2/schema.json#/types/aws:eks%2FFargateProfileSelector:FargateProfileSelector"
No new resources/functions.

@pulumi pulumi deleted a comment from github-actions bot May 31, 2024
@pulumi pulumi deleted a comment from github-actions bot May 31, 2024
@flostadler
Copy link
Contributor Author

The upgrade test failures are expected right now. They complain about a change in the aws provider, which does not skip the metadata API check by default now: https://github.com/pulumi/pulumi-aws/releases/tag/v6.37.1

Once this eks change is released we need to bump the baseline version and then they're green again

@pulumi pulumi deleted a comment from github-actions bot May 31, 2024
@pulumi pulumi deleted a comment from github-actions bot May 31, 2024
@@ -142,61 +141,3 @@ func test(t *testing.T, dir string, opts ...providertest.Option) *providertest.P
)
return providertest.NewProviderTest(dir, opts...)
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This retrieved the dependencies of the current version, but we need the deps of the baseline version

@flostadler flostadler requested review from blampe, t0yv0 and rquitales May 31, 2024 13:30
test.each([
[
{
authenticationMode: "CONFIG_MAP",
Copy link
Member

Choose a reason for hiding this comment

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

"CONFIG_MAP" is a literal not an enum val is this right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, the underlying aws provider does not have enums here

@@ -35,7 +35,7 @@ func main() {
return err
}

authMode := "API_AND_CONFIG_MAP"
authMode := eks.AuthenticationModeApiAndConfigMap
Copy link
Member

Choose a reason for hiding this comment

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

Oh nice.

@@ -53,7 +53,7 @@
max_size=1,
instance_type="t3.small"
),
authentication_mode=eks.AuthenticationMode.AP_I_AN_D_CONFI_G_MAP,
authentication_mode=eks.AuthenticationMode.API_AND_CONFIG_MAP,
Copy link
Member

Choose a reason for hiding this comment

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

Better.

* The authentication mode of the cluster. Valid values are `CONFIG_MAP`, `API` or `API_AND_CONFIG_MAP`
* See for more details:\nhttps://docs.aws.amazon.com/eks/latest/userguide/grant-k8s-access.html#set-cam
*/
export type AccessEntryType = (typeof AccessEntryType)[keyof typeof AccessEntryType];
Copy link
Member

Choose a reason for hiding this comment

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

Nice.

Copy link
Member

@t0yv0 t0yv0 left a comment

Choose a reason for hiding this comment

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

Thank you!

@@ -685,3 +685,78 @@ func TestAccCNIAcrossUpdates(t *testing.T) {
t.Log("Ensuring that re-running `pulumi up` results in no changes and no spurious diffs")
pt.Up(optup.ExpectNoChanges())
}

func TestAccAuthenticationMode(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.

Note: these tests won't run in CI. You'd need to manually add them to the test matrix in our workflow files (eg.

test-name:
- AwsProfile
- Cluster
- CNIAcrossUpdates
- EncryptionProvider
- ExtraSecurityGroups
- Fargate
- ImportDefaultEksSecgroup
- KubernetesServiceIPv4RangeForCluster
- ManagedNodeGroup
- MigrateNodeGroups
- MNG_withAwsAuth
- MNG_withMissingRole
- NodeGroup
- NodegroupOptions
- OidcIam
- ReplaceClusterAddSubnets
- ReplaceSecGroup
- ScopedKubeconfig
- StorageClasses
- TagInputTypes
- Tags
- VpcSubnetTags
).

Copy link
Member

@rquitales rquitales left a comment

Choose a reason for hiding this comment

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

Changes looks good! Thanks for adding both unit and integration tests. Just a note that these tests won't currently run in CI. Approving to be non-blocking.

Copy link

github-actions bot commented Jun 4, 2024

Does the PR have any schema changes?

Found 54 breaking changes:
Resource "eks:index:Cluster" input "instanceRole" type changed from "/aws/v6.5.0/schema.json#/resources/aws:iam%2Frole:Role" to "/aws/v6.18.2/schema.json#/resources/aws:iam%2Frole:Role"
Resource "eks:index:Cluster" input "serviceRole" type changed from "/aws/v6.5.0/schema.json#/resources/aws:iam%2Frole:Role" to "/aws/v6.18.2/schema.json#/resources/aws:iam%2Frole:Role"
Resource "eks:index:Cluster" input "clusterSecurityGroup" type changed from "/aws/v6.5.0/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup" to "/aws/v6.18.2/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup"
Resource "eks:index:Cluster" input "instanceRoles" items type changed from "/aws/v6.5.0/schema.json#/resources/aws:iam%2Frole:Role" to "/aws/v6.18.2/schema.json#/resources/aws:iam%2Frole:Role"
Resource "eks:index:Cluster" output "eksClusterIngressRule" type changed from "/aws/v6.5.0/schema.json#/resources/aws:ec2%2FsecurityGroupRule:SecurityGroupRule" to "/aws/v6.18.2/schema.json#/resources/aws:ec2%2FsecurityGroupRule:SecurityGroupRule"
Resource "eks:index:Cluster" output "instanceRoles" items type changed from "/aws/v6.5.0/schema.json#/resources/aws:iam%2Frole:Role" to "/aws/v6.18.2/schema.json#/resources/aws:iam%2Frole:Role"
Resource "eks:index:Cluster" output "awsProvider" type changed from "/aws/v6.5.0/schema.json#/provider" to "/aws/v6.18.2/schema.json#/provider"
Resource "eks:index:Cluster" output "clusterSecurityGroup" type changed from "/aws/v6.5.0/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup" to "/aws/v6.18.2/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup"
Resource "eks:index:Cluster" output "eksCluster" type changed from "/aws/v6.5.0/schema.json#/resources/aws:eks%2Fcluster:Cluster" to "/aws/v6.18.2/schema.json#/resources/aws:eks%2Fcluster:Cluster"
Resource "eks:index:Cluster" output "nodeSecurityGroup" type changed from "/aws/v6.5.0/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup" to "/aws/v6.18.2/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup"
Resource "eks:index:ClusterCreationRoleProvider" output "role" type changed from "/aws/v6.5.0/schema.json#/resources/aws:iam%2Frole:Role" to "/aws/v6.18.2/schema.json#/resources/aws:iam%2Frole:Role"
Resource "eks:index:ManagedNodeGroup" input "nodeRole" type changed from "/aws/v6.5.0/schema.json#/resources/aws:iam%2Frole:Role" to "/aws/v6.18.2/schema.json#/resources/aws:iam%2Frole:Role"
Resource "eks:index:ManagedNodeGroup" input "taints" items type changed from "/aws/v6.5.0/schema.json#/types/aws:eks%2FNodeGroupTaint:NodeGroupTaint" to "/aws/v6.18.2/schema.json#/types/aws:eks%2FNodeGroupTaint:NodeGroupTaint"
Resource "eks:index:ManagedNodeGroup" input "remoteAccess" type changed from "/aws/v6.5.0/schema.json#/types/aws:eks%2FNodeGroupRemoteAccess:NodeGroupRemoteAccess" to "/aws/v6.18.2/schema.json#/types/aws:eks%2FNodeGroupRemoteAccess:NodeGroupRemoteAccess"
Resource "eks:index:ManagedNodeGroup" input "scalingConfig" type changed from "/aws/v6.5.0/schema.json#/types/aws:eks%2FNodeGroupScalingConfig:NodeGroupScalingConfig" to "/aws/v6.18.2/schema.json#/types/aws:eks%2FNodeGroupScalingConfig:NodeGroupScalingConfig"
Resource "eks:index:ManagedNodeGroup" input "launchTemplate" type changed from "/aws/v6.5.0/schema.json#/types/aws:eks%2FNodeGroupLaunchTemplate:NodeGroupLaunchTemplate" to "/aws/v6.18.2/schema.json#/types/aws:eks%2FNodeGroupLaunchTemplate:NodeGroupLaunchTemplate"
Resource "eks:index:ManagedNodeGroup" output "nodeGroup" type changed from "/aws/v6.5.0/schema.json#/resources/aws:eks%2FnodeGroup:NodeGroup" to "/aws/v6.18.2/schema.json#/resources/aws:eks%2FnodeGroup:NodeGroup"
Resource "eks:index:NodeGroup" input "nodeSecurityGroup" type changed from "/aws/v6.5.0/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup" to "/aws/v6.18.2/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup"
Resource "eks:index:NodeGroup" input "instanceProfile" type changed from "/aws/v6.5.0/schema.json#/resources/aws:iam%2FinstanceProfile:InstanceProfile" to "/aws/v6.18.2/schema.json#/resources/aws:iam%2FinstanceProfile:InstanceProfile"
Resource "eks:index:NodeGroup" input "extraNodeSecurityGroups" items type changed from "/aws/v6.5.0/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup" to "/aws/v6.18.2/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup"
Resource "eks:index:NodeGroup" input "clusterIngressRule" type changed from "/aws/v6.5.0/schema.json#/resources/aws:ec2%2FsecurityGroupRule:SecurityGroupRule" to "/aws/v6.18.2/schema.json#/resources/aws:ec2%2FsecurityGroupRule:SecurityGroupRule"
Resource "eks:index:NodeGroup" output "cfnStack" type changed from "/aws/v6.5.0/schema.json#/resources/aws:cloudformation%2Fstack:Stack" to "/aws/v6.18.2/schema.json#/resources/aws:cloudformation%2Fstack:Stack"
Resource "eks:index:NodeGroup" output "extraNodeSecurityGroups" items type changed from "/aws/v6.5.0/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup" to "/aws/v6.18.2/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup"
Resource "eks:index:NodeGroup" output "nodeSecurityGroup" type changed from "/aws/v6.5.0/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup" to "/aws/v6.18.2/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup"
Resource "eks:index:NodeGroupSecurityGroup" input "clusterSecurityGroup" type changed from "/aws/v6.5.0/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup" to "/aws/v6.18.2/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup"
Resource "eks:index:NodeGroupSecurityGroup" input "eksCluster" type changed from "/aws/v6.5.0/schema.json#/resources/aws:eks%2Fcluster:Cluster" to "/aws/v6.18.2/schema.json#/resources/aws:eks%2Fcluster:Cluster"
Resource "eks:index:NodeGroupSecurityGroup" output "securityGroup" type changed from "/aws/v6.5.0/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup" to "/aws/v6.18.2/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup"
Resource "eks:index:NodeGroupSecurityGroup" output "securityGroupRule" type changed from "/aws/v6.5.0/schema.json#/resources/aws:ec2%2FsecurityGroupRule:SecurityGroupRule" to "/aws/v6.18.2/schema.json#/resources/aws:ec2%2FsecurityGroupRule:SecurityGroupRule"
Resource "eks:index:NodeGroupV2" input "extraNodeSecurityGroups" items type changed from "/aws/v6.5.0/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup" to "/aws/v6.18.2/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup"
Resource "eks:index:NodeGroupV2" input "nodeSecurityGroup" type changed from "/aws/v6.5.0/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup" to "/aws/v6.18.2/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup"
Resource "eks:index:NodeGroupV2" input "clusterIngressRule" type changed from "/aws/v6.5.0/schema.json#/resources/aws:ec2%2FsecurityGroupRule:SecurityGroupRule" to "/aws/v6.18.2/schema.json#/resources/aws:ec2%2FsecurityGroupRule:SecurityGroupRule"
Resource "eks:index:NodeGroupV2" input "instanceProfile" type changed from "/aws/v6.5.0/schema.json#/resources/aws:iam%2FinstanceProfile:InstanceProfile" to "/aws/v6.18.2/schema.json#/resources/aws:iam%2FinstanceProfile:InstanceProfile"
Resource "eks:index:NodeGroupV2" input "launchTemplateTagSpecifications" items type changed from "/aws/v6.5.0/schema.json#/types/aws:ec2%2FLaunchTemplateTagSpecification:LaunchTemplateTagSpecification" to "/aws/v6.18.2/schema.json#/types/aws:ec2%2FLaunchTemplateTagSpecification:LaunchTemplateTagSpecification"
Resource "eks:index:NodeGroupV2" output "nodeSecurityGroup" type changed from "/aws/v6.5.0/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup" to "/aws/v6.18.2/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup"
Resource "eks:index:NodeGroupV2" output "autoScalingGroup" type changed from "/aws/v6.5.0/schema.json#/resources/aws:autoscaling%2Fgroup:Group" to "/aws/v6.18.2/schema.json#/resources/aws:autoscaling%2Fgroup:Group"
Resource "eks:index:NodeGroupV2" output "extraNodeSecurityGroups" items type changed from "/aws/v6.5.0/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup" to "/aws/v6.18.2/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup"
Type "eks:index:CreationRoleProvider" input "provider" type changed from "/aws/v6.5.0/schema.json#/provider" to "/aws/v6.18.2/schema.json#/provider"
Type "eks:index:CreationRoleProvider" input "role" type changed from "/aws/v6.5.0/schema.json#/resources/aws:iam%2Frole:Role" to "/aws/v6.18.2/schema.json#/resources/aws:iam%2Frole:Role"
Type "eks:index:FargateProfile" input "selectors" items type changed from "/aws/v6.5.0/schema.json#/types/aws:eks%2FFargateProfileSelector:FargateProfileSelector" to "/aws/v6.18.2/schema.json#/types/aws:eks%2FFargateProfileSelector:FargateProfileSelector"
Type "eks:index:NodeGroupData" input "nodeSecurityGroup" type changed from "/aws/v6.5.0/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup" to "/aws/v6.18.2/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup"
Type "eks:index:NodeGroupData" input "cfnStack" type changed from "/aws/v6.5.0/schema.json#/resources/aws:cloudformation%2Fstack:Stack" to "/aws/v6.18.2/schema.json#/resources/aws:cloudformation%2Fstack:Stack"
Type "eks:index:NodeGroupData" input "extraNodeSecurityGroups" items type changed from "/aws/v6.5.0/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup" to "/aws/v6.18.2/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup"
Type "eks:index:ClusterNodeGroupOptions" input "instanceProfile" type changed from "/aws/v6.5.0/schema.json#/resources/aws:iam%2FinstanceProfile:InstanceProfile" to "/aws/v6.18.2/schema.json#/resources/aws:iam%2FinstanceProfile:InstanceProfile"
Type "eks:index:ClusterNodeGroupOptions" input "clusterIngressRule" type changed from "/aws/v6.5.0/schema.json#/resources/aws:ec2%2FsecurityGroupRule:SecurityGroupRule" to "/aws/v6.18.2/schema.json#/resources/aws:ec2%2FsecurityGroupRule:SecurityGroupRule"
Type "eks:index:ClusterNodeGroupOptions" input "extraNodeSecurityGroups" items type changed from "/aws/v6.5.0/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup" to "/aws/v6.18.2/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup"
Type "eks:index:ClusterNodeGroupOptions" input "nodeSecurityGroup" type changed from "/aws/v6.5.0/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup" to "/aws/v6.18.2/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup"
Type "eks:index:CoreData" input "instanceRoles" items type changed from "/aws/v6.5.0/schema.json#/resources/aws:iam%2Frole:Role" to "/aws/v6.18.2/schema.json#/resources/aws:iam%2Frole:Role"
Type "eks:index:CoreData" input "cluster" type changed from "/aws/v6.5.0/schema.json#/resources/aws:eks%2Fcluster:Cluster" to "/aws/v6.18.2/schema.json#/resources/aws:eks%2Fcluster:Cluster"
Type "eks:index:CoreData" input "fargateProfile" type changed from "/aws/v6.5.0/schema.json#/resources/aws:eks%2FfargateProfile:FargateProfile" to "/aws/v6.18.2/schema.json#/resources/aws:eks%2FfargateProfile:FargateProfile"
Type "eks:index:CoreData" input "awsProvider" type changed from "/aws/v6.5.0/schema.json#/provider" to "/aws/v6.18.2/schema.json#/provider"
Type "eks:index:CoreData" input "oidcProvider" type changed from "/aws/v6.5.0/schema.json#/resources/aws:iam%2FopenIdConnectProvider:OpenIdConnectProvider" to "/aws/v6.18.2/schema.json#/resources/aws:iam%2FopenIdConnectProvider:OpenIdConnectProvider"
Type "eks:index:CoreData" input "clusterIamRole" type changed from "/aws/v6.5.0/schema.json#/resources/aws:iam%2Frole:Role" to "/aws/v6.18.2/schema.json#/resources/aws:iam%2Frole:Role"
Type "eks:index:CoreData" input "clusterSecurityGroup" type changed from "/aws/v6.5.0/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup" to "/aws/v6.18.2/schema.json#/resources/aws:ec2%2FsecurityGroup:SecurityGroup"
Type "eks:index:CoreData" input "encryptionConfig" type changed from "/aws/v6.5.0/schema.json#/types/aws:eks%2FClusterEncryptionConfig:ClusterEncryptionConfig" to "/aws/v6.18.2/schema.json#/types/aws:eks%2FClusterEncryptionConfig:ClusterEncryptionConfig"
No new resources/functions.

@flostadler flostadler merged commit b19f155 into master Jun 4, 2024
42 checks passed
@flostadler flostadler deleted the 1027-access-config-entry branch June 4, 2024 08:32
flostadler added a commit that referenced this pull request Sep 4, 2024
AWS recently introduced a new method for granting IAM principals access
to Kubernetes resources called[ Access
Entries](https://docs.aws.amazon.com/eks/latest/userguide/grant-k8s-access.html#authentication-modes).
These resources are now the recommended approach for controlling access
to EKS clusters.

Previously, the aws-auth ConfigMap was the sole method for mapping IAM
principals to Kubernetes RBAC. Now, users can choose between using the
ConfigMap (access mode CONFIG_MAP), Access Entries (access mode API), or
both (access mode API_AND_CONFIG_MAP).

This PR adds support for the new access modes as described in this
internal doc:
https://docs.google.com/document/d/1QS7h2E6lVTf8F6eVoHJOX3KowufvbhLqgRFFzTSb-SU/edit#heading=h.3b4er6mf60f5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support ClusterAccessConfig on EKS Cluster
5 participants