Skip to content

Commit

Permalink
[DOM-63640] Glue using vpc endpoint dns (#311)
Browse files Browse the repository at this point in the history
* Glue using vpc endpoint dns

* fix template parameter
  • Loading branch information
ldebello-ddl authored Dec 18, 2024
1 parent 94b8a43 commit d408da1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 1 addition & 3 deletions modules/infra/submodules/cost-usage-report/glue.tf
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,4 @@ resource "aws_vpc_endpoint" "aws_glue_vpc_endpoint" {
tags = {
"Name" = "${var.deploy_id}-glue"
}

private_dns_enabled = true
}
}
2 changes: 2 additions & 0 deletions modules/infra/submodules/cost-usage-report/lambda.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ data "archive_file" "cur_initializer_zip" {
source {
content = templatefile("${local.templates_dir}/${local.aws_cur_initializer_template}", {
cur_crawler = local.cur_crawler
glue_dns = aws_vpc_endpoint.aws_glue_vpc_endpoint.dns_entry[0].dns_name
glue_region = var.region
})
filename = local.index_filename
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ exports.handler = function(event, context, callback) {
if (event.RequestType === 'Delete') {
response.send(event, context, response.SUCCESS);
} else {
const glue = new AWS.Glue();
const glue = new AWS.Glue({
'endpoint': 'https://${glue_dns}',
'region': '${glue_region}'
});
glue.startCrawler({ Name: '${cur_crawler}' }, function(err, data) {
if (err) {
const responseData = JSON.parse(this.httpResponse.body);
Expand Down

0 comments on commit d408da1

Please sign in to comment.