https://github.com/yakdriver/claudocreate
Bedrock, Claude, Docs, Battlestar Gallactica
https://github.com/yakdriver/claudocreate
Last synced: 11 months ago
JSON representation
Bedrock, Claude, Docs, Battlestar Gallactica
- Host: GitHub
- URL: https://github.com/yakdriver/claudocreate
- Owner: YakDriver
- License: mpl-2.0
- Created: 2025-02-25T19:57:43.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-25T20:16:29.000Z (over 1 year ago)
- Last Synced: 2025-02-25T21:18:34.563Z (over 1 year ago)
- Language: Python
- Size: 465 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# Generate Terraform AWS Provider Documentation with Bedrock and Anthropic Computer Use
This solution will generate Terraform AWS Provider resource documentation for the specified AWS resource, using Amazon Bedrock, Anthropic Claude 3.5 Sonnet v2, and Anthropic Computer Use.
The implementation of Anthropic Computer Use is adopted from [Anthropic Quickstarts](https://github.com/anthropics/anthropic-quickstarts/tree/main/computer-use-demo) - MIT License.

Features:
* Full orchestration of resource lifecycle (creation, testing, destruction)
* Automated validation using `terraform apply`
* Auto-generated templates ready for Terraform AWS Provider repository pull requests
* Concurrent resource processing with error handling
* Comprehensive cleanup and artifact management
## Prerequisites
1. AWS Account with access to us-west-2 region (default)
2. Amazon Bedrock model access enabled for Claude 3.5 Sonnet v2. [How to enable Bedrock model access](https://docs.aws.amazon.com/bedrock/latest/userguide/model-access-modify.html) for `Claude 3.5 Sonnet v2 `.
If using Docker Desktop (tested on v4.35.1) you will need to disable "Use containerd for pulling and storing images" in Settings>General. ([github issue discussion](https://github.com/kreuzwerker/terraform-provider-docker/issues/534))
## Deployment
1. Clone Repository
2. Change to Terraform directory: `cd terraform`
3. Initalize Terraform: `terraform init`
4. Deploy Resources to your account: `terraform apply`
5. Ensure Amazon Bedrock model access is enabled.
This will create the required infrastructure in your AWS account.
## Usage
Invoke the Step Functions with a JSON payload containing target resources:
```json
{
"target_resources": [
"awscc_s3_bucket",
"awscc_iam_role",
"awscc_imagebuilder_workflow",
"awscc_iotwireless_network_analyzer_configuration",
"awscc_nimblestudio_studio_component",
"awscc_deadline_license_endpoint",
"awscc_datapipeline_pipeline"
]
}
```
You can invoke the Step Functions via the AWS Console, AWS SDK, or AWS CLI
* [Step Functions Start Execution Console Instructions](https://docs.aws.amazon.com/step-functions/latest/dg/getting-started.html)
* [Step Functions `StartExecution` AWS SDK Reference](https://docs.aws.amazon.com/step-functions/latest/apireference/API_StartExecution.html)
* [Step Functions `start-execution` AWS CLI Reference](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/stepfunctions/start-execution.html)
### AWS Step Functions Orchestration Script
The repo also includes a script which orchestrates AWS Step Functions execution and manages related S3 bucket operations. It starts a Step Function execution using input from resources.json, monitors the execution status, and downloads resulting artifacts from S3.The default region is set to `us-west-2` which you should update to the region used in your provider configuration.
```bash
./start_orchestration.sh
```
## Security Consideration
**IMPORTANT**: By default, this solution requires admin access for the Lambda function due to the diverse range of AWS resources that may need to be created and destroyed. To implement least privilege:
* Review the resources you plan to generate
* Modify the Lambda execution role with specific permissions
* Update the IAM policies accordingly
**State file**: By default, this solution will use local state file, which synced between stages (Create, Delete, Review, etc). If you need better state file management, we are open for ideas / pull request.
## Known issues
* **Service quotas**: some resource type might failed the test because account / region level limits / quotas such as VPC.
* **Timeout**: by default the solution will attempt to create / delete / update resource within 900 seconds. Some resource might take longer and can timeout.
* **Cleanup**: we made best effort to destroy the resource regardless if create / update successfull. There is still risk that the solution unable to completely destroy all resources. Re-run the destroy process separately.
## Architecture

This Step Functions workflow orchestrates a resource generation process through multiple stages using Lambda functions.
### Main Components
* **Map State (Inference)**: Processes input resources with a maximum concurrency of N (default is 1)
* **Sequential Processing Stages**:
1. CREATE - Initiates resource creation
2. DELETE - Handles resource cleanup
3. REVIEW - Performs resource review
4. CLEANER - Executes artifact cleanup
5. SUMMARY - Generates artifact summary
6. ARTIFACT - Final stage for artifact generation
### Workflow Stages
1. The workflow begins with an input of target resources
2. Each resource goes through CREATE → DELETE → REVIEW → CLEANER → SUMMARY stages
3. Successful completion generates artifacts in the final ARTIFACT stage
4. Failed operations are caught and handled with appropriate cleanup procedures
### Output Handling
* Successful operations produce target outputs
* Failed operations are marked with appropriate status and reason
* Final artifacts are generated based on successful resource processing
## Contributing
We hope this example would inspire you to create similar solution to fit your use-cases.
Contributions to bug fixes are welcome! Please feel free to submit a Pull Request.
See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information.
## Security
See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information.
## License
This library is licensed under the MIT-0 License. See the [LICENSE](LICENSE) file.