Skip to content

Commit

Permalink
add support for _ in apiary_managed_schemas (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
rpoluri authored Apr 9, 2019
1 parent 52e40fc commit f3c3068
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
### Added
- Support for docker private registry.
- A new variable to specify TABLE_PARAM_FILTER regex for Hive Metastore listener.

- Support for `_` in `apiary_managed_schemas` variable. Fixes [#5] (https://github.com/ExpediaGroup/apiary/issues/5). Requires version greater than `v1.1.0` of https://github.com/ExpediaGroup/apiary-metastore-docker

## [1.0.5] - 2019-03-12

Expand Down
3 changes: 2 additions & 1 deletion common.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
locals {
instance_alias = "${ var.instance_name == "" ? "apiary" : format("apiary-%s",var.instance_name) }"
enable_route53_records = "${ var.apiary_domain_name == "" ? "0" : "1" }"
apiary_data_buckets = "${ formatlist("%s-%s-%s-%s",local.instance_alias,data.aws_caller_identity.current.account_id,var.aws_region,var.apiary_managed_schemas) }"
apiary_managed_schemas = "${ split(",",replace(join(",",var.apiary_managed_schemas),"_","-")) }"
apiary_data_buckets = "${ formatlist("%s-%s-%s-%s",local.instance_alias,data.aws_caller_identity.current.account_id,var.aws_region,local.apiary_managed_schemas) }"
gluedb_prefix = "${ var.instance_name == "" ? "" : "${var.instance_name}_" }"
}

Expand Down
4 changes: 2 additions & 2 deletions sns.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ POLICY

resource "aws_sns_topic" "apiary_data_events" {
count = "${ var.enable_data_events == "" ? 0 : length(var.apiary_managed_schemas) }"
name = "${local.instance_alias}-${var.apiary_managed_schemas[count.index]}-data-events"
name = "${local.instance_alias}-${local.apiary_managed_schemas[count.index]}-data-events"

policy = <<POLICY
{
Expand All @@ -38,7 +38,7 @@ resource "aws_sns_topic" "apiary_data_events" {
"Effect": "Allow",
"Principal": {"AWS":"*"},
"Action": "SNS:Publish",
"Resource": "arn:aws:sns:*:*:${local.instance_alias}-${var.apiary_managed_schemas[count.index]}-data-events",
"Resource": "arn:aws:sns:*:*:${local.instance_alias}-${local.apiary_managed_schemas[count.index]}-data-events",
"Condition":{
"ArnLike":{"aws:SourceArn":"${aws_s3_bucket.apiary_data_bucket.*.arn[count.index]}"}
}
Expand Down

0 comments on commit f3c3068

Please sign in to comment.