-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from givanovexpe/fixes
Minor fixes
- Loading branch information
Showing
4 changed files
with
113 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,12 +11,11 @@ For more information please refer to the main [Apiary](https://github.com/Expedi | |
| instance\_name | Privileges Grantor instance name to identify resources in multi-instance deployments. | string | `""` | no | | ||
| lambda\_timeout | The time after which the lambda execution stops. | string | `"200"` | no | | ||
| memory | The amount of memory (in MiB) to be used by Lambda | string | `"512"` | no | | ||
| metastore\_events\_filter | List of metastore event types to be added to SNS filter. Supported format: `<<EOD "CREATE_TABLE","ALTER_TABLE" EOD` | string | `"\"CREATE_TABLE\",\"ALTER_TABLE\""` | no | | ||
| database\_filter | List of database names to be added to SNS filter. Supported format: `<<EOD \"DB_NAME_1\",\"DB_NAME_2\" EOD` | string | n/a | yes | | ||
| metastore\_events\_filter | List of metastore event types to be added to SNS filter. Supported format: `[ "CREATE_TABLE","ALTER_TABLE" ]` | list | `[ "CREATE_TABLE", "ALTER_TABLE" ]` | no | | ||
| database\_filter | List of database names to be added to SNS filter. Supported format: `[ "DB_NAME_1", "DB_NAME_2" ]` | list | n/a | yes | | ||
| metastore\_events\_sns\_topic | SNS Topic for Hive Metastore events. | string | n/a | yes | | ||
| pg\_jars\_s3\_key | S3 key where zip file is located. | string | n/a | yes | | ||
| pg\_lambda\_bucket | Bucket where the Lambda zip can be found, for example 'bucket_name'. Used together with `pg_jars_s3_key`. | string | n/a | yes | | ||
| pg\_lambda\_version | Version of the Privileges Grantor Lambda. | string | n/a | yes | | ||
| pg\_lambda\_s3\_key | S3 key where privilege grantor lambda jar/zip file is located. | string | n/a | yes | | ||
| pg\_lambda\_bucket | Bucket where the privilege grantor lambda jar/zip can be found, for example 'bucket\_name'. Used together with `pg_lambda_s3_key` to construct the full S3 path. | string | n/a | yes | | ||
| pg\_metastore\_uri | Thrift URI of the metastore to which Lambda will connect to. | string | n/a | yes | | ||
| security\_groups | Security groups in which Lambda will have access to. | list | n/a | yes | | ||
| subnets | Subnets in which Lambda will have access to. | list | n/a | yes | | ||
|
@@ -29,11 +28,10 @@ Example module invocation: | |
module "apiary-privileges-grantor" { | ||
source = "[email protected]:ExpediaGroup/apiary-extensions-terraform.git/privileges-grantor" | ||
pg_lambda_bucket = "pg-s3-bucket" | ||
pg_jars_s3_key = "pg-s3-key" | ||
pg_lambda_version = "4.1.0" | ||
pg_lambda_s3_key = "pg-s3-key" | ||
pg_metastore_uri = "thrift://ip-address:9083" | ||
metastore_events_sns_topic = "arn:aws:sns:us-west-2:1234567:metastore-events-sns-topic" | ||
database_filter = "\"db_1\",\"db_2\"" | ||
database_filter = [ "db_1", "db_2" ] | ||
subnets = ["subnet-1", "subnet-2"] | ||
security_groups = ["security-group-1", "security-group-2"] | ||
tags = { | ||
|
@@ -44,6 +42,54 @@ module "apiary-privileges-grantor" { | |
``` | ||
|
||
The apiary-privileges-grantor lambda can be found in the public [maven repository](https://mvnrepository.com/artifact/com.expediagroup.apiary/apiary-privileges-grantor-lambda). | ||
The jars can be downloaded from the link provided above and uploaded to S3 via terraform as follows: | ||
|
||
``` | ||
variable "pg_lambda_version" { | ||
description = "Version of the Privilege Grantor Lambda." | ||
type = "string" | ||
default = "4.2.0" | ||
} | ||
data "aws_s3_bucket" "apiary-extensions" { | ||
bucket = "pg-s3-bucket" | ||
} | ||
resource "null_resource" "apiary-privileges-grantor-jar" { | ||
depends_on = ["data.aws_s3_bucket.apiary_extensions"] | ||
provisioner "local-exec" { | ||
command = <<CMD | ||
curl -sLo apiary-privileges-grantor-core-${var.pg_lambda_version}.jar https://repo1.maven.org/maven2/com/expediagroup/apiary/apiary-privileges-grantor-core/${var.pg_lambda_version}/apiary-privileges-grantor-core-${var.pg_lambda_version}.jar | ||
CMD | ||
} | ||
} | ||
resource "aws_s3_bucket_object" "apiary-privileges-grantor-jar" { | ||
depends_on = ["null_resource.apiary-privileges-grantor-jar"] | ||
bucket = "${data.aws_s3_bucket.apiary_extensions.id}" | ||
key = "apiary-privileges-grantor-lambda-${var.pg_lambda_version}.jar" | ||
source = "apiary-privileges-grantor-core-${var.pg_lambda_version}.jar" | ||
} | ||
module "apiary-privileges-grantor" { | ||
source = "[email protected]:ExpediaGroup/apiary-extensions-terraform.git/privileges-grantor" | ||
pg_lambda_bucket = "${data.aws_s3_bucket.apiary-extensions.id}" | ||
pg_lambda_s3_key = "${aws_s3_bucket_object.apiary-privileges-grantor-jar.id}" | ||
pg_metastore_uri = "thrift://ip-address:9083" | ||
metastore_events_sns_topic = "arn:aws:sns:us-west-2:1234567:metastore-events-sns-topic" | ||
database_filter = [ "db_1", "db_2" ] | ||
subnets = ["subnet-1", "subnet-2"] | ||
security_groups = ["security-group-1", "security-group-2"] | ||
tags = { | ||
Name = "Apiary-Privileges-Grantor" | ||
Team = "Operations" | ||
} | ||
} | ||
``` | ||
|
||
# Contact | ||
|
||
## Mailing List | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters