Skip to content

Commit

Permalink
Merge pull request #48 from Ontotext-AD/GDB-10293/Change-AMI-Owner-ID…
Browse files Browse the repository at this point in the history
…-and-add-functionality-to-specify-custom-owner-ID

[GDB-10293] Added support for custom owner ID for the AMIs and added new default owner ID
  • Loading branch information
simeonzhekofff authored May 27, 2024
2 parents a6e5099 + 0940bff commit fc1ed6f
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ Before you begin using this Terraform module, ensure you meet the following prer
| common\_tags | (Optional) Map of common tags for all taggable AWS resources. | `map(string)` | `{}` | no |
| resource\_name\_prefix | Resource name prefix used for tagging and naming AWS resources | `string` | n/a | yes |
| aws\_region | AWS region to deploy resources into | `string` | n/a | yes |
| override\_owner\_id | Override the default owner ID used for the AMI images | `string` | `null` | no |
| deploy\_backup | Deploy backup module | `bool` | `true` | no |
| backup\_schedule | Cron expression for the backup job. | `string` | `"0 0 * * *"` | no |
| backup\_retention\_count | Number of backups to keep. | `number` | `7` | no |
Expand Down
5 changes: 3 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,9 @@ module "graphdb" {

# VM Image

ami_id = var.ami_id
graphdb_version = var.graphdb_version
ami_id = var.ami_id
graphdb_version = var.graphdb_version
override_owner_id = var.override_owner_id

# Managed Disks

Expand Down
2 changes: 1 addition & 1 deletion modules/graphdb/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ data "aws_caller_identity" "current" {}
data "aws_ami" "graphdb" {
count = var.ami_id != null ? 0 : 1

owners = ["770034820396"] # Ontotext
owners = var.override_owner_id != null ? [var.override_owner_id] : ["679593333241"]
most_recent = true

filter {
Expand Down
5 changes: 5 additions & 0 deletions modules/graphdb/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ variable "aws_subscription_id" {
type = string
}

variable "override_owner_id" {
description = "Override the default owner ID used for the AMI images"
type = string
}

# GraphDB Parameters

variable "graphdb_admin_password" {
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ variable "aws_region" {
type = string
}

variable "override_owner_id" {
description = "Override the default owner ID used for the AMI images"
type = string
default = null
}

# Backup configurations
variable "deploy_backup" {
description = "Deploy backup module"
Expand Down

0 comments on commit fc1ed6f

Please sign in to comment.