Skip to content

Conversation

Sliiiin
Copy link
Contributor

@Sliiiin Sliiiin commented Aug 29, 2025

Issue #, if available: #2824

Description of changes:

This pattern creates an Amazon Private API Gateway that is only accessible through VPC endpoints, with public custom domain name resolution for internal only access through an Amazon internal Application Load Balancer.

This architecture is intended for:

Internal APIs: APIs that should only be accessible from within your network
Client VPN Access: APIs accessible via AWS Client VPN connections
Hybrid Connectivity: APIs accessible from on-premises via VPN/Direct Connect
Public DNS Resolution: APIs that resolve publicly but are only accessible privately
This is a joint pattern by http://github.com/bquintas and https://github.com/Sliiiin

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@Sliiiin Sliiiin force-pushed the nilbrand-feature-private-apigw-public-custom-domain branch from c44c325 to be4bb6c Compare August 29, 2025 09:46
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this be removed?

This architecture is intended for:
- **Internal APIs**: APIs that should only be accessible from within your network
- **Hybrid Connectivity**: APIs accessible from on-premises via VPN/Direct Connect
- **Public DNS Resolution**: APIs that resolve publicly but are only accessible privately
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the use-case for this?

- **Hybrid Connectivity**: APIs accessible from on-premises via VPN/Direct Connect
- **Public DNS Resolution**: APIs that resolve publicly but are only accessible privately

Learn more about this pattern at Serverless Land Patterns: << Add the live URL here >>
Copy link
Contributor

Choose a reason for hiding this comment

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

Please replace with the actual url using your folder name

## Troubleshooting

### Certificate Issues
- Ensure certificate is in the same region as deployment
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
- Ensure certificate is in the same region as deployment
- Ensure certificate is in the same region


### Lambda Function Issues
- Check CloudWatch logs for the RegisterVPCEndpointTargets function
- Verify IAM permissions for EC2 and ELB operations
Copy link
Contributor

Choose a reason for hiding this comment

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

what exactly is necessary here?

Comment on lines +39 to +41
2. **AWS CDK**: Installed and AWS Account bootstrapped
3. **ACM Certificate**: Valid certificate for your domain in the deployment region
4. **AWS CLI**: Configured with appropriate permissions
Copy link
Contributor

Choose a reason for hiding this comment

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

Add relevant links to the documentation. Compare to other submissions for style guide


#### Outputs

The stack provides these outputs:
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these all necessary?

"elasticloadbalancing:DeregisterTargets",
"elasticloadbalancing:DescribeTargetHealth"
],
resources=["*"]
Copy link
Contributor

Choose a reason for hiding this comment

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

can this be restricted to the current account and region?

# Lambda function to register VPC endpoint IPs as targets
register_targets_function = _lambda.Function(
self, "RegisterVPCEndpointTargets",
runtime=_lambda.Runtime.PYTHON_3_9,
Copy link
Contributor

Choose a reason for hiding this comment

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

Use the most up-to-date version

## Security Features

- API only accessible through VPC endpoint
- Security groups restrict access to VPC and Client VPN ranges
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't the ALB Security group allowing traffic from anywhere?

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.

4 participants