Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: terraform-aws-modules/terraform-aws-kms
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.0.1
Choose a base ref
...
head repository: terraform-aws-modules/terraform-aws-kms
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v2.1.0
Choose a head ref
  • 2 commits
  • 3 files changed
  • 2 contributors

Commits on Nov 3, 2023

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    4951c38 View commit details
  2. chore(release): version 2.1.0 [skip ci]

    ## [2.1.0](v2.0.1...v2.1.0) (2023-11-03)
    
    ### Features
    
    * Do not call data resources when `create` is `false` ([#25](#25)) ([4951c38](4951c38))
    semantic-release-bot committed Nov 3, 2023
    Copy the full SHA
    5508c9c View commit details
Showing with 26 additions and 9 deletions.
  1. +2 −2 .pre-commit-config.yaml
  2. +7 −0 CHANGELOG.md
  3. +17 −7 main.tf
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.77.1
rev: v1.83.5
hooks:
- id: terraform_fmt
- id: terraform_validate
@@ -23,7 +23,7 @@ repos:
- '--args=--only=terraform_standard_module_structure'
- '--args=--only=terraform_workspace_remote'
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-merge-conflict
- id: end-of-file-fixer
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,13 @@

All notable changes to this project will be documented in this file.

## [2.1.0](https://github.com/terraform-aws-modules/terraform-aws-kms/compare/v2.0.1...v2.1.0) (2023-11-03)


### Features

* Do not call data resources when `create` is `false` ([#25](https://github.com/terraform-aws-modules/terraform-aws-kms/issues/25)) ([4951c38](https://github.com/terraform-aws-modules/terraform-aws-kms/commit/4951c38f3cd569411eb53476ac8502981083f5d2))

### [2.0.1](https://github.com/terraform-aws-modules/terraform-aws-kms/compare/v2.0.0...v2.0.1) (2023-09-18)


24 changes: 17 additions & 7 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
data "aws_partition" "current" {}
data "aws_caller_identity" "current" {}
data "aws_partition" "current" {
count = var.create ? 1 : 0
}
data "aws_caller_identity" "current" {
count = var.create ? 1 : 0
}

locals {
account_id = try(data.aws_caller_identity.current[0].account_id, "")
partition = try(data.aws_partition.current[0].partition, "")
dns_suffix = try(data.aws_partition.current[0].dns_suffix, "")
}

################################################################################
# Key
@@ -98,7 +108,7 @@ data "aws_iam_policy_document" "this" {

principals {
type = "AWS"
identifiers = ["arn:${data.aws_partition.current.partition}:iam::${data.aws_caller_identity.current.account_id}:root"]
identifiers = ["arn:${local.partition}:iam::${local.account_id}:root"]
}
}
}
@@ -342,7 +352,7 @@ data "aws_iam_policy_document" "this" {

principals {
type = "Service"
identifiers = ["dnssec-route53.${data.aws_partition.current.dns_suffix}"]
identifiers = ["dnssec-route53.${local.dns_suffix}"]
}
}
}
@@ -358,7 +368,7 @@ data "aws_iam_policy_document" "this" {

principals {
type = "Service"
identifiers = ["dnssec-route53.${data.aws_partition.current.dns_suffix}"]
identifiers = ["dnssec-route53.${local.dns_suffix}"]
}

condition {
@@ -373,7 +383,7 @@ data "aws_iam_policy_document" "this" {
content {
test = "StringEquals"
variable = "aws:SourceAccount"
values = try(condition.value.account_ids, [data.aws_caller_identity.current.account_id])
values = try(condition.value.account_ids, [local.account_id])
}
}

@@ -383,7 +393,7 @@ data "aws_iam_policy_document" "this" {
content {
test = "ArnLike"
variable = "aws:SourceArn"
values = [try(condition.value.hosted_zone_arn, "arn:${data.aws_partition.current.partition}:route53:::hostedzone/*")]
values = [try(condition.value.hosted_zone_arn, "arn:${local.partition}:route53:::hostedzone/*")]
}
}
}