Skip to content

Commit

Permalink
Merge pull request #106 from mikegrima/somefixes
Browse files Browse the repository at this point in the history
Made some small updates
  • Loading branch information
mikegrima authored Nov 21, 2023
2 parents 7ac8a30 + d616599 commit 0f7a779
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 11 deletions.
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Sample Starfleet Dockerfile for building ECR Lambda functions
FROM public.ecr.aws/lambda/python:3.10

ENV LAMBDA_TASK_ROOT=/var/runtime

# Copy Starfleet over (just a quick and dirty sample, not the cleanest):
COPY ./ ${LAMBDA_TASK_ROOT}/starfleet

# Install the specified packages:
RUN cd ${LAMBDA_TASK_ROOT}/starfleet && \
pip install . && \
rm -Rf ${LAMBDA_TASK_ROOT}/boto* # Remove the lambda provided boto since it interferes with starfleet

# The CMD is passed in as ImageConfig in the SAM template
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ package-dir = {"" = "src"}
[tool.setuptools.packages.find]
where = ["src"]

[tool.setuptools.package-data]
"starfleet.configuration_files" = ["*.yaml"]

[tool.setuptools.dynamic]
dependencies = {file = ["src/requirements.txt"]}

Expand All @@ -32,7 +35,7 @@ tests = [
"flake8==6.1.0",
"pylint==3.0.2",
"tox==4.11.3",
"moto==4.1.12",
"moto==4.2.9",
"mkdocs==1.5.3",
"mkdocstrings[python]==0.23.0",
"mkdocs-gen-files==0.5.0",
Expand Down
8 changes: 4 additions & 4 deletions src/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ retry==0.9.2
pyjwt==2.8.0
requests==2.31.0
cryptography==41.0.5
botocore==1.31.75
boto3==1.28.75
slack-sdk==3.23.0
botocore==1.32.3
boto3==1.29.3
slack-sdk==3.24.0
# Deep-diff issue: https://github.com/seperman/deepdiff/issues/415
deepdiff<6.7.0
iambic-core==0.11.86
iambic-core==0.11.97
6 changes: 3 additions & 3 deletions tests/starfleet_included_plugins/iam/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def template() -> Dict[str, Any]:
Value: some_other_value
IambicRoleTemplate:
properties:
description: 'Starfleet iambic test role with variable {{ var.some_key }}'
description: 'Starfleet iambic test role with variable {{var.some_key}}'
assume_role_policy_document:
statement:
- action: sts:AssumeRole
Expand All @@ -69,7 +69,7 @@ def template() -> Dict[str, Any]:
managed_policies:
- policy_arn: arn:aws:iam::aws:policy/ReadOnlyAccess
inline_policies:
- policy_name: 'SomePolicyIn-{{ var.account_name }}'
- policy_name: 'SomePolicyIn-{{var.account_name}}'
StarfleetIncludeAccounts:
ByOrgUnits:
- SomeNestedOU
Expand All @@ -86,6 +86,6 @@ def template() -> Dict[str, Any]:
- key: owner
value: pewpewpew
- key: some_other_key
value: '{{ var.some_other_key }}'
value: '{{var.some_other_key}}'
"""
)
6 changes: 3 additions & 3 deletions tests/starfleet_included_plugins/iam/test_role_payload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ IambicVariables:
Value: some_other_value
IambicRoleTemplate:
properties:
description: 'Starfleet iambic test role with variable {{ var.some_key }}'
description: 'Starfleet iambic test role with variable {{var.some_key}}'
assume_role_policy_document:
statement:
- action: sts:AssumeRole
Expand All @@ -20,7 +20,7 @@ IambicRoleTemplate:
managed_policies:
- policy_arn: arn:aws:iam::aws:policy/ReadOnlyAccess
inline_policies:
- policy_name: 'SomePolicyIn-{{ var.account_name }}'
- policy_name: 'SomePolicyIn-{{var.account_name}}'
StarfleetIncludeAccounts:
ByOrgUnits:
- SomeNestedOU
Expand All @@ -37,4 +37,4 @@ IambicRoleTemplate:
- key: owner
value: pewpewpew
- key: some_other_key
value: '{{ var.some_other_key }}'
value: '{{var.some_other_key}}'

0 comments on commit 0f7a779

Please sign in to comment.