Skip to content

Commit 9e7ece4

Browse files
committed
tweaks
1 parent 61ccc08 commit 9e7ece4

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed

Makefile

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: setup build deploy clean format outdated
1+
.PHONY: setup build deploy clean format outdated bootstrap
22

33
setup:
44
python3 -m venv .venv
@@ -20,3 +20,6 @@ format:
2020

2121
outdated:
2222
.venv/bin/python3 -m pip list -o
23+
24+
bootstrap:
25+
aws --region us-east-1 cloudformation deploy --template-file github_ci_template.yml --stack-name orgs-prescriptive-guidance-cicd --capabilities CAPABILITY_IAM CAPABILITY_NAMED_IAM

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,13 @@ aws --region us-east-1 cloudformation deploy \
5858
aws --region us-east-1 cloudformation describe-stacks --stack-name orgs-prescriptive-guidance-cicd --query "Stacks[0].Outputs"
5959
```
6060

61-
Then, follow this [guide](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#creating-configuration-variables-for-a-repository) to create these GitHub Action variables in the repository:
61+
Then, follow this [guide](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#creating-configuration-variables-for-a-repository) to create GitHub Action variables in the repository:
6262

6363
* `ARTIFACT_BUCKET` = value of `oArtifactBucket` from above
6464
* `ASSUME_ROLE_ARN` = value of `oGitHubRoleArn` from above
6565
* `CF_ROLE_ARN` = value of `oCloudFormationRoleArn` from above
6666

67-
The variables should match the image below:
67+
The variables should look like the image below:
6868

6969
![GitHub Action Variables](./docs/github_actions_variables.png)
7070

requirements-dev.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
black==24.10.0
22
aws-lambda-powertools[all,aws-sdk]==3.3.0
3-
boto3-stubs[iam,organizations,cloudformation]==1.35.63
3+
boto3-stubs[iam,organizations,cloudformation]==1.35.77

src/activation_lambda/index.py

+4-8
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@
5252

5353
try:
5454
root_id = os.getenv("ROOT_ID")
55+
56+
response = cloudformation.describe_organizations_access(CallAs="SELF")
57+
status: str = response.get("Status")
58+
logger.info("Organizations Access Status: " + status)
5559
except Exception as e:
5660
helper.init_failure(e)
5761

@@ -68,10 +72,6 @@
6872

6973
@helper.create
7074
def create(event: dict, context: LambdaContext):
71-
response = cloudformation.describe_organizations_access(CallAs="SELF")
72-
status: str = response.get("Status")
73-
logger.info("Organizations Access Status: " + status)
74-
7575
if status == "ACTIVE":
7676
logger.warning("Organizations access is already active")
7777
else:
@@ -107,10 +107,6 @@ def create(event: dict, context: LambdaContext):
107107

108108
@helper.delete
109109
def delete(event: dict, context: LambdaContext):
110-
response = cloudformation.describe_organizations_access(CallAs="SELF")
111-
status: str = response.get("Status")
112-
logger.info("Organizations Access Status: " + status)
113-
114110
if status == "DISABLED":
115111
logger.warning("Organizations access is already disabled")
116112
else:

0 commit comments

Comments
 (0)