aws / aws/aws-cdk

Ec2.ClientVpnEndpoint: Tags do not get applied to the created client VPN endpoint

Open
#31,616 5 comments 0 reactions 0 assignees View on GitHub
@aws-cdk/aws-ec2 bug effort/small p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the bug

This is essentially a re-opening I believe of https://github.com/aws/aws-cdk/issues/18381.

I found this when using CDK to create a Client VPN endpoint. I used Tags.Of(endpoint).Add() - and the tag was added to the AWS:Logs:LogGroup that gets created, but not to the client VPN endpoint.

### Regression Issue

- [ ] Select this option if this issue appears to be a regression.

### Last Known Working CDK Version

_No response_

### Expected Behavior

The Client VPN Endpoint gets created with specified tag applied to it.

### Current Behavior

The CDK deploy succeeds, however, the Client VPN Endpoint does not have a tag. The LogGroup it creates automatically did get the tag - it is not clear to me if that is intended/desired or not.

### Reproduction Steps

C#

```
ClientVpnEndpoint endpoint = new ClientVpnEndpoint(this, name, new ClientVpnEndpointProps
{
AuthorizeAllUsersToVpcCidr = false,
Cidr = cidr,
ServerCertificateArn = certArn
UserBasedAuthentication = ClientVpnUserBasedAuthentication.Federated(samlProvider),
TransportProtocol = TransportProtocol.TCP,
Vpc = vpc,
Port = VpnPort.HTTPS,
SessionTimeout = ClientVpnSessionTimeout.TWELVE_HOURS,
SecurityGroups = new [] { securityGroup },
SplitTunnel = true,
VpcSubnets = new SubnetSelection{ Subnets = privateSubnets },
});

Amazon.CDK.Tags.Of(endpoint).Add("Name", name);
```

### Possible Solution

_No response_

### Additional Information/Context

Specifically, I was trying to apply a name to the Client VPN Endpoint. Based on the AWS console in the browser, this appears to occur not via a Name property on the endpoint, but through a tag named "Name". But as noted above, the loggroup picked up the tag, but not the endpoint. The endpoint displayed a blank value in the AWS console for the Name column.

Manually adding a "Name" tag to the endpoint through the browser filled in the Name column as desired.

### CDK CLI Version

2.160.0 (build 7a8ae02)

### Framework Version

_No response_

### Node.js Version

20.17.0

### OS

Windows 11

### Language

.NET

### Language Version

.NET 6.0

### Other information

_No response_

Contributor guide

Open the contributing guide

Research direction

Start at the ClientVpnEndpoint construct and its tag application path, using the C# reproduction in the issue as the entry point. Inspect the synthesized or deployed resource and compare it with the automatically created LogGroup. Done means Tags.Of(endpoint).Add("Name", name) applies the tag to the Client VPN endpoint as well as preserving the expected LogGroup behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, csharp, typescript
Domain
cloud, infrastructure
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.