Skip to content

Commit

Permalink
Merge pull request #105 from lbrlabs/network_config
Browse files Browse the repository at this point in the history
feat(ClusterArgs): add ability to configure Amazon EKS API server endpoints
  • Loading branch information
jaxxstorm authored Mar 19, 2024
2 parents 7e5c7e5 + 6c0e3a5 commit 80cbb50
Show file tree
Hide file tree
Showing 11 changed files with 162 additions and 50 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
- dotnet
- go
nodeversion:
- 14.x
- 20.x
pythonversion:
- "3.7"
prerequisites:
Expand Down Expand Up @@ -155,7 +155,7 @@ jobs:
goversion:
- 1.21.x
nodeversion:
- 14.x
- 20.x
pythonversion:
- "3.7"
publish:
Expand Down Expand Up @@ -198,7 +198,7 @@ jobs:
goversion:
- 1.21.x
nodeversion:
- 14.x
- 20.x
pythonversion:
- "3.7"
publish_sdk:
Expand Down Expand Up @@ -273,7 +273,7 @@ jobs:
goversion:
- 1.21.x
nodeversion:
- 14.x
- 20.x
pythonversion:
- "3.7"
test:
Expand Down Expand Up @@ -355,7 +355,7 @@ jobs:
- dotnet
- go
nodeversion:
- 14.x
- 20.x
pythonversion:
- "3.7"
name: main
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
- dotnet
- go
nodeversion:
- 14.x
- 20.x
pythonversion:
- "3.7"
prerequisites:
Expand Down Expand Up @@ -156,7 +156,7 @@ jobs:
goversion:
- 1.21.x
nodeversion:
- 14.x
- 20.x
pythonversion:
- "3.7"
publish:
Expand Down Expand Up @@ -199,7 +199,7 @@ jobs:
goversion:
- 1.21.x
nodeversion:
- 14.x
- 20.x
pythonversion:
- "3.7"
publish_sdk:
Expand Down Expand Up @@ -274,7 +274,7 @@ jobs:
goversion:
- 1.21.x
nodeversion:
- 14.x
- 20.x
pythonversion:
- "3.7"
test:
Expand Down Expand Up @@ -356,7 +356,7 @@ jobs:
- dotnet
- go
nodeversion:
- 14.x
- 20.x
pythonversion:
- "3.7"
name: prerelease
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
- dotnet
- go
nodeversion:
- 14.x
- 20.x
pythonversion:
- "3.7"
prerequisites:
Expand Down Expand Up @@ -155,7 +155,7 @@ jobs:
goversion:
- 1.21.x
nodeversion:
- 14.x
- 20.x
pythonversion:
- "3.7"
publish:
Expand Down Expand Up @@ -198,7 +198,7 @@ jobs:
goversion:
- 1.21.x
nodeversion:
- 14.x
- 20.x
pythonversion:
- "3.7"
publish_sdk:
Expand Down Expand Up @@ -273,7 +273,7 @@ jobs:
goversion:
- 1.21.x
nodeversion:
- 14.x
- 20.x
pythonversion:
- "3.7"
test:
Expand Down Expand Up @@ -355,7 +355,7 @@ jobs:
- dotnet
- go
nodeversion:
- 14.x
- 20.x
pythonversion:
- "3.7"
name: release
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/run-acceptance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ jobs:
- dotnet
- go
nodeversion:
- 14.x
- 20.x
pythonversion:
- "3.7"
comment-notification:
Expand Down Expand Up @@ -181,7 +181,7 @@ jobs:
goversion:
- 1.21.x
nodeversion:
- 14.x
- 20.x
pythonversion:
- "3.7"
test:
Expand Down Expand Up @@ -267,7 +267,7 @@ jobs:
- dotnet
- go
nodeversion:
- 14.x
- 20.x
pythonversion:
- "3.7"
name: run-acceptance-tests
Expand Down
52 changes: 28 additions & 24 deletions provider/pkg/provider/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,29 +26,31 @@ import (

// The set of arguments for creating a Cluster component resource.
type ClusterArgs struct {
ClusterSubnetIds pulumi.StringArrayInput `pulumi:"clusterSubnetIds"`
SystemNodeSubnetIds pulumi.StringArrayInput `pulumi:"systemNodeSubnetIds"`
SystemNodeInstanceTypes *pulumi.StringArrayInput `pulumi:"systemNodeInstanceTypes"`
SystemNodeMaxCount *pulumi.IntInput `pulumi:"systemNodeMaxCount"`
SystemNodeMinCount *pulumi.IntInput `pulumi:"systemNodeMinCount"`
SystemNodeDesiredCount *pulumi.IntInput `pulumi:"systemNodeDesiredCount"`
ClusterVersion pulumi.StringPtrInput `pulumi:"clusterVersion"`
EnableOtel bool `pulumi:"enableOtel"`
EnableCloudWatchAgent bool `pulumi:"enableCloudWatchAgent"`
EnableExternalDNS bool `pulumi:"enableExternalDns"`
EnableCertManager bool `pulumi:"enableCertManager"`
EnableKarpenter bool `pulumi:"enableKarpenter"`
LetsEncryptEmail string `pulumi:"letsEncryptEmail"`
EnableInternalIngress bool `pulumi:"enableInternalIngress"`
EnableExternalIngress bool `pulumi:"enableExternalIngress"`
LbType pulumi.StringInput `pulumi:"lbType"`
CertificateArn *pulumi.StringInput `pulumi:"certificateArn"`
Tags *pulumi.StringMapInput `pulumi:"tags"`
NginxIngressVersion pulumi.StringInput `pulumi:"nginxIngressVersion"`
EksIamAuthControllerVersion pulumi.StringInput `pulumi:"eksIamAuthControllerVersion"`
ExternalDNSVersion pulumi.StringInput `pulumi:"externalDNSVersion"`
CertManagerVersion pulumi.StringInput `pulumi:"certManagerVersion"`
EnabledClusterLogTypes *pulumi.StringArrayInput `pulumi:"enabledClusterLogTypes"`
ClusterSubnetIds pulumi.StringArrayInput `pulumi:"clusterSubnetIds"`
ClusterEndpointPublicAccess pulumi.BoolInput `pulumi:"clusterEndpointPublicAccess"`
ClusterEndpointPrivateAccess pulumi.BoolInput `pulumi:"clusterEndpointPrivateAccess"`
SystemNodeSubnetIds pulumi.StringArrayInput `pulumi:"systemNodeSubnetIds"`
SystemNodeInstanceTypes *pulumi.StringArrayInput `pulumi:"systemNodeInstanceTypes"`
SystemNodeMaxCount *pulumi.IntInput `pulumi:"systemNodeMaxCount"`
SystemNodeMinCount *pulumi.IntInput `pulumi:"systemNodeMinCount"`
SystemNodeDesiredCount *pulumi.IntInput `pulumi:"systemNodeDesiredCount"`
ClusterVersion pulumi.StringPtrInput `pulumi:"clusterVersion"`
EnableOtel bool `pulumi:"enableOtel"`
EnableCloudWatchAgent bool `pulumi:"enableCloudWatchAgent"`
EnableExternalDNS bool `pulumi:"enableExternalDns"`
EnableCertManager bool `pulumi:"enableCertManager"`
EnableKarpenter bool `pulumi:"enableKarpenter"`
LetsEncryptEmail string `pulumi:"letsEncryptEmail"`
EnableInternalIngress bool `pulumi:"enableInternalIngress"`
EnableExternalIngress bool `pulumi:"enableExternalIngress"`
LbType pulumi.StringInput `pulumi:"lbType"`
CertificateArn *pulumi.StringInput `pulumi:"certificateArn"`
Tags *pulumi.StringMapInput `pulumi:"tags"`
NginxIngressVersion pulumi.StringInput `pulumi:"nginxIngressVersion"`
EksIamAuthControllerVersion pulumi.StringInput `pulumi:"eksIamAuthControllerVersion"`
ExternalDNSVersion pulumi.StringInput `pulumi:"externalDNSVersion"`
CertManagerVersion pulumi.StringInput `pulumi:"certManagerVersion"`
EnabledClusterLogTypes *pulumi.StringArrayInput `pulumi:"enabledClusterLogTypes"`
}

// The Cluster component resource.
Expand Down Expand Up @@ -215,7 +217,9 @@ func NewCluster(ctx *pulumi.Context,
RoleArn: role.Arn,
Version: args.ClusterVersion,
VpcConfig: &eks.ClusterVpcConfigArgs{
SubnetIds: args.ClusterSubnetIds,
SubnetIds: args.ClusterSubnetIds,
EndpointPublicAccess: args.ClusterEndpointPublicAccess,
EndpointPrivateAccess: args.ClusterEndpointPrivateAccess,
},
EncryptionConfig: &eks.ClusterEncryptionConfigArgs{
Resources: pulumi.StringArray{
Expand Down
8 changes: 8 additions & 0 deletions schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ resources:
clusterVersion:
type: string
description: The version of the EKS cluster to create.
clusterEndpointPrivateAccess:
type: boolean
description: Indicates whether or not the Amazon EKS private API server endpoint is enabled.
default: false
clusterEndpointPublicAccess:
type: boolean
description: Indicates whether or not the Amazon EKS public API server endpoint is enabled.
default: true
letsEncryptEmail:
type: string
description: The email address to use to issue certificates from Lets Encrypt.
Expand Down
14 changes: 14 additions & 0 deletions sdk/dotnet/Eks/Cluster.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,18 @@ public sealed class ClusterArgs : global::Pulumi.ResourceArgs
[Input("certificateArn")]
public Input<string>? CertificateArn { get; set; }

/// <summary>
/// Indicates whether or not the Amazon EKS private API server endpoint is enabled.
/// </summary>
[Input("clusterEndpointPrivateAccess")]
public Input<bool>? ClusterEndpointPrivateAccess { get; set; }

/// <summary>
/// Indicates whether or not the Amazon EKS public API server endpoint is enabled.
/// </summary>
[Input("clusterEndpointPublicAccess")]
public Input<bool>? ClusterEndpointPublicAccess { get; set; }

[Input("clusterSubnetIds", required: true)]
private InputList<string>? _clusterSubnetIds;
public InputList<string> ClusterSubnetIds
Expand Down Expand Up @@ -232,6 +244,8 @@ public InputMap<string> Tags

public ClusterArgs()
{
ClusterEndpointPrivateAccess = false;
ClusterEndpointPublicAccess = true;
EnableCertManager = true;
EnableCloudWatchAgent = false;
EnableExternalDns = true;
Expand Down
22 changes: 18 additions & 4 deletions sdk/go/eks/cluster.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 18 additions & 4 deletions sdk/go/eks/x/cluster.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions sdk/nodejs/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ export class Cluster extends pulumi.ComponentResource {
}
resourceInputs["certManagerVersion"] = args ? args.certManagerVersion : undefined;
resourceInputs["certificateArn"] = args ? args.certificateArn : undefined;
resourceInputs["clusterEndpointPrivateAccess"] = (args ? args.clusterEndpointPrivateAccess : undefined) ?? false;
resourceInputs["clusterEndpointPublicAccess"] = (args ? args.clusterEndpointPublicAccess : undefined) ?? true;
resourceInputs["clusterSubnetIds"] = args ? args.clusterSubnetIds : undefined;
resourceInputs["clusterVersion"] = args ? args.clusterVersion : undefined;
resourceInputs["eksIamAuthControllerVersion"] = args ? args.eksIamAuthControllerVersion : undefined;
Expand Down Expand Up @@ -117,6 +119,14 @@ export interface ClusterArgs {
* The ARN of the certificate to use for the ingress controller.
*/
certificateArn?: pulumi.Input<string>;
/**
* Indicates whether or not the Amazon EKS private API server endpoint is enabled.
*/
clusterEndpointPrivateAccess?: pulumi.Input<boolean>;
/**
* Indicates whether or not the Amazon EKS public API server endpoint is enabled.
*/
clusterEndpointPublicAccess?: pulumi.Input<boolean>;
clusterSubnetIds: pulumi.Input<pulumi.Input<string>[]>;
/**
* The version of the EKS cluster to create.
Expand Down
Loading

0 comments on commit 80cbb50

Please sign in to comment.