Skip to content

Commit

Permalink
feat: add Terraform support to V2 Api gateway resources (#5479)
Browse files Browse the repository at this point in the history
* feat: Enable hook-name and skip-prepare-infra flagf for sam local start-api (#5217)

* Enable hook-name flag for sam local start-api

* Format files

* test: Terraform local start-api integration tests base (#5240)

* feat: update SAM CLI with latest App Templates commit hash (#5211)

* feat: updating app templates repo hash with (a34f563f067e13df3eb350d36461b99397b6cda6)

* dummy change to trigger checks

* revert dummy commit

---------

Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: Mohamed Elasmar <[email protected]>

* Enable hook-name flag for sam local start-api

* Format files

* fix: fix failing Terraform integration test cases (#5218)

* fix: fix the failing terraform integration test cases

* fix: fix the resource address while accessing the module config resources

* fix: fix checking the experimental log integration test cases

* chore: bump version to 1.85.0 (#5226)

* chore: use the SAR Application created in testing accounts (#5221)

* chore: update aws_lambda_builders to 1.32.0 (#5215)

Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: Mohamed Elasmar <[email protected]>

* feat: Added linking Gateway Method to Lambda Authorizer (#5228)

* Added linking method to authorizer

* Fixed docstring spelling mistake

---------

Co-authored-by: Mohamed Elasmar <[email protected]>

* feat: Return early during linking if no destination resources are found (#5220)

* Returns during linking if no destination resources are found

* Updated comment to correctly reflect state

* Cleaned extra word

---------

Co-authored-by: Mohamed Elasmar <[email protected]>

* chore: Strengthen wording on "no Auth" during deploy (#5231)

Co-authored-by: Jacob Fuss <[email protected]>
Co-authored-by: Sriram Madapusi Vasudevan <[email protected]>

* feat: Link Lambda Authorizer to Rest API (#5219)

* Link RestApiId property for Lambda Authorizers

* Updated docstring

* Format files

---------

Co-authored-by: Mohamed Elasmar <[email protected]>

* Terraform start-api integration tests

* Add test files

* Uncomment skip

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: Mohamed Elasmar <[email protected]>
Co-authored-by: Lucas <[email protected]>
Co-authored-by: Jacob Fuss <[email protected]>
Co-authored-by: Jacob Fuss <[email protected]>
Co-authored-by: Sriram Madapusi Vasudevan <[email protected]>

* feat: Added OpenApi body integration testing and updated property builder (#5291)

* Added OpenApi body integration testing and updated property builder

* Added more test cases

* Changed tearDown to tearDownClass

* Updated JSON body parser to handle parsing errors and added unit tests

* Removed V1 references

* feat: Terraform Authorizer resource testing (#5270)

* Added authorizer project

* Added project files

* Removed extra print

* Add request based authorizer testing

* test: Test the unsupported limitations for local start api (#5309)

* test: Test the unsupported limitations for local start api

* fix lint issues

* apply pr comments

* fix: Bug Bash UX Issues (#5387)

* Fix bug bash UX issues

* Fix beta warning printing extra characters

* Fix authorizer logging

* feat: Read aws_apigatewayv2_api and aws_apigatewayv2_route (#5428)

* chore(deps): bump actions/setup-go from 3 to 4 (#5418)

Bumps [actions/setup-go](https://github.com/actions/setup-go) from 3 to 4.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](actions/setup-go@v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sriram Madapusi Vasudevan <[email protected]>

* Merge changes from upstream

* Read cors props

* Tests for apigw v2 api

* Tests for apigw v2 route

* Add docstrings and type hints

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sriram Madapusi Vasudevan <[email protected]>

* chore: Merge develop into feat/terraform-v2-api (#5442)

* chore(deps): bump actions/setup-go from 3 to 4 (#5418)

Bumps [actions/setup-go](https://github.com/actions/setup-go) from 3 to 4.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](actions/setup-go@v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sriram Madapusi Vasudevan <[email protected]>

* chore(deps-dev): bump filelock from 3.12.0 to 3.12.2 in /requirements (#5378)

Bumps [filelock](https://github.com/tox-dev/py-filelock) from 3.12.0 to 3.12.2.
- [Release notes](https://github.com/tox-dev/py-filelock/releases)
- [Changelog](https://github.com/tox-dev/py-filelock/blob/main/docs/changelog.rst)
- [Commits](tox-dev/filelock@3.12.0...3.12.2)

---
updated-dependencies:
- dependency-name: filelock
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* feat: updating app templates repo hash with (bb905c379830c3d8edbc196bda731076549028e3) (#5398)

Co-authored-by: GitHub Action <[email protected]>

* fix: add a table for package help text. (#5298)

* fix: add a table for package help text.

* Update samcli/commands/package/core/command.py

Co-authored-by: Daniel Mil <[email protected]>

* tests: fix strings in package help text

* fix: PR comments

* fix: PR comments.

---------

Co-authored-by: Daniel Mil <[email protected]>

* fix: Handle BROKEN_PIPE_ERROR (#5386)

* Handle pywintypes pipe exception

* Moved exception checking to check for winerror

* Use decorator and added unit tests

* Added failure test case

* make format

* Added more context/comments

* fix: remove circular dependency by moving parse_s3 method to its own util file (#5430)

* fix: remove circular dependency by moving parse_s3 method to its own util file

* add missing unit tests file

* chore(deps): bump sympy from 1.10.1 to 1.12 in /requirements (#5338)

Bumps [sympy](https://github.com/sympy/sympy) from 1.10.1 to 1.12.
- [Release notes](https://github.com/sympy/sympy/releases)
- [Commits](sympy/sympy@sympy-1.10.1...sympy-1.12)

---
updated-dependencies:
- dependency-name: sympy
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: hnnasit <[email protected]>

* chore(deps): bump websocket-client from 1.5.1 to 1.6.1 in /requirements (#5417)

Bumps [websocket-client](https://github.com/websocket-client/websocket-client) from 1.5.1 to 1.6.1.
- [Release notes](https://github.com/websocket-client/websocket-client/releases)
- [Changelog](https://github.com/websocket-client/websocket-client/blob/master/ChangeLog)
- [Commits](websocket-client/websocket-client@v1.5.1...v1.6.1)

---
updated-dependencies:
- dependency-name: websocket-client
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump ruamel-yaml from 0.17.21 to 0.17.32 in /requirements (#5376)

* chore(deps): bump ruamel-yaml from 0.17.21 to 0.17.32 in /requirements

Bumps [ruamel-yaml](https://sourceforge.net/p/ruamel-yaml/code/ci/default/tree) from 0.17.21 to 0.17.32.

---
updated-dependencies:
- dependency-name: ruamel-yaml
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* Pin ruamel-yaml-clib version

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: hnnasit <[email protected]>
Co-authored-by: Haresh Nasit <[email protected]>

* Updated package formatter to import package options instead of deploy (#5433)

Co-authored-by: Sriram Madapusi Vasudevan <[email protected]>

* chore(deps): bump importlib-metadata in /requirements (#5437)

Bumps [importlib-metadata](https://github.com/python/importlib_metadata) from 6.1.0 to 6.7.0.
- [Release notes](https://github.com/python/importlib_metadata/releases)
- [Changelog](https://github.com/python/importlib_metadata/blob/main/NEWS.rst)
- [Commits](python/importlib_metadata@v6.1.0...v6.7.0)

---
updated-dependencies:
- dependency-name: importlib-metadata
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* feat: `sam logs` help text (#5397)

* feat: `sam logs` help text

* fix: make ruff happy

* fix: address comments

* feat: enable terraform support for local start-api command (#5389)

* feat: Enable hook-name and skip-prepare-infra flagf for sam local start-api (#5217)

* Enable hook-name flag for sam local start-api

* Format files

* test: Terraform local start-api integration tests base (#5240)

* feat: update SAM CLI with latest App Templates commit hash (#5211)

* feat: updating app templates repo hash with (a34f563f067e13df3eb350d36461b99397b6cda6)

* dummy change to trigger checks

* revert dummy commit

---------

Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: Mohamed Elasmar <[email protected]>

* Enable hook-name flag for sam local start-api

* Format files

* fix: fix failing Terraform integration test cases (#5218)

* fix: fix the failing terraform integration test cases

* fix: fix the resource address while accessing the module config resources

* fix: fix checking the experimental log integration test cases

* chore: bump version to 1.85.0 (#5226)

* chore: use the SAR Application created in testing accounts (#5221)

* chore: update aws_lambda_builders to 1.32.0 (#5215)

Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: Mohamed Elasmar <[email protected]>

* feat: Added linking Gateway Method to Lambda Authorizer (#5228)

* Added linking method to authorizer

* Fixed docstring spelling mistake

---------

Co-authored-by: Mohamed Elasmar <[email protected]>

* feat: Return early during linking if no destination resources are found (#5220)

* Returns during linking if no destination resources are found

* Updated comment to correctly reflect state

* Cleaned extra word

---------

Co-authored-by: Mohamed Elasmar <[email protected]>

* chore: Strengthen wording on "no Auth" during deploy (#5231)

Co-authored-by: Jacob Fuss <[email protected]>
Co-authored-by: Sriram Madapusi Vasudevan <[email protected]>

* feat: Link Lambda Authorizer to Rest API (#5219)

* Link RestApiId property for Lambda Authorizers

* Updated docstring

* Format files

---------

Co-authored-by: Mohamed Elasmar <[email protected]>

* Terraform start-api integration tests

* Add test files

* Uncomment skip

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: Mohamed Elasmar <[email protected]>
Co-authored-by: Lucas <[email protected]>
Co-authored-by: Jacob Fuss <[email protected]>
Co-authored-by: Jacob Fuss <[email protected]>
Co-authored-by: Sriram Madapusi Vasudevan <[email protected]>

* feat: Added OpenApi body integration testing and updated property builder (#5291)

* Added OpenApi body integration testing and updated property builder

* Added more test cases

* Changed tearDown to tearDownClass

* Updated JSON body parser to handle parsing errors and added unit tests

* Removed V1 references

* feat: Terraform Authorizer resource testing (#5270)

* Added authorizer project

* Added project files

* Removed extra print

* Add request based authorizer testing

* test: Test the unsupported limitations for local start api (#5309)

* test: Test the unsupported limitations for local start api

* fix lint issues

* apply pr comments

* fix: Bug Bash UX Issues (#5387)

* Fix bug bash UX issues

* Fix beta warning printing extra characters

* Fix authorizer logging

---------

Co-authored-by: Daniel Mil <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: Lucas <[email protected]>
Co-authored-by: Jacob Fuss <[email protected]>
Co-authored-by: Jacob Fuss <[email protected]>
Co-authored-by: Sriram Madapusi Vasudevan <[email protected]>

* Updated warning message about missing function in template (#5347)

Co-authored-by: Wing Fung Lau <[email protected]>

* chore(deps-dev): bump types-pywin32 in /requirements (#5436)

Bumps [types-pywin32](https://github.com/python/typeshed) from 306.0.0.0 to 306.0.0.2.
- [Commits](https://github.com/python/typeshed/commits)

---
updated-dependencies:
- dependency-name: types-pywin32
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sriram Madapusi Vasudevan <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: Lucas <[email protected]>
Co-authored-by: Mehmet Nuri Deveci <[email protected]>
Co-authored-by: hnnasit <[email protected]>
Co-authored-by: Haresh Nasit <[email protected]>
Co-authored-by: Mohamed Elasmar <[email protected]>
Co-authored-by: Jacob Fuss <[email protected]>
Co-authored-by: Jacob Fuss <[email protected]>
Co-authored-by: Wing Fung Lau <[email protected]>

* feat: Read APIGW V2 stage and integration resources (#5443)

* chore(deps): bump actions/setup-go from 3 to 4 (#5418)

Bumps [actions/setup-go](https://github.com/actions/setup-go) from 3 to 4.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](actions/setup-go@v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sriram Madapusi Vasudevan <[email protected]>

* chore(deps-dev): bump filelock from 3.12.0 to 3.12.2 in /requirements (#5378)

Bumps [filelock](https://github.com/tox-dev/py-filelock) from 3.12.0 to 3.12.2.
- [Release notes](https://github.com/tox-dev/py-filelock/releases)
- [Changelog](https://github.com/tox-dev/py-filelock/blob/main/docs/changelog.rst)
- [Commits](tox-dev/filelock@3.12.0...3.12.2)

---
updated-dependencies:
- dependency-name: filelock
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* feat: updating app templates repo hash with (bb905c379830c3d8edbc196bda731076549028e3) (#5398)

Co-authored-by: GitHub Action <[email protected]>

* fix: add a table for package help text. (#5298)

* fix: add a table for package help text.

* Update samcli/commands/package/core/command.py

Co-authored-by: Daniel Mil <[email protected]>

* tests: fix strings in package help text

* fix: PR comments

* fix: PR comments.

---------

Co-authored-by: Daniel Mil <[email protected]>

* fix: Handle BROKEN_PIPE_ERROR (#5386)

* Handle pywintypes pipe exception

* Moved exception checking to check for winerror

* Use decorator and added unit tests

* Added failure test case

* make format

* Added more context/comments

* fix: remove circular dependency by moving parse_s3 method to its own util file (#5430)

* fix: remove circular dependency by moving parse_s3 method to its own util file

* add missing unit tests file

* chore(deps): bump sympy from 1.10.1 to 1.12 in /requirements (#5338)

Bumps [sympy](https://github.com/sympy/sympy) from 1.10.1 to 1.12.
- [Release notes](https://github.com/sympy/sympy/releases)
- [Commits](sympy/sympy@sympy-1.10.1...sympy-1.12)

---
updated-dependencies:
- dependency-name: sympy
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: hnnasit <[email protected]>

* chore(deps): bump websocket-client from 1.5.1 to 1.6.1 in /requirements (#5417)

Bumps [websocket-client](https://github.com/websocket-client/websocket-client) from 1.5.1 to 1.6.1.
- [Release notes](https://github.com/websocket-client/websocket-client/releases)
- [Changelog](https://github.com/websocket-client/websocket-client/blob/master/ChangeLog)
- [Commits](websocket-client/websocket-client@v1.5.1...v1.6.1)

---
updated-dependencies:
- dependency-name: websocket-client
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump ruamel-yaml from 0.17.21 to 0.17.32 in /requirements (#5376)

* chore(deps): bump ruamel-yaml from 0.17.21 to 0.17.32 in /requirements

Bumps [ruamel-yaml](https://sourceforge.net/p/ruamel-yaml/code/ci/default/tree) from 0.17.21 to 0.17.32.

---
updated-dependencies:
- dependency-name: ruamel-yaml
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* Pin ruamel-yaml-clib version

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: hnnasit <[email protected]>
Co-authored-by: Haresh Nasit <[email protected]>

* Updated package formatter to import package options instead of deploy (#5433)

Co-authored-by: Sriram Madapusi Vasudevan <[email protected]>

* chore(deps): bump importlib-metadata in /requirements (#5437)

Bumps [importlib-metadata](https://github.com/python/importlib_metadata) from 6.1.0 to 6.7.0.
- [Release notes](https://github.com/python/importlib_metadata/releases)
- [Changelog](https://github.com/python/importlib_metadata/blob/main/NEWS.rst)
- [Commits](python/importlib_metadata@v6.1.0...v6.7.0)

---
updated-dependencies:
- dependency-name: importlib-metadata
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* feat: `sam logs` help text (#5397)

* feat: `sam logs` help text

* fix: make ruff happy

* fix: address comments

* feat: enable terraform support for local start-api command (#5389)

* feat: Enable hook-name and skip-prepare-infra flagf for sam local start-api (#5217)

* Enable hook-name flag for sam local start-api

* Format files

* test: Terraform local start-api integration tests base (#5240)

* feat: update SAM CLI with latest App Templates commit hash (#5211)

* feat: updating app templates repo hash with (a34f563f067e13df3eb350d36461b99397b6cda6)

* dummy change to trigger checks

* revert dummy commit

---------

Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: Mohamed Elasmar <[email protected]>

* Enable hook-name flag for sam local start-api

* Format files

* fix: fix failing Terraform integration test cases (#5218)

* fix: fix the failing terraform integration test cases

* fix: fix the resource address while accessing the module config resources

* fix: fix checking the experimental log integration test cases

* chore: bump version to 1.85.0 (#5226)

* chore: use the SAR Application created in testing accounts (#5221)

* chore: update aws_lambda_builders to 1.32.0 (#5215)

Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: Mohamed Elasmar <[email protected]>

* feat: Added linking Gateway Method to Lambda Authorizer (#5228)

* Added linking method to authorizer

* Fixed docstring spelling mistake

---------

Co-authored-by: Mohamed Elasmar <[email protected]>

* feat: Return early during linking if no destination resources are found (#5220)

* Returns during linking if no destination resources are found

* Updated comment to correctly reflect state

* Cleaned extra word

---------

Co-authored-by: Mohamed Elasmar <[email protected]>

* chore: Strengthen wording on "no Auth" during deploy (#5231)

Co-authored-by: Jacob Fuss <[email protected]>
Co-authored-by: Sriram Madapusi Vasudevan <[email protected]>

* feat: Link Lambda Authorizer to Rest API (#5219)

* Link RestApiId property for Lambda Authorizers

* Updated docstring

* Format files

---------

Co-authored-by: Mohamed Elasmar <[email protected]>

* Terraform start-api integration tests

* Add test files

* Uncomment skip

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: Mohamed Elasmar <[email protected]>
Co-authored-by: Lucas <[email protected]>
Co-authored-by: Jacob Fuss <[email protected]>
Co-authored-by: Jacob Fuss <[email protected]>
Co-authored-by: Sriram Madapusi Vasudevan <[email protected]>

* feat: Added OpenApi body integration testing and updated property builder (#5291)

* Added OpenApi body integration testing and updated property builder

* Added more test cases

* Changed tearDown to tearDownClass

* Updated JSON body parser to handle parsing errors and added unit tests

* Removed V1 references

* feat: Terraform Authorizer resource testing (#5270)

* Added authorizer project

* Added project files

* Removed extra print

* Add request based authorizer testing

* test: Test the unsupported limitations for local start api (#5309)

* test: Test the unsupported limitations for local start api

* fix lint issues

* apply pr comments

* fix: Bug Bash UX Issues (#5387)

* Fix bug bash UX issues

* Fix beta warning printing extra characters

* Fix authorizer logging

---------

Co-authored-by: Daniel Mil <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: Lucas <[email protected]>
Co-authored-by: Jacob Fuss <[email protected]>
Co-authored-by: Jacob Fuss <[email protected]>
Co-authored-by: Sriram Madapusi Vasudevan <[email protected]>

* Updated warning message about missing function in template (#5347)

Co-authored-by: Wing Fung Lau <[email protected]>

* chore(deps-dev): bump types-pywin32 in /requirements (#5436)

Bumps [types-pywin32](https://github.com/python/typeshed) from 306.0.0.0 to 306.0.0.2.
- [Commits](https://github.com/python/typeshed/commits)

---
updated-dependencies:
- dependency-name: types-pywin32
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* feat: Read APIGW V2 stage and integration resources

* Format files

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sriram Madapusi Vasudevan <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: Lucas <[email protected]>
Co-authored-by: Mehmet Nuri Deveci <[email protected]>
Co-authored-by: hnnasit <[email protected]>
Co-authored-by: Haresh Nasit <[email protected]>
Co-authored-by: Mohamed Elasmar <[email protected]>
Co-authored-by: Jacob Fuss <[email protected]>
Co-authored-by: Jacob Fuss <[email protected]>
Co-authored-by: Wing Fung Lau <[email protected]>

* feat: Link v2 route to integration (#5444)

* chore(deps): bump actions/setup-go from 3 to 4 (#5418)

Bumps [actions/setup-go](https://github.com/actions/setup-go) from 3 to 4.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](actions/setup-go@v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sriram Madapusi Vasudevan <[email protected]>

* chore(deps-dev): bump filelock from 3.12.0 to 3.12.2 in /requirements (#5378)

Bumps [filelock](https://github.com/tox-dev/py-filelock) from 3.12.0 to 3.12.2.
- [Release notes](https://github.com/tox-dev/py-filelock/releases)
- [Changelog](https://github.com/tox-dev/py-filelock/blob/main/docs/changelog.rst)
- [Commits](tox-dev/filelock@3.12.0...3.12.2)

---
updated-dependencies:
- dependency-name: filelock
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* feat: updating app templates repo hash with (bb905c379830c3d8edbc196bda731076549028e3) (#5398)

Co-authored-by: GitHub Action <[email protected]>

* fix: add a table for package help text. (#5298)

* fix: add a table for package help text.

* Update samcli/commands/package/core/command.py

Co-authored-by: Daniel Mil <[email protected]>

* tests: fix strings in package help text

* fix: PR comments

* fix: PR comments.

---------

Co-authored-by: Daniel Mil <[email protected]>

* fix: Handle BROKEN_PIPE_ERROR (#5386)

* Handle pywintypes pipe exception

* Moved exception checking to check for winerror

* Use decorator and added unit tests

* Added failure test case

* make format

* Added more context/comments

* fix: remove circular dependency by moving parse_s3 method to its own util file (#5430)

* fix: remove circular dependency by moving parse_s3 method to its own util file

* add missing unit tests file

* chore(deps): bump sympy from 1.10.1 to 1.12 in /requirements (#5338)

Bumps [sympy](https://github.com/sympy/sympy) from 1.10.1 to 1.12.
- [Release notes](https://github.com/sympy/sympy/releases)
- [Commits](sympy/sympy@sympy-1.10.1...sympy-1.12)

---
updated-dependencies:
- dependency-name: sympy
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: hnnasit <[email protected]>

* chore(deps): bump websocket-client from 1.5.1 to 1.6.1 in /requirements (#5417)

Bumps [websocket-client](https://github.com/websocket-client/websocket-client) from 1.5.1 to 1.6.1.
- [Release notes](https://github.com/websocket-client/websocket-client/releases)
- [Changelog](https://github.com/websocket-client/websocket-client/blob/master/ChangeLog)
- [Commits](websocket-client/websocket-client@v1.5.1...v1.6.1)

---
updated-dependencies:
- dependency-name: websocket-client
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump ruamel-yaml from 0.17.21 to 0.17.32 in /requirements (#5376)

* chore(deps): bump ruamel-yaml from 0.17.21 to 0.17.32 in /requirements

Bumps [ruamel-yaml](https://sourceforge.net/p/ruamel-yaml/code/ci/default/tree) from 0.17.21 to 0.17.32.

---
updated-dependencies:
- dependency-name: ruamel-yaml
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* Pin ruamel-yaml-clib version

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: hnnasit <[email protected]>
Co-authored-by: Haresh Nasit <[email protected]>

* Updated package formatter to import package options instead of deploy (#5433)

Co-authored-by: Sriram Madapusi Vasudevan <[email protected]>

* chore(deps): bump importlib-metadata in /requirements (#5437)

Bumps [importlib-metadata](https://github.com/python/importlib_metadata) from 6.1.0 to 6.7.0.
- [Release notes](https://github.com/python/importlib_metadata/releases)
- [Changelog](https://github.com/python/importlib_metadata/blob/main/NEWS.rst)
- [Commits](python/importlib_metadata@v6.1.0...v6.7.0)

---
updated-dependencies:
- dependency-name: importlib-metadata
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* feat: `sam logs` help text (#5397)

* feat: `sam logs` help text

* fix: make ruff happy

* fix: address comments

* feat: enable terraform support for local start-api command (#5389)

* feat: Enable hook-name and skip-prepare-infra flagf for sam local start-api (#5217)

* Enable hook-name flag for sam local start-api

* Format files

* test: Terraform local start-api integration tests base (#5240)

* feat: update SAM CLI with latest App Templates commit hash (#5211)

* feat: updating app templates repo hash with (a34f563f067e13df3eb350d36461b99397b6cda6)

* dummy change to trigger checks

* revert dummy commit

---------

Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: Mohamed Elasmar <[email protected]>

* Enable hook-name flag for sam local start-api

* Format files

* fix: fix failing Terraform integration test cases (#5218)

* fix: fix the failing terraform integration test cases

* fix: fix the resource address while accessing the module config resources

* fix: fix checking the experimental log integration test cases

* chore: bump version to 1.85.0 (#5226)

* chore: use the SAR Application created in testing accounts (#5221)

* chore: update aws_lambda_builders to 1.32.0 (#5215)

Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: Mohamed Elasmar <[email protected]>

* feat: Added linking Gateway Method to Lambda Authorizer (#5228)

* Added linking method to authorizer

* Fixed docstring spelling mistake

---------

Co-authored-by: Mohamed Elasmar <[email protected]>

* feat: Return early during linking if no destination resources are found (#5220)

* Returns during linking if no destination resources are found

* Updated comment to correctly reflect state

* Cleaned extra word

---------

Co-authored-by: Mohamed Elasmar <[email protected]>

* chore: Strengthen wording on "no Auth" during deploy (#5231)

Co-authored-by: Jacob Fuss <[email protected]>
Co-authored-by: Sriram Madapusi Vasudevan <[email protected]>

* feat: Link Lambda Authorizer to Rest API (#5219)

* Link RestApiId property for Lambda Authorizers

* Updated docstring

* Format files

---------

Co-authored-by: Mohamed Elasmar <[email protected]>

* Terraform start-api integration tests

* Add test files

* Uncomment skip

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: Mohamed Elasmar <[email protected]>
Co-authored-by: Lucas <[email protected]>
Co-authored-by: Jacob Fuss <[email protected]>
Co-authored-by: Jacob Fuss <[email protected]>
Co-authored-by: Sriram Madapusi Vasudevan <[email protected]>

* feat: Added OpenApi body integration testing and updated property builder (#5291)

* Added OpenApi body integration testing and updated property builder

* Added more test cases

* Changed tearDown to tearDownClass

* Updated JSON body parser to handle parsing errors and added unit tests

* Removed V1 references

* feat: Terraform Authorizer resource testing (#5270)

* Added authorizer project

* Added project files

* Removed extra print

* Add request based authorizer testing

* test: Test the unsupported limitations for local start api (#5309)

* test: Test the unsupported limitations for local start api

* fix lint issues

* apply pr comments

* fix: Bug Bash UX Issues (#5387)

* Fix bug bash UX issues

* Fix beta warning printing extra characters

* Fix authorizer logging

---------

Co-authored-by: Daniel Mil <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: Lucas <[email protected]>
Co-authored-by: Jacob Fuss <[email protected]>
Co-authored-by: Jacob Fuss <[email protected]>
Co-authored-by: Sriram Madapusi Vasudevan <[email protected]>

* Updated warning message about missing function in template (#5347)

Co-authored-by: Wing Fung Lau <[email protected]>

* chore(deps-dev): bump types-pywin32 in /requirements (#5436)

Bumps [types-pywin32](https://github.com/python/typeshed) from 306.0.0.0 to 306.0.0.2.
- [Commits](https://github.com/python/typeshed/commits)

---
updated-dependencies:
- dependency-name: types-pywin32
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* feat: Read APIGW V2 stage and integration resources

* Format files

* feat: Link gateway v2 routes to gateway v2 integrations

* Add unit testing

* Fix linter error

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sriram Madapusi Vasudevan <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: Lucas <[email protected]>
Co-authored-by: Mehmet Nuri Deveci <[email protected]>
Co-authored-by: hnnasit <[email protected]>
Co-authored-by: Haresh Nasit <[email protected]>
Co-authored-by: Mohamed Elasmar <[email protected]>
Co-authored-by: Jacob Fuss <[email protected]>
Co-authored-by: Jacob Fuss <[email protected]>
Co-authored-by: Wing Fung Lau <[email protected]>

* chore: fix the v2 gateway integration to route resources linking (#5478)

* feat: Link v2 integration to lambda function (#5481)

* link aws_apigatewayv2_integration and aws_lambda_function

* feat: Link v2 integration to lambda function

* fix merge error

* run make format

* feat: Link v2 integration to V2 API (#5486)

* feat: Link v2 integration to V2 API

* run make format

* feat: Link V2 Route to V2 API (#5503)

* feat: Link gateway v2 routes to gateway v2 apis

* Format files

---------

Co-authored-by: Mohamed Elasmar <[email protected]>

* feat: Link V2 Stages to V2 APIs (#5622)

* feat: Link gateway v2 stages to gateway v2 apis

* Rename test

* feat: Link Gateway V2 APIs to Lambda Functions (#5626)

* feat: Link gateway v2 apis to lambda functions

* Fix typo

* Format files

* feat: Add APIGW V2 Lambda Authorizer mapping and linking (#5625)

* Added V2 Authorizer property mapping

* make format

* Link a V2 Authorizer to a Lambda Function

* Link V2 Authorizers to V2 Api

* Added missing lines to include new resource in testing suite

* Removed max diff pytest option

* test: Add terraform v2 api integration test cases (#5634)

* chore: merge from develop branch, and apply the linking refactor (#5701)

* fix(invoke): Write in UTF-8 string instead of bytes (#5642)

* Revert "fix: Revert UTF-8 fixes #5485 and #5427 (#5512)"

This reverts commit 36f8bf9.

* Enforce utf8 on stdout/stderr/logfile

---------

Co-authored-by: Jacob Fuss <[email protected]>

* chore(deps): bump cryptography from 41.0.2 to 41.0.3 in /requirements (#5675)

Bumps [cryptography](https://github.com/pyca/cryptography) from 41.0.2 to 41.0.3.
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](pyca/cryptography@41.0.2...41.0.3)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix(test): Force reading file with utf8 in tests for windows (#5679)

Co-authored-by: Jacob Fuss <[email protected]>

* fix(test): Increase max execution time for timeout tests (#5680)

Co-authored-by: Jacob Fuss <[email protected]>

* chore: auto update reproducible requirements when there is a dependency change (#5677)

* chore: add reproducible gha

* format

* formatting v2

* format v3

* use win make target

* update windows job

* update win paths

* why windows why

* remove if stmt for now

* test with direct paths

* update windows paths again

* bring back activate

* add dummy win file and push changes

* update base.txt for testing

* Update reproducibles

* run jobs sequentially

* print changed flag

* check changes again

* run git status before moving forward

* refresh index before checking any changed files

* Update reproducibles

* commit or skip

* Update reproducibles

* rerun build & pyinstaller jobs once update reproducible finishes

* add more details to commit message

* nuke all reproducibles to trigger the CI

* Update reproducibles: update-reproducible-linux-reqs

* Update reproducibles: update-reproducible-mac-reqs

* Update reproducibles: update-reproducible-win-reqs

* change lb version for testing

* update permissions and limit only for aws/aws-sam-cli

* Update reproducibles: update-reproducible-linux-reqs

* Update reproducibles: update-reproducible-mac-reqs

* Update reproducibles: update-reproducible-win-reqs

* update other jobs as well

* run without file filter

* Update reproducibles: update-reproducible-linux-reqs

* Update reproducibles: update-reproducible-mac-reqs

* Update reproducibles: update-reproducible-win-reqs

* put the file filter back

---------

Co-authored-by: GitHub Action <[email protected]>

* fix: Repair failing integration test (#5698)

* Fix failing integration test

* Be more specific with error message

---------

Co-authored-by: Leonardo Gama <[email protected]>

* fix: link the API gateway resource parent to either rest api or another gateway resource (#5697)

* chore: merge from develop branch, and apply the linking refactor

* fix merge mistake in the integration test cases

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Jacob Fuss <[email protected]>
Co-authored-by: Jacob Fuss <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mehmet Nuri Deveci <[email protected]>
Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: Leonardo Gama <[email protected]>
Co-authored-by: Leonardo Gama <[email protected]>

* tests: Added limitation test cases for V2 resources (#5708)

* chore: merge from develop branch, and apply the linking refactor

* Added limitation test cases for V2 resources

* Removed commented out code

* fix merge mistake in the integration test cases

* Updated and added happy paths to apply test class

* Use correct method for AWS_PROXY

* fix failing integration testing

* fix merge conflicts

---------

Co-authored-by: Mohamed ElAsmar <[email protected]>

* feat: Link V2 Routes to Authorizer (#5732)

* feat: Link V2 Routes to Authorizer

* adding authorizers integration testing

* feat: remove beta-features flag usage for terraform feature (#5760)

* chore: Resolve conflicts with upstream/develop (#5830)

* feat: Added environment variable validation for Terraform arguments (#5809)

* Added environment variable validation

* Added integration tests

* Added typing and more detailed doc string

* feat: Report TF custom plan file usage in telemetry (#5825)

* feat: Report TF custom plan file usage in telemetry

* Read property from config

* Fix sam remote invoke to take profile properly (#5823)

* Fix sam remote invoke to take profile properly

* error handling

---------

Co-authored-by: Lucas <[email protected]>
Co-authored-by: Wing Fung Lau <[email protected]>

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Daniel Mil <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: Lucas <[email protected]>
Co-authored-by: Jacob Fuss <[email protected]>
Co-authored-by: Jacob Fuss <[email protected]>
Co-authored-by: Sriram Madapusi Vasudevan <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Daniel Mil <[email protected]>
Co-authored-by: Mehmet Nuri Deveci <[email protected]>
Co-authored-by: hnnasit <[email protected]>
Co-authored-by: Haresh Nasit <[email protected]>
Co-authored-by: Wing Fung Lau <[email protected]>
Co-authored-by: Leonardo Gama <[email protected]>
Co-authored-by: Leonardo Gama <[email protected]>
  • Loading branch information
16 people authored Aug 30, 2023
1 parent b97847e commit a4a0633
Show file tree
Hide file tree
Showing 43 changed files with 2,696 additions and 981 deletions.
83 changes: 0 additions & 83 deletions samcli/commands/_utils/custom_options/hook_name_option.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,7 @@
import click

from samcli.cli.context import Context
from samcli.cli.global_config import GlobalConfig
from samcli.commands._utils.constants import DEFAULT_BUILT_TEMPLATE_PATH
from samcli.commands._utils.experimental import (
ExperimentalFlag,
prompt_experimental,
set_experimental,
update_experimental_context,
)
from samcli.lib.hook.exceptions import InvalidHookWrapperException
from samcli.lib.hook.hook_wrapper import IacHookWrapper, get_available_hook_packages_ids
from samcli.lib.telemetry.event import EventName, EventTracker
Expand Down Expand Up @@ -67,9 +60,6 @@ def handle_parse_result(self, ctx, opts, args):

_validate_build_command_parameters(command_name, opts)

if not _check_experimental_flag(hook_name, command_name, opts, ctx.default_map):
return super().handle_parse_result(ctx, opts, args)

try:
self._call_prepare_hook(iac_hook_wrapper, opts, ctx)
except Exception as ex:
Expand Down Expand Up @@ -149,79 +139,6 @@ def _validate_build_command_parameters(command_name, opts):
)


def _check_experimental_flag(hook_name, command_name, opts, default_map):
# check beta-feature
experimental_entry = ExperimentalFlag.IaCsSupport.get(hook_name)
beta_features = _get_customer_input_beta_features_option(default_map, experimental_entry, opts)

# check if beta feature flag is required for a specific hook package
# The IaCs support experimental flag map will contain only the beta IaCs. In case we support the external
# hooks, we need to first know that the hook package is an external, and to handle the beta feature of it
# using different approach
if beta_features is None and experimental_entry is not None:
iac_support_message = _get_iac_support_experimental_prompt_message(hook_name, command_name)
if not prompt_experimental(experimental_entry, iac_support_message):
LOG.debug("Experimental flag is disabled and prepare hook is not run")
return False
elif not beta_features:
LOG.debug("--beta-features flag is disabled and prepare hook is not run")
return False
elif beta_features:
LOG.debug("--beta-features flag is enabled, enabling experimental flag.")
set_experimental(experimental_entry, True)
update_experimental_context()
return True


def _get_customer_input_beta_features_option(default_map, experimental_entry, opts):
# Get the beta-features flag value from the command parameters if provided.
beta_features = opts.get("beta_features")
if beta_features is not None:
return beta_features

# Get the beta-features flag value from the SamConfig file if provided.
beta_features = default_map.get("beta_features")
if beta_features is not None:
return beta_features

# Get the beta-features flag value from the environment variables.
if experimental_entry:
gc = GlobalConfig()
beta_features = gc.get_value(experimental_entry, default=None, value_type=bool, is_flag=True)
if beta_features is not None:
return beta_features
return gc.get_value(ExperimentalFlag.All, default=None, value_type=bool, is_flag=True)

return None


def _get_iac_support_experimental_prompt_message(hook_name: str, command: str) -> str:
"""
return the customer prompt message for a specific hook package.
Parameters
----------
hook_name: str
the hook name to determine what is the supported iac
command: str
the current sam command
Returns
-------
str
the customer prompt message for a specific IaC.
"""

supported_iacs_messages = {
"terraform": (
"Supporting Terraform applications is a beta feature.\n"
"Please confirm if you would like to proceed using AWS SAM CLI with terraform application.\n"
f"You can also enable this beta feature with 'sam {command} --beta-features'."
)
}
return supported_iacs_messages.get(hook_name, "")


def _read_parameter_value(param_name, opts, ctx, default_value=None):
"""
Read SAM CLI parameter value either from the parameters list or from the samconfig values
Expand Down
8 changes: 0 additions & 8 deletions samcli/commands/build/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import click

from samcli.cli.context import Context
from samcli.commands._utils.experimental import ExperimentalFlag, is_experimental_enabled
from samcli.commands._utils.options import (
skip_prepare_infra_option,
template_option_without_build,
Expand Down Expand Up @@ -220,13 +219,6 @@ def do_cli( # pylint: disable=too-many-locals, too-many-statements
"""
Implementation of the ``cli`` method
"""
if (
hook_name
and ExperimentalFlag.IaCsSupport.get(hook_name) is not None
and not is_experimental_enabled(ExperimentalFlag.IaCsSupport[hook_name])
):
LOG.info("Terraform Support beta feature is not enabled.")
return

from samcli.commands.build.build_context import BuildContext

Expand Down
9 changes: 0 additions & 9 deletions samcli/commands/local/invoke/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from samcli.cli.cli_config_file import ConfigProvider, configuration_option
from samcli.cli.main import aws_creds_options, pass_context, print_cmdline_args
from samcli.cli.main import common_options as cli_framework_options
from samcli.commands._utils.experimental import ExperimentalFlag, is_experimental_enabled
from samcli.commands._utils.option_value_processor import process_image_options
from samcli.commands._utils.options import hook_name_click_option, skip_prepare_infra_option, terraform_plan_file_option
from samcli.commands.local.cli_common.options import invoke_common_options, local_common_options
Expand Down Expand Up @@ -162,14 +161,6 @@ def do_cli( # pylint: disable=R0914
from samcli.local.docker.manager import DockerImagePullFailedException
from samcli.local.lambdafn.exceptions import FunctionNotFound

if (
hook_name
and ExperimentalFlag.IaCsSupport.get(hook_name) is not None
and not is_experimental_enabled(ExperimentalFlag.IaCsSupport.get(hook_name))
):
LOG.info("Terraform Support beta feature is not enabled.")
return

LOG.debug("local invoke command is called")

if event:
Expand Down
9 changes: 0 additions & 9 deletions samcli/commands/local/start_api/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from samcli.cli.cli_config_file import ConfigProvider, configuration_option
from samcli.cli.main import aws_creds_options, pass_context, print_cmdline_args
from samcli.cli.main import common_options as cli_framework_options
from samcli.commands._utils.experimental import ExperimentalFlag, is_experimental_enabled
from samcli.commands._utils.option_value_processor import process_image_options
from samcli.commands._utils.options import (
generate_next_command_recommendation,
Expand Down Expand Up @@ -186,14 +185,6 @@ def do_cli( # pylint: disable=R0914

LOG.debug("local start-api command is called")

if (
hook_name
and ExperimentalFlag.IaCsSupport.get(hook_name) is not None
and not is_experimental_enabled(ExperimentalFlag.IaCsSupport.get(hook_name))
):
LOG.info("Terraform Support beta feature is not enabled.")
return

processed_invoke_images = process_image_options(invoke_image)

# Pass all inputs to setup necessary context to invoke function locally.
Expand Down
9 changes: 0 additions & 9 deletions samcli/commands/local/start_lambda/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from samcli.cli.cli_config_file import ConfigProvider, configuration_option
from samcli.cli.main import aws_creds_options, pass_context, print_cmdline_args
from samcli.cli.main import common_options as cli_framework_options
from samcli.commands._utils.experimental import ExperimentalFlag, is_experimental_enabled
from samcli.commands._utils.option_value_processor import process_image_options
from samcli.commands._utils.options import (
generate_next_command_recommendation,
Expand Down Expand Up @@ -169,14 +168,6 @@ def do_cli( # pylint: disable=R0914
from samcli.lib.providers.exceptions import InvalidLayerReference
from samcli.local.docker.lambda_debug_settings import DebuggingNotSupported

if (
hook_name
and ExperimentalFlag.IaCsSupport.get(hook_name) is not None
and not is_experimental_enabled(ExperimentalFlag.IaCsSupport.get(hook_name))
):
LOG.info("Terraform Support beta feature is not enabled.")
return

LOG.debug("local start_lambda command is called")

processed_invoke_images = process_image_options(invoke_image)
Expand Down
5 changes: 5 additions & 0 deletions samcli/hook_packages/terraform/hooks/prepare/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,8 @@
TF_AWS_API_GATEWAY_INTEGRATION = "aws_api_gateway_integration"
TF_AWS_API_GATEWAY_AUTHORIZER = "aws_api_gateway_authorizer"
TF_AWS_API_GATEWAY_INTEGRATION_RESPONSE = "aws_api_gateway_method_response"
TF_AWS_API_GATEWAY_V2_API = "aws_apigatewayv2_api"
TF_AWS_API_GATEWAY_V2_ROUTE = "aws_apigatewayv2_route"
TF_AWS_API_GATEWAY_V2_STAGE = "aws_apigatewayv2_stage"
TF_AWS_API_GATEWAY_V2_INTEGRATION = "aws_apigatewayv2_integration"
TF_AWS_API_GATEWAY_V2_AUTHORIZER = "aws_apigatewayv2_authorizer"
120 changes: 120 additions & 0 deletions samcli/hook_packages/terraform/hooks/prepare/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,126 @@ class GatewayMethodToGatewayAuthorizerLocalVariablesLinkingLimitationException(
"""


class OneGatewayV2RouteToGatewayV2IntegrationLinkingLimitationException(OneResourceLinkingLimitationException):
"""
Exception specific for Gateway V2 Route linking to more than one Gateway V2 Integration
"""


class GatewayV2RouteToGatewayV2IntegrationLocalVariablesLinkingLimitationException(
LocalVariablesLinkingLimitationException
):
"""
Exception specific for Gateway V2 Route linking to Gateway V2 Integration using locals.
"""


class OneGatewayV2IntegrationToLambdaFunctionLinkingLimitationException(OneResourceLinkingLimitationException):
"""
Exception specific for Gateway V2 Integration linking to more than one Lambda function
"""


class GatewayV2IntegrationToLambdaFunctionLocalVariablesLinkingLimitationException(
LocalVariablesLinkingLimitationException
):
"""
Exception specific for Gateway V2 Integration linking to Lambda Function using locals.
"""


class OneGatewayV2IntegrationToGatewayV2ApiLinkingLimitationException(OneResourceLinkingLimitationException):
"""
Exception specific for Gateway V2 Integration linking to more than one Gateway V2 API
"""


class GatewayV2IntegrationToGatewayV2ApiLocalVariablesLinkingLimitationException(
LocalVariablesLinkingLimitationException
):
"""
Exception specific for Gateway V2 Integration linking to Gateway V2 API using locals.
"""


class OneGatewayV2RouteToGatewayV2ApiLinkingLimitationException(OneResourceLinkingLimitationException):
"""
Exception specific for Gateway V2 Route linking to more than one Gateway V2 API
"""


class GatewayV2RouteToGatewayV2ApiLocalVariablesLinkingLimitationException(LocalVariablesLinkingLimitationException):
"""
Exception specific for Gateway V2 Route linking to Gateway V2 API using locals.
"""


class OneGatewayV2AuthorizerToLambdaFunctionLinkingLimitationException(OneResourceLinkingLimitationException):
"""
Exception specific for Gateway V2 Authorizer linking to more than one Lambda Function
"""


class GatewayV2AuthorizerToLambdaFunctionLocalVariablesLinkingLimitationException(
LocalVariablesLinkingLimitationException
):
"""
Exception specific for Gateway V2 Authorizer linking to Lambda Function using locals.
"""


class OneGatewayV2AuthorizerToGatewayV2ApiLinkingLimitationException(OneResourceLinkingLimitationException):
"""
Exception specific for Gateway V2 Authorizer linking to more than one Gateway V2 API
"""


class GatewayV2AuthorizerToGatewayV2ApiLocalVariablesLinkingLimitationException(
LocalVariablesLinkingLimitationException
):
"""
Exception specific for Gateway V2 Authorizer linking to Gateway V2 API using locals.
"""


class OneGatewayV2ApiToLambdaFunctionLinkingLimitationException(OneResourceLinkingLimitationException):
"""
Exception specific for Gateway V2 API linking to more than one Lambda Function
"""


class GatewayV2ApiToLambdaFunctionLocalVariablesLinkingLimitationException(LocalVariablesLinkingLimitationException):
"""
Exception specific for Gateway V2 API linking to Lambda Function using locals.
"""


class OneGatewayV2StageToGatewayV2ApiLinkingLimitationException(OneResourceLinkingLimitationException):
"""
Exception specific for Gateway V2 Stage linking to more than one Gateway V2 API
"""


class GatewayV2StageToGatewayV2ApiLocalVariablesLinkingLimitationException(LocalVariablesLinkingLimitationException):
"""
Exception specific for Gateway V2 Stage linking to Gateway V2 API using locals.
"""


class OneGatewayV2RouteToGatewayV2AuthorizerLinkingLimitationException(OneResourceLinkingLimitationException):
"""
Exception specific for Gateway V2 Route linking to more than one Gateway V2 Authorizer
"""


class GatewayV2RouteToGatewayV2AuthorizerLocalVariablesLinkingLimitationException(
LocalVariablesLinkingLimitationException
):
"""
Exception specific for Gateway V2 Route linking to Gateway V2 Authorizer using locals.
"""


class InvalidSamMetadataPropertiesException(UserException):
pass

Expand Down
Loading

0 comments on commit a4a0633

Please sign in to comment.