Skip to content

Commit

Permalink
Merge pull request #511 from lorengordon/fix/pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
lorengordon authored Apr 19, 2023
2 parents 4cbed94 + bf81e5d commit 7d57c47
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 2.0.0
current_version = 2.0.1
commit = True
message = Bumps version to {new_version}
tag = False
Expand Down
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ jobs:
- make docker-compose/install
- make mockstack/up
script: make mockstack/pytest/lambda
after_script: make mockstack/clean
after_script:
- docker-compose -f ./tests/docker-compose-localstack.yml logs
- make mockstack/clean
- stage: deploy
if: branch = master AND type = push AND repo = plus3it/terraform-aws-org-new-account-trust-policy
before_script:
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).

### [2.0.1](https://github.com/plus3it/terraform-aws-org-new-account-trust-policy/releases/tag/2.0.1)

**Released**: 2023.04.18

**Summary**:

* Simplifies event rule patterns, relying only on details from cloudtrail event

### 1.0.0

**Commit Delta**: [Change from 0.2.2 release](https://github.com/plus3it/terraform-aws-org-new-account-support-case/compare/0.2.2...1.0.0)
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SHELL := /bin/bash
export PYTHONPATH := $(PYTHONPATH):./lambda/src
export TERRAFORM_PYTEST_DIR := tests
export TERRAFORM_PYTEST_DIR := $(PWD)/tests

include $(shell test -f .tardigrade-ci || curl -sSL -o .tardigrade-ci "https://raw.githubusercontent.com/plus3it/tardigrade-ci/master/bootstrap/Makefile.bootstrap"; echo .tardigrade-ci)

Expand All @@ -19,7 +19,7 @@ python/deps:
.PHONY: mockstack/pytest/lambda
mockstack/pytest/lambda:
@ echo "[$@] Running Terraform tests against LocalStack"
DOCKER_RUN_FLAGS="--network tests_default --rm -e LOCALSTACK_HOST=localstack" \
DOCKER_RUN_FLAGS="--network terraform_pytest_default --rm -e LOCALSTACK_HOST=localstack" \
TARDIGRADE_CI_DOCKERFILE=Dockerfile_test \
IMAGE_NAME=new-account-trust-policy-integration-test:latest \
$(MAKE) docker/run target=terraform/pytest
Expand Down
4 changes: 0 additions & 4 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ locals {
event_types = {
CreateAccountResult = jsonencode(
{
"source" : ["aws.organizations"],
"detail-type" : ["AWS Service Event via CloudTrail"]
"detail" : {
"eventSource" : ["organizations.amazonaws.com"],
"eventName" : ["CreateAccountResult"]
Expand All @@ -81,8 +79,6 @@ locals {
)
InviteAccountToOrganization = jsonencode(
{
"source" : ["aws.organizations"],
"detail-type" : ["AWS API Call via CloudTrail"]
"detail" : {
"eventSource" : ["organizations.amazonaws.com"],
"eventName" : ["InviteAccountToOrganization"]
Expand Down
10 changes: 7 additions & 3 deletions tests/docker-compose-localstack.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
version: "2.1"
version: "3.8"

networks:
default:
name: terraform_pytest_default

services:
localstack:
container_name: localstack
image: localstack/localstack
image: "localstack/localstack:${LOCALSTACK_VERSION:-latest}"
ports:
- "4566:4566"
- "4571:4571"
environment:
- SERVICES=cloudwatch,events,lambda,iam,sts,organizations
- MAIN_CONTAINER_NAME=localstack
- LAMBDA_DOCKER_NETWORK=terraform_pytest_default
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"

0 comments on commit 7d57c47

Please sign in to comment.