diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5790ecd --- /dev/null +++ b/Dockerfile @@ -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 diff --git a/pyproject.toml b/pyproject.toml index a85bc8d..62cb34b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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"]} @@ -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", diff --git a/src/requirements.txt b/src/requirements.txt index ab24c8f..6a06d94 100644 --- a/src/requirements.txt +++ b/src/requirements.txt @@ -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 diff --git a/tests/starfleet_included_plugins/iam/conftest.py b/tests/starfleet_included_plugins/iam/conftest.py index 272ca3d..b088f8f 100644 --- a/tests/starfleet_included_plugins/iam/conftest.py +++ b/tests/starfleet_included_plugins/iam/conftest.py @@ -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 @@ -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 @@ -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}}' """ ) diff --git a/tests/starfleet_included_plugins/iam/test_role_payload.yaml b/tests/starfleet_included_plugins/iam/test_role_payload.yaml index 432fa08..d6a101f 100644 --- a/tests/starfleet_included_plugins/iam/test_role_payload.yaml +++ b/tests/starfleet_included_plugins/iam/test_role_payload.yaml @@ -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 @@ -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 @@ -37,4 +37,4 @@ IambicRoleTemplate: - key: owner value: pewpewpew - key: some_other_key - value: '{{ var.some_other_key }}' + value: '{{var.some_other_key}}'