-
Notifications
You must be signed in to change notification settings - Fork 999
New serverless pattern - private-apigw-public-custom-domain added #2828
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
base: main
Are you sure you want to change the base?
New serverless pattern - private-apigw-public-custom-domain added #2828
Conversation
c44c325
to
be4bb6c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed.
- **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 >> |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replaced.
## Troubleshooting | ||
|
||
### Certificate Issues | ||
- Ensure certificate is in the same region as deployment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Ensure certificate is in the same region as deployment | |
- Ensure certificate is in the same region |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed.
|
||
### Lambda Function Issues | ||
- Check CloudWatch logs for the RegisterVPCEndpointTargets function | ||
- Verify IAM permissions for EC2 and ELB operations |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Links added.
|
||
#### Outputs | ||
|
||
The stack provides these outputs: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these all necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only necessary output remaining.
"elasticloadbalancing:DeregisterTargets", | ||
"elasticloadbalancing:DescribeTargetHealth" | ||
], | ||
resources=["*"] |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
condition for region added.
# Lambda function to register VPC endpoint IPs as targets | ||
register_targets_function = _lambda.Function( | ||
self, "RegisterVPCEndpointTargets", | ||
runtime=_lambda.Runtime.PYTHON_3_9, |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed to PYTHON_3_13
## Security Features | ||
|
||
- API only accessible through VPC endpoint | ||
- Security groups restrict access to VPC and Client VPN ranges |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is an internal load balancer: internet_facing=False, this would need to be adapted by users for more fine grained access when VPN is set up.
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.