- Più recenti
- Maggior numero di voti
- Maggior numero di commenti
The best way to go about this would be to use the AWS CDK to create a CloudFormation template that will replicate the existing resources in your AWS environment. This template can then be used to create a local version of the environment using the AWS CDK.
To create the CloudFormation template, you can use the AWS CDK to generate the necessary code from your existing resources. You can do this by running the following commands in the AWS CLI:
To generate the CloudFormation template for an API Gateway:
aws cloudformation export-stack-template --stack-name <stack_name> --output text > <output_file_name>
To generate the CloudFormation template for a Lambda Function:
aws cloudformation export-stack-template --stack-name <lambda_function_name> --output text > <output_file_name>
To generate the CloudFormation template for a DynamoDB instance:
aws cloudformation export-stack-template --stack-name <dynamodb_table_name> --output text > <output_file_name>
Once you have the CloudFormation templates for each of your resources, you can then use
thanks for you fast reply !
sudo aws cloudformation export-stack-template --stack-name 9nc4das --output-text apigw.txt
usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters]
To see help text, you can run:
aws help
aws <command> help
aws <command> <subcommand> help
aws: error: argument operation: Invalid choice, valid choices are:
activate-type | batch-describe-type-configurations
cancel-update-stack | continue-update-rollback
create-change-set | create-stack
create-stack-instances | create-stack-set
deactivate-type | delete-change-set
delete-stack | delete-stack-instances
delete-stack-set | deregister-type
describe-account-limits | describe-change-set
describe-change-set-hooks | describe-publisher
describe-stack-drift-detection-status | describe-stack-events
describe-stack-instance | describe-stack-resource
describe-stack-resource-drifts | describe-stack-resources
describe-stack-set | describe-stack-set-operation
describe-stacks | describe-type
describe-type-registration | detect-stack-drift
detect-stack-resource-drift | detect-stack-set-drift
estimate-template-cost | execute-change-set
get-stack-policy | get-template
get-template-summary | import-stacks-to-stack-set
list-change-sets | list-exports
list-imports | list-stack-instances
list-stack-resources | list-stack-set-operation-results
list-stack-set-operations | list-stack-sets
list-stacks | list-type-registrations
list-type-versions | list-types
publish-type | record-handler-progress
register-publisher | register-type
rollback-stack | set-stack-policy
set-type-configuration | set-type-default-version
signal-resource | stop-stack-set-operation
test-type | update-stack
update-stack-instances | update-stack-set
update-termination-protection | validate-template
package | deploy
wait | help
I made sure im using the last version following aws documentation: https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html#getting-started-install-instructions
usre@a-len:~/myapi$ sudo aws --version
aws-cli/2.9.20 Python/3.9.11 Linux/5.15.0-58-generic exe/x86_64.ubuntu.22 prompt/off
Contenuto pertinente
- AWS UFFICIALEAggiornata 2 anni fa
- AWS UFFICIALEAggiornata un anno fa