Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made some small updates #106

Merged
merged 1 commit into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}}'