Skip to content

Commit

Permalink
chore: Update resource naming convention
Browse files Browse the repository at this point in the history
  • Loading branch information
Drew Meyers committed Aug 8, 2024
1 parent 9fb03f3 commit 9040d92
Show file tree
Hide file tree
Showing 13 changed files with 41 additions and 59 deletions.
58 changes: 29 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,28 +177,28 @@ In this case, the router sees that the action is `submit_dag_by_id` and thus mak

## Contents

- [Features](#features)
- [Contents](#contents)
- [Quick Start](#quick-start)
- [Requirements](#requirements)
- [Setting Up the End-to-End Demo](#setting-up-the-end-to-end-demo)
- [Deploying the Initiator](#deploying-the-initiator)
- [Deploying an Example Evaluator (SNS topic-\>SQS queue-\>Lambda)](#deploying-an-example-evaluator-sns-topic-sqs-queue-lambda)
- [Deploying an S3 Event Notification Trigger](#deploying-an-s3-event-notification-trigger)
- [Verify End-to-End Functionality (part 1)](#verify-end-to-end-functionality-part-1)
- [Deploying an EventBridge Scheduler Trigger](#deploying-an-eventbridge-scheduler-trigger)
- [Verify End-to-End Functionality (part 2)](#verify-end-to-end-functionality-part-2)
- [Deploying an EventBridge Scheduler Trigger for Periodic CMR Queries](#deploying-an-eventbridge-scheduler-trigger-for-periodic-cmr-queries)
- [Verify End-to-End Functionality (part 3)](#verify-end-to-end-functionality-part-3)
- [Tear Down](#tear-down)
- [Setup Instructions for Development](#setup-instructions-for-development)
- [Build Instructions](#build-instructions)
- [Test Instructions](#test-instructions)
- [Changelog](#changelog)
- [Frequently Asked Questions (FAQ)](#frequently-asked-questions-faq)
- [Contributing](#contributing)
- [License](#license)
- [References](#references)
* [Features](#features)
* [Contents](#contents)
* [Quick Start](#quick-start)
* [Requirements](#requirements)
* [Setting Up the End-to-End Demo](#setting-up-the-end-to-end-demo)
* [Deploying the Initiator](#deploying-the-initiator)
* [Deploying an Example Evaluator (SNS topic-\>SQS queue-\>Lambda)](#deploying-an-example-evaluator-sns-topic-sqs-queue-lambda)
* [Deploying an S3 Event Notification Trigger](#deploying-an-s3-event-notification-trigger)
* [Verify End-to-End Functionality (part 1)](#verify-end-to-end-functionality-part-1)
* [Deploying an EventBridge Scheduler Trigger](#deploying-an-eventbridge-scheduler-trigger)
* [Verify End-to-End Functionality (part 2)](#verify-end-to-end-functionality-part-2)
* [Deploying an EventBridge Scheduler Trigger for Periodic CMR Queries](#deploying-an-eventbridge-scheduler-trigger-for-periodic-cmr-queries)
* [Verify End-to-End Functionality (part 3)](#verify-end-to-end-functionality-part-3)
* [Tear Down](#tear-down)
* [Setup Instructions for Development](#setup-instructions-for-development)
* [Build Instructions](#build-instructions)
* [Test Instructions](#test-instructions)
* [Changelog](#changelog)
* [Frequently Asked Questions (FAQ)](#frequently-asked-questions-faq)
* [Contributing](#contributing)
* [License](#license)
* [References](#references)

## Quick Start

Expand Down Expand Up @@ -253,10 +253,10 @@ This guide provides a quick way to get started with our project. Please see our
export CONFIG_BUCKET=<some S3 bucket name>
```

1. Set a deployment name:
1. Set a project name:

```
export DEPLOYMENT_NAME=gmanipon-test
export PROJECT=gmanipon-test
```

1. Initialize terraform:
Expand All @@ -269,7 +269,7 @@ This guide provides a quick way to get started with our project. Please see our

```
terraform apply \
--var deployment_name=${DEPLOYMENT_NAME} \
--var project=${PROJECT} \
--var code_bucket=${CODE_BUCKET} \
--var config_bucket=${CONFIG_BUCKET} \
--var router_config=test_router.yaml \
Expand Down Expand Up @@ -400,11 +400,11 @@ This guide provides a quick way to get started with our project. Please see our
terraform init
```

1. Run terraform apply. Note the DEPLOYMENT_NAME and INITIATOR_TOPIC_ARN environment variables should have been set in the previous steps. If not set them again:
1. Run terraform apply. Note the PROJECT and INITIATOR_TOPIC_ARN environment variables should have been set in the previous steps. If not set them again:

```
terraform apply \
--var deployment_name=${DEPLOYMENT_NAME} \
--var project=${PROJECT} \
--var initiator_topic_arn=${INITIATOR_TOPIC_ARN} \
-auto-approve
```
Expand Down Expand Up @@ -452,11 +452,11 @@ This guide provides a quick way to get started with our project. Please see our
terraform init
```

1. Run terraform apply. Note the DEPLOYMENT_NAME, CODE_BUCKET and INITIATOR_TOPIC_ARN environment variables should have been set in the previous steps. If not set them again:
1. Run terraform apply. Note the PROJECT, CODE_BUCKET and INITIATOR_TOPIC_ARN environment variables should have been set in the previous steps. If not set them again:

```
terraform apply \
--var deployment_name=${DEPLOYMENT_NAME} \
--var project=${PROJECT} \
--var code_bucket=${CODE_BUCKET} \
--var initiator_topic_arn=${INITIATOR_TOPIC_ARN} \
--var provider_id=${PROVIDER_ID} \
Expand Down
1 change: 0 additions & 1 deletion terraform-unity/initiator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ No modules.
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_code_bucket"></a> [code\_bucket](#input\_code\_bucket) | The S3 bucket where lambda zip files will be stored and accessed | `string` | n/a | yes |
| <a name="input_deployment_name"></a> [deployment\_name](#input\_deployment\_name) | The deployment name | `string` | n/a | yes |
| <a name="input_project"></a> [project](#input\_project) | The unity project its installed into | `string` | `"uod"` | no |
| <a name="input_router_config"></a> [router\_config](#input\_router\_config) | The S3 URL to the router configuration file | `string` | n/a | yes |
| <a name="input_venue"></a> [venue](#input\_venue) | The unity venue its installed into | `string` | `"dev"` | no |
Expand Down
2 changes: 1 addition & 1 deletion terraform-unity/initiator/locals.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
locals {
function_name = "${var.project}-${var.venue}-${var.deployment_name}-inititator"
function_name = "${var.project}-${var.venue}-inititator"
tags = {
Venue = "dev"
ServiceArea = "cs"
Expand Down
8 changes: 4 additions & 4 deletions terraform-unity/initiator/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ resource "aws_s3_object" "lambda_package" {

resource "aws_lambda_function" "initiator_lambda" {
depends_on = [aws_s3_object.lambda_package, aws_cloudwatch_log_group.initiator_lambda]
function_name = "${var.project}-${var.venue}-${var.deployment_name}-inititator"
function_name = "${var.project}-${var.venue}-inititator"
s3_bucket = var.code_bucket
s3_key = "unity_initiator-${jsondecode(data.local_file.version.content).version}-lambda.zip"
handler = "unity_initiator.cloud.lambda_handler.lambda_handler_initiator"
Expand All @@ -36,13 +36,13 @@ resource "aws_lambda_function" "initiator_lambda" {
}

resource "aws_cloudwatch_log_group" "initiator_lambda" {
name = "/aws/lambda/${var.project}-${var.venue}-${var.deployment_name}-inititator"
name = "/aws/lambda/${var.project}-${var.venue}-inititator"
retention_in_days = 14
tags = local.tags
}

resource "aws_iam_role" "initiator_lambda_iam_role" {
name = "${var.project}-${var.venue}-${var.deployment_name}-initiator_lambda_iam_role"
name = "${var.project}-${var.venue}-initiator_lambda_iam_role"

assume_role_policy = jsonencode({
Version = "2012-10-17",
Expand All @@ -61,7 +61,7 @@ resource "aws_iam_role" "initiator_lambda_iam_role" {
}

resource "aws_iam_policy" "initiator_lambda_policy" {
name = "${var.project}-${var.venue}-${var.deployment_name}-initiator_lambda_policy"
name = "${var.project}-${var.venue}-initiator_lambda_policy"
description = "A policy for the initiator lambda function to access S3 and SQS"

policy = jsonencode({
Expand Down
5 changes: 0 additions & 5 deletions terraform-unity/initiator/variables.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
variable "deployment_name" {
description = "The deployment name"
type = string
}

variable "project" {
description = "The unity project its installed into"
type = string
Expand Down
3 changes: 1 addition & 2 deletions terraform-unity/triggers/cmr_query/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | ~> 1.4.6 |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | ~> 1.8.2 |
| <a name="requirement_archive"></a> [archive](#requirement\_archive) | >=2.4.2 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >=5.50.0 |
| <a name="requirement_local"></a> [local](#requirement\_local) | >=2.5.1 |
Expand Down Expand Up @@ -52,7 +52,6 @@ No modules.
|------|-------------|------|---------|:--------:|
| <a name="input_code_bucket"></a> [code\_bucket](#input\_code\_bucket) | The S3 bucket where lambda zip files will be stored and accessed | `string` | n/a | yes |
| <a name="input_concept_id"></a> [concept\_id](#input\_concept\_id) | The concept ID for the data collection: https://cmr.earthdata.nasa.gov/search/site/docs/search/api.html#granule-search-by-parameters | `string` | n/a | yes |
| <a name="input_deployment_name"></a> [deployment\_name](#input\_deployment\_name) | The deployment name | `string` | n/a | yes |
| <a name="input_initiator_topic_arn"></a> [initiator\_topic\_arn](#input\_initiator\_topic\_arn) | The ARN of the initiator SNS topic to publish S3 events to | `string` | n/a | yes |
| <a name="input_project"></a> [project](#input\_project) | The unity project its installed into | `string` | `"uod"` | no |
| <a name="input_provider_id"></a> [provider\_id](#input\_provider\_id) | The short name for the data provider: https://cmr.earthdata.nasa.gov/search/site/docs/search/api.html#granule-search-by-parameters | `string` | n/a | yes |
Expand Down
2 changes: 1 addition & 1 deletion terraform-unity/triggers/cmr_query/locals.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
locals {
function_name = "${var.project}-${var.venue}-${var.deployment_name}-cmr_query"
function_name = "${var.project}-${var.venue}-cmr_query"
tags = {
Venue = "dev"
ServiceArea = "cs"
Expand Down
5 changes: 0 additions & 5 deletions terraform-unity/triggers/cmr_query/variables.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
variable "deployment_name" {
description = "The deployment name"
type = string
}

variable "project" {
description = "The unity project its installed into"
type = string
Expand Down
2 changes: 1 addition & 1 deletion terraform-unity/triggers/cmr_query/versions.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
terraform {
required_version = "~> 1.4.6"
required_version = "~> 1.8.2"

required_providers {
archive = {
Expand Down
1 change: 0 additions & 1 deletion terraform-unity/triggers/scheduled-task/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ No modules.

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_deployment_name"></a> [deployment\_name](#input\_deployment\_name) | The deployment name | `string` | n/a | yes |
| <a name="input_initiator_topic_arn"></a> [initiator\_topic\_arn](#input\_initiator\_topic\_arn) | The ARN of the initiator SNS topic to publish S3 events to | `string` | n/a | yes |
| <a name="input_project"></a> [project](#input\_project) | The unity project its installed into | `string` | `"uod"` | no |
| <a name="input_venue"></a> [venue](#input\_venue) | The unity venue its installed into | `string` | `"dev"` | no |
Expand Down
2 changes: 1 addition & 1 deletion terraform-unity/triggers/scheduled-task/locals.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
locals {
function_name = "${var.project}-${var.venue}-${var.deployment_name}-scheduled_task"
function_name = "${var.project}-${var.venue}-scheduled_task"
tags = {
Venue = "dev"
ServiceArea = "cs"
Expand Down
6 changes: 3 additions & 3 deletions terraform-unity/triggers/scheduled-task/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ resource "aws_cloudwatch_log_group" "scheduled_task_lambda_log_group" {
}

resource "aws_iam_role" "scheduler" {
name = "${var.project}-${var.venue}-${var.deployment_name}-cron-scheduler-role"
name = "${var.project}-${var.venue}-cron-scheduler-role"
assume_role_policy = jsonencode({
Version = "2012-10-17"
Statement = [
Expand All @@ -68,7 +68,7 @@ resource "aws_iam_role" "scheduler" {
}

resource "aws_iam_policy" "scheduler" {
name = "${var.project}-${var.venue}-${var.deployment_name}-cron-scheduler-policy"
name = "${var.project}-${var.venue}-cron-scheduler-policy"
policy = jsonencode({
Version = "2012-10-17"
Statement = [
Expand All @@ -90,7 +90,7 @@ resource "aws_iam_role_policy_attachment" "scheduler" {
}

resource "aws_scheduler_schedule" "run_scheduled_task" {
name = "${var.project}-${var.venue}-${var.deployment_name}-run_scheduled_task"
name = "${var.project}-${var.venue}-run_scheduled_task"
schedule_expression = "rate(1 minute)"
flexible_time_window {
mode = "OFF"
Expand Down
5 changes: 0 additions & 5 deletions terraform-unity/triggers/scheduled-task/variables.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
variable "deployment_name" {
description = "The deployment name"
type = string
}

variable "project" {
description = "The unity project its installed into"
type = string
Expand Down

0 comments on commit 9040d92

Please sign in to comment.