Skip to content

Commit

Permalink
feat: adding account name var, bumping provider version (#11)
Browse files Browse the repository at this point in the history
Co-authored-by: Werner Matias Kahnlein <[email protected]>
  • Loading branch information
werner-nops and Wernerkahnlein authored Nov 25, 2024
1 parent c02ba30 commit f9ec421
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 8 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ Then check that the credentials being used to deployed are correct. If they are,
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.0 |
| <a name="requirement_http"></a> [http](#requirement\_http) | ~> 3.0 |
| <a name="requirement_nops"></a> [nops](#requirement\_nops) | 0.0.5 |
| <a name="requirement_nops"></a> [nops](#requirement\_nops) | 0.0.6 |
| <a name="requirement_null"></a> [null](#requirement\_null) | 3.2.3 |
| <a name="requirement_time"></a> [time](#requirement\_time) | ~> 0.7 |

Expand All @@ -195,7 +195,7 @@ Then check that the credentials being used to deployed are correct. If they are,
| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.0 |
| <a name="provider_nops"></a> [nops](#provider\_nops) | 0.0.5 |
| <a name="provider_nops"></a> [nops](#provider\_nops) | 0.0.6 |
| <a name="provider_time"></a> [time](#provider\_time) | ~> 0.7 |

## Modules
Expand All @@ -218,19 +218,20 @@ No modules.
| [aws_s3_bucket_policy.nops_bucket_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_policy) | resource |
| [aws_s3_bucket_public_access_block.nops_bucket_block_public_access](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_public_access_block) | resource |
| [aws_s3_bucket_server_side_encryption_configuration.nops_bucket_encryption](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_server_side_encryption_configuration) | resource |
| [nops_integration.integration](https://registry.terraform.io/providers/nops-io/nops/0.0.5/docs/resources/integration) | resource |
| [nops_project.project](https://registry.terraform.io/providers/nops-io/nops/0.0.5/docs/resources/project) | resource |
| [nops_integration.integration](https://registry.terraform.io/providers/nops-io/nops/0.0.6/docs/resources/integration) | resource |
| [nops_project.project](https://registry.terraform.io/providers/nops-io/nops/0.0.6/docs/resources/project) | resource |
| [time_sleep.wait_for_resources](https://registry.terraform.io/providers/hashicorp/time/latest/docs/resources/sleep) | resource |
| [aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) | data source |
| [aws_iam_policy.iam_readonly_access](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy) | data source |
| [aws_organizations_organization.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/organizations_organization) | data source |
| [nops_projects.current](https://registry.terraform.io/providers/nops-io/nops/0.0.5/docs/data-sources/projects) | data source |
| [nops_projects.current](https://registry.terraform.io/providers/nops-io/nops/0.0.6/docs/data-sources/projects) | data source |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_api_key"></a> [api\_key](#input\_api\_key) | [DEPRECATED] The nOps API key, can be supplied as an env var NOPS\_API\_KEY or in the provider call in your configuration. | `string` | `""` | no |
| <a name="input_cloud_account_name"></a> [cloud\_account\_name](#input\_cloud\_account\_name) | If true, IAM policies with the min base permissions for nOps to get cost and usage data will be created. Some platform features will not be available. | `string` | `""` | no |
| <a name="input_min_required_permissions"></a> [min\_required\_permissions](#input\_min\_required\_permissions) | If true, IAM policies with the min base permissions for nOps to get cost and usage data will be created. Some platform features will not be available. | `bool` | `false` | no |
| <a name="input_reconfigure"></a> [reconfigure](#input\_reconfigure) | [DEPRECATED] If true, allows overriding existing project settings. If false, stops execution if project already exists. | `bool` | `false` | no |
| <a name="input_system_bucket_name"></a> [system\_bucket\_name](#input\_system\_bucket\_name) | [DEPRECATED] The name of the system bucket for nOps integration. | `string` | `"na"` | no |
Expand Down
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
resource "nops_project" "project" {
name = "AWS Account ${data.aws_caller_identity.current.account_id}"
name = var.cloud_account_name == "" ? "AWS Account ${data.aws_caller_identity.current.account_id}" : var.cloud_account_name
account_number = data.aws_caller_identity.current.account_id
master_payer_account_number = data.aws_organizations_organization.current.master_account_id
}
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,9 @@ variable "reconfigure" {
default = false
description = "[DEPRECATED] If true, allows overriding existing project settings. If false, stops execution if project already exists."
}

variable "cloud_account_name" {
type = string
default = ""
description = "If true, IAM policies with the min base permissions for nOps to get cost and usage data will be created. Some platform features will not be available."
}
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ terraform {
}
nops = {
source = "nops-io/nops"
version = "0.0.5"
version = "0.0.6"
}
}
}
1 change: 1 addition & 0 deletions wrappers/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module "wrapper" {
for_each = var.items

api_key = try(each.value.api_key, var.defaults.api_key, "")
cloud_account_name = try(each.value.cloud_account_name, var.defaults.cloud_account_name, "")
min_required_permissions = try(each.value.min_required_permissions, var.defaults.min_required_permissions, false)
reconfigure = try(each.value.reconfigure, var.defaults.reconfigure, false)
system_bucket_name = try(each.value.system_bucket_name, var.defaults.system_bucket_name, "na")
Expand Down
2 changes: 1 addition & 1 deletion wrappers/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ terraform {
}
nops = {
source = "nops-io/nops"
version = "0.0.5"
version = "0.0.6"
}
}
}

0 comments on commit f9ec421

Please sign in to comment.