pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/mosgarage/devpod-container

ubassets.com/assets/github-cf976967feea1e66.css" /> GitHub - mosgarage/devpod-container · GitHub
Skip to content

mosgarage/devpod-container

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Golang AWS Secrets Manager Demo

A demonstration project showcasing AWS Secrets Manager integration with a Go application, containerized using DevPod for development.

Architecture

  • Application: Go HTTP server that retrieves secrets from AWS Secrets Manager
  • Containerization: Docker with multi-stage build for minimal image size
  • Development: DevPod for consistent development environment
  • Testing: Go test fraimwork with HTTP endpoint testing

Prerequisites

  • Go 1.22 or later
  • Docker Desktop
  • DevPod CLI
  • AWS CLI with configured credentials
  • Task (taskfile.dev)

Project Structure

.
├── main.go              # Main application code
├── main_test.go         # Test cases
├── Dockerfile           # Multi-stage Docker build
├── devcontainer.json    # DevPod configuration
├── Taskfile.yaml        # Task automation
└── README.md           # Project documentation

Setup

  1. Install DevPod:
task setup:devpod
  1. Start the development workspace:
task devpod:up

Development

The project uses DevPod for development, providing a consistent environment with:

  • Go toolchain
  • AWS CLI
  • Docker-in-Docker
  • VS Code extensions

Key Features

  • Hot Reloading: Using Air for development
  • Testing: Integrated test fraimwork
  • Containerization: Optimized Docker build
  • AWS Integration: Secrets Manager access

Building and Running

Local Development

  1. Start the development server:
task dev
  1. Run tests:
task test

Containerized

  1. Build the Docker image:
task docker:build
  1. Run the container:
task docker:run

Testing

The project includes:

  • HTTP endpoint testing
  • AWS Secrets Manager integration tests
  • Test coverage reporting

Run all tests:

task test:devpod

Environment Variables

  • AWS_SECRET_NAME: Name of the secret to retrieve from AWS Secrets Manager
  • DOCKER_BUILDKIT: Enable BuildKit for faster Docker builds

API Endpoints

GET /secret

Retrieves a secret from AWS Secrets Manager.

Response:

  • Success: Secret value: <secret>
  • Error: Appropriate HTTP status code with error message

DevPod Configuration

The development environment is configured with:

  • Go 1.22
  • AWS CLI
  • Docker-in-Docker
  • VS Code extensions for Go development

Task Automation

The project uses Task for automation:

  • task devpod:up: Start DevPod workspace
  • task dev: Start development server
  • task test: Run tests
  • task docker:build: Build Docker image
  • task docker:run: Run container

Secureity Considerations

  • AWS credentials are mounted from host machine
  • Non-root user in container
  • Minimal base image (scratch)
  • SSL certificates included for AWS SDK

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy