-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add table aws_app_runner_service Closes #2248
- Loading branch information
Showing
15 changed files
with
531 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[ | ||
{ | ||
"arn": "{{ output.resource_aka.value}}", | ||
"service_id": "{{ output.resource_id.value}}", | ||
"service_name": "{{ resourceName }}" | ||
} | ||
] |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
select arn, service_name, service_id | ||
from aws_app_runner_service | ||
where arn = '{{ output.resource_aka.value }}' |
7 changes: 7 additions & 0 deletions
7
aws-test/tests/aws_app_runner_service/test-list-expected.json
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[ | ||
{ | ||
"arn": "{{ output.resource_aka.value}}", | ||
"service_id": "{{ output.resource_id.value}}", | ||
"service_name": "{{ resourceName }}" | ||
} | ||
] |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
select arn, service_name, service_id | ||
from aws_app_runner_service | ||
where akas::text = '["{{ output.resource_aka.value }}"]' |
10 changes: 10 additions & 0 deletions
10
aws-test/tests/aws_app_runner_service/test-turbot-expected.json
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[ | ||
{ | ||
"account_id": "{{output.account_id.value}}", | ||
"akas": [ | ||
"{{ output.resource_aka.value }}" | ||
], | ||
"region": "{{output.aws_region.value}}", | ||
"title": "{{ resourceName }}" | ||
} | ||
] |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
select title, akas, region, account_id | ||
from aws_app_runner_service | ||
where arn = '{{ output.resource_aka.value }}' |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
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 |
---|---|---|
@@ -0,0 +1,87 @@ | ||
|
||
variable "resource_name" { | ||
type = string | ||
default = "turbot-test-20200125-create-update" | ||
description = "Name of the resource used throughout the test." | ||
} | ||
|
||
variable "aws_profile" { | ||
type = string | ||
default = "default" | ||
description = "AWS credentials profile used for the test. Default is to use the default profile." | ||
} | ||
|
||
variable "aws_region" { | ||
type = string | ||
default = "us-east-1" | ||
description = "AWS region used for the test. Does not work with default region in config, so must be defined here." | ||
} | ||
|
||
variable "aws_region_alternate" { | ||
type = string | ||
default = "us-east-2" | ||
description = "Alternate AWS region used for tests that require two regions (e.g. DynamoDB global tables)." | ||
} | ||
|
||
provider "aws" { | ||
profile = var.aws_profile | ||
region = var.aws_region | ||
} | ||
|
||
provider "aws" { | ||
alias = "alternate" | ||
profile = var.aws_profile | ||
region = var.aws_region_alternate | ||
} | ||
|
||
data "aws_partition" "current" {} | ||
data "aws_caller_identity" "current" {} | ||
data "aws_region" "primary" {} | ||
data "aws_region" "alternate" { | ||
provider = aws.alternate | ||
} | ||
|
||
data "null_data_source" "resource" { | ||
inputs = { | ||
scope = "arn:${data.aws_partition.current.partition}:::${data.aws_caller_identity.current.account_id}" | ||
} | ||
} | ||
|
||
resource "aws_apprunner_service" "named_test_resource" { | ||
service_name = var.resource_name | ||
|
||
source_configuration { | ||
image_repository { | ||
image_configuration { | ||
port = "8000" | ||
} | ||
image_identifier = "public.ecr.aws/aws-containers/hello-app-runner:latest" | ||
image_repository_type = "ECR_PUBLIC" | ||
} | ||
auto_deployments_enabled = false | ||
} | ||
|
||
tags = { | ||
Name = var.resource_name | ||
} | ||
} | ||
|
||
output "resource_aka" { | ||
value = aws_apprunner_service.named_test_resource.arn | ||
} | ||
|
||
output "resource_id" { | ||
value = aws_apprunner_service.named_test_resource.service_id | ||
} | ||
|
||
output "account_id" { | ||
value = data.aws_caller_identity.current.account_id | ||
} | ||
|
||
output "aws_region" { | ||
value = data.aws_region.primary.name | ||
} | ||
|
||
output "resource_name" { | ||
value = var.resource_name | ||
} |
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
Oops, something went wrong.