agent-claw: automated task changes
This commit is contained in:
26
cdk/node_modules/aws-cdk/lib/init-templates/sample-app/python/%name.PythonModule%/%name.PythonModule%_stack.template.py
generated
vendored
Normal file
26
cdk/node_modules/aws-cdk/lib/init-templates/sample-app/python/%name.PythonModule%/%name.PythonModule%_stack.template.py
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
from constructs import Construct
|
||||
from aws_cdk import (
|
||||
Duration,
|
||||
Stack,
|
||||
aws_iam as iam,
|
||||
aws_sqs as sqs,
|
||||
aws_sns as sns,
|
||||
aws_sns_subscriptions as subs,
|
||||
)
|
||||
|
||||
|
||||
class %name.PascalCased%Stack(Stack):
|
||||
|
||||
def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None:
|
||||
super().__init__(scope, construct_id, **kwargs)
|
||||
|
||||
queue = sqs.Queue(
|
||||
self, "%name.PascalCased%Queue",
|
||||
visibility_timeout=Duration.seconds(300),
|
||||
)
|
||||
|
||||
topic = sns.Topic(
|
||||
self, "%name.PascalCased%Topic"
|
||||
)
|
||||
|
||||
topic.add_subscription(subs.SqsSubscription(queue))
|
||||
0
cdk/node_modules/aws-cdk/lib/init-templates/sample-app/python/%name.PythonModule%/__init__.py
generated
vendored
Normal file
0
cdk/node_modules/aws-cdk/lib/init-templates/sample-app/python/%name.PythonModule%/__init__.py
generated
vendored
Normal file
22
cdk/node_modules/aws-cdk/lib/init-templates/sample-app/python/.template.gitignore
generated
vendored
Normal file
22
cdk/node_modules/aws-cdk/lib/init-templates/sample-app/python/.template.gitignore
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
*.swp
|
||||
package-lock.json
|
||||
.pytest_cache
|
||||
*.egg-info
|
||||
|
||||
# Byte-compiled / optimized / DLL files
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
|
||||
# Environments
|
||||
.env
|
||||
.venv
|
||||
env/
|
||||
venv/
|
||||
ENV/
|
||||
env.bak/
|
||||
venv.bak/
|
||||
|
||||
# CDK Context & Staging files
|
||||
.cdk.staging/
|
||||
cdk.out/
|
||||
65
cdk/node_modules/aws-cdk/lib/init-templates/sample-app/python/README.template.md
generated
vendored
Normal file
65
cdk/node_modules/aws-cdk/lib/init-templates/sample-app/python/README.template.md
generated
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
|
||||
# Welcome to your CDK Python project!
|
||||
|
||||
You should explore the contents of this project. It demonstrates a CDK app with an instance of a stack (`%name.PythonModule%_stack`)
|
||||
which contains an Amazon SQS queue that is subscribed to an Amazon SNS topic.
|
||||
|
||||
The `cdk.json` file tells the CDK Toolkit how to execute your app.
|
||||
|
||||
This project is set up like a standard Python project. The initialization process also creates
|
||||
a virtualenv within this project, stored under the .venv directory. To create the virtualenv
|
||||
it assumes that there is a `python3` executable in your path with access to the `venv` package.
|
||||
If for any reason the automatic creation of the virtualenv fails, you can create the virtualenv
|
||||
manually once the init process completes.
|
||||
|
||||
To manually create a virtualenv on MacOS and Linux:
|
||||
|
||||
```
|
||||
$ %python-executable% -m venv .venv
|
||||
```
|
||||
|
||||
After the init process completes and the virtualenv is created, you can use the following
|
||||
step to activate your virtualenv.
|
||||
|
||||
```
|
||||
$ source .venv/bin/activate
|
||||
```
|
||||
|
||||
If you are a Windows platform, you would activate the virtualenv like this:
|
||||
|
||||
```
|
||||
% .venv\Scripts\activate.bat
|
||||
```
|
||||
|
||||
Once the virtualenv is activated, you can install the required dependencies.
|
||||
|
||||
```
|
||||
$ pip install -r requirements.txt
|
||||
```
|
||||
|
||||
At this point you can now synthesize the CloudFormation template for this code.
|
||||
|
||||
```
|
||||
$ cdk synth
|
||||
```
|
||||
|
||||
You can now begin exploring the source code, contained in the hello directory.
|
||||
There is also a very trivial test included that can be run like this:
|
||||
|
||||
```
|
||||
$ pytest
|
||||
```
|
||||
|
||||
To add additional dependencies, for example other CDK libraries, just add to
|
||||
your requirements.txt file and rerun the `pip install -r requirements.txt`
|
||||
command.
|
||||
|
||||
## Useful commands
|
||||
|
||||
* `cdk ls` list all stacks in the app
|
||||
* `cdk synth` emits the synthesized CloudFormation template
|
||||
* `cdk deploy` deploy this stack to your default AWS account/region
|
||||
* `cdk diff` compare deployed stack with current state
|
||||
* `cdk docs` open CDK documentation
|
||||
|
||||
Enjoy!
|
||||
11
cdk/node_modules/aws-cdk/lib/init-templates/sample-app/python/app.template.py
generated
vendored
Normal file
11
cdk/node_modules/aws-cdk/lib/init-templates/sample-app/python/app.template.py
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import aws_cdk as cdk
|
||||
|
||||
from %name.PythonModule%.%name.PythonModule%_stack import %name.PascalCased%Stack
|
||||
|
||||
|
||||
app = cdk.App()
|
||||
%name.PascalCased%Stack(app, "%stackname%")
|
||||
|
||||
app.synth()
|
||||
15
cdk/node_modules/aws-cdk/lib/init-templates/sample-app/python/cdk.template.json
generated
vendored
Normal file
15
cdk/node_modules/aws-cdk/lib/init-templates/sample-app/python/cdk.template.json
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"app": "%python-executable% app.py",
|
||||
"watch": {
|
||||
"include": ["**"],
|
||||
"exclude": [
|
||||
"README.md",
|
||||
"cdk*.json",
|
||||
"requirements*.txt",
|
||||
"source.bat",
|
||||
"**/__init__.py",
|
||||
"python/__pycache__",
|
||||
"tests"
|
||||
]
|
||||
}
|
||||
}
|
||||
1
cdk/node_modules/aws-cdk/lib/init-templates/sample-app/python/requirements-dev.txt
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk/lib/init-templates/sample-app/python/requirements-dev.txt
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
pytest==8.4.2
|
||||
2
cdk/node_modules/aws-cdk/lib/init-templates/sample-app/python/requirements.txt
generated
vendored
Normal file
2
cdk/node_modules/aws-cdk/lib/init-templates/sample-app/python/requirements.txt
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
aws-cdk-lib%cdk-version%
|
||||
constructs%constructs-version%
|
||||
13
cdk/node_modules/aws-cdk/lib/init-templates/sample-app/python/source.bat
generated
vendored
Normal file
13
cdk/node_modules/aws-cdk/lib/init-templates/sample-app/python/source.bat
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
@echo off
|
||||
|
||||
rem The sole purpose of this script is to make the command
|
||||
rem
|
||||
rem source .venv/bin/activate
|
||||
rem
|
||||
rem (which activates a Python virtualenv on Linux or Mac OS X) work on Windows.
|
||||
rem On Windows, this command just runs this batch file (the argument is ignored).
|
||||
rem
|
||||
rem Now we don't need to document a Windows command for activating a virtualenv.
|
||||
|
||||
echo Executing .venv\Scripts\activate.bat for you
|
||||
.venv\Scripts\activate.bat
|
||||
0
cdk/node_modules/aws-cdk/lib/init-templates/sample-app/python/tests/__init__.py
generated
vendored
Normal file
0
cdk/node_modules/aws-cdk/lib/init-templates/sample-app/python/tests/__init__.py
generated
vendored
Normal file
0
cdk/node_modules/aws-cdk/lib/init-templates/sample-app/python/tests/unit/__init__.py
generated
vendored
Normal file
0
cdk/node_modules/aws-cdk/lib/init-templates/sample-app/python/tests/unit/__init__.py
generated
vendored
Normal file
21
cdk/node_modules/aws-cdk/lib/init-templates/sample-app/python/tests/unit/test_%name.PythonModule%_stack.template.py
generated
vendored
Normal file
21
cdk/node_modules/aws-cdk/lib/init-templates/sample-app/python/tests/unit/test_%name.PythonModule%_stack.template.py
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
import aws_cdk as core
|
||||
import aws_cdk.assertions as assertions
|
||||
from %name.PythonModule%.%name.PythonModule%_stack import %name.PascalCased%Stack
|
||||
|
||||
|
||||
def test_sqs_queue_created():
|
||||
app = core.App()
|
||||
stack = %name.PascalCased%Stack(app, "%name.StackName%")
|
||||
template = assertions.Template.from_stack(stack)
|
||||
|
||||
template.has_resource_properties("AWS::SQS::Queue", {
|
||||
"VisibilityTimeout": 300
|
||||
})
|
||||
|
||||
|
||||
def test_sns_topic_created():
|
||||
app = core.App()
|
||||
stack = %name.PascalCased%Stack(app, "%name.StackName%")
|
||||
template = assertions.Template.from_stack(stack)
|
||||
|
||||
template.resource_count_is("AWS::SNS::Topic", 1)
|
||||
Reference in New Issue
Block a user