Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer/scripts/postCreate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -euo pipefail
echo "🔧 Installing devcontainer CLI..."
npm install -g @devcontainers/cli

FEATURES=("ag" "amazon-q-cli" "gcloud-cli" "zip")
FEATURES=("ag" "amazon-q-cli" "aws-sam-cli" "gcloud-cli" "zip")
BASE_IMAGES=("debian:latest" "ubuntu:latest" "mcr.microsoft.com/devcontainers/base:ubuntu")

# Run autogenerated tests for each image
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
features:
- ag
- amazon-q-cli
- aws-sam-cli
- gcloud-cli
- zip
baseImage:
Expand All @@ -38,6 +39,8 @@ jobs:
features:
- ag
- amazon-q-cli
- aws-sam-cli
- gcloud-cli
- zip
steps:
- uses: actions/checkout@v4
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ This repository contains following features:

- [ag](./src/ag/README.md): Installs ag (The Silver Searcher), a fast grep-like text search tool
- [amazon-q-cli](./src/amazon-q-cli/README.md): Install Amazon Q CLI for AWS development
- [aws-sam-cli](./src/aws-sam-cli/README.md): Installs AWS SAM CLI for serverless application development
- [gcloud-cli](./src/gcloud-cli/README.md): Installs Google Cloud CLI (gcloud) for Google Cloud Platform development
- [zip](./src/zip/README.md): Installs zip and unzip CLI tools for compression and extraction

Expand All @@ -21,6 +22,7 @@ These examples show how to use features from this repository in a devcontainer:
"features": {
"ghcr.io/jajera/features/ag:1": {},
"ghcr.io/jajera/features/amazon-q-cli:1": {},
"ghcr.io/jajera/features/aws-sam-cli:1": {},
"ghcr.io/jajera/features/gcloud-cli:1": {},
"ghcr.io/jajera/features/zip:1": {}
}
Expand Down Expand Up @@ -52,6 +54,10 @@ Similar to the [`devcontainers/features`](https://github.com/devcontainers/featu
│ │ ├── devcontainer-feature.json
│ │ ├── install.sh
│ │ └── README.md
│ ├── aws-sam-cli
│ │ ├── devcontainer-feature.json
│ │ ├── install.sh
│ │ └── README.md
│ ├── gcloud-cli
│ │ ├── devcontainer-feature.json
│ │ ├── install.sh
Expand All @@ -63,6 +69,7 @@ Similar to the [`devcontainers/features`](https://github.com/devcontainers/featu
├── test
│ ├── ag
│ ├── amazon-q-cli
│ ├── aws-sam-cli
│ ├── gcloud-cli
│ └── zip
...
Expand Down
75 changes: 75 additions & 0 deletions src/aws-sam-cli/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# AWS SAM CLI (aws-sam-cli)

Install [AWS SAM CLI](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/install-sam-cli.html) - AWS Serverless Application Model CLI for serverless application development.

## Example Usage

```json
"features": {
"ghcr.io/jajera/features/aws-sam-cli:1": {}
}
```

## Options

| Options Id | Description | Type | Default Value |
|-----|-----|-----|-----|
| version | Select or enter a AWS SAM CLI version | string | latest |

## Installation Details

This feature automatically:

- **Detects system architecture** (x86_64, aarch64) and operating system
- **Downloads appropriate binary** for your system (Linux or macOS)
- **Installs for both root and non-root users**:
- Root: Installs to `/usr/local/bin` with system-wide bash completion
- Non-root: Installs to `~/.local/bin` with user-specific bash completion
- **Sets up bash completion** automatically
- **Handles dependencies** (curl, unzip) with appropriate privilege handling

## Supported Platforms

- **Operating Systems**: Linux, macOS
- **Architectures**: x86_64 (Intel/AMD 64-bit), aarch64 (ARM 64-bit)
- **Base Images**: Tested on Debian, Ubuntu, and Microsoft DevContainer base images
- **User Contexts**: Works as both root and non-root users

## Commands Available

After installation, the following commands are available:

- `sam` - Main AWS SAM CLI command for serverless application development

## Common SAM CLI Commands

```bash
# Initialize a new SAM application
sam init

# Build your SAM application
sam build

# Deploy your SAM application
sam deploy

# Start local API Gateway
sam local start-api

# Invoke a function locally
sam local invoke

# Validate SAM template
sam validate
```

## Compatibility

- **Package Management**: Uses apt-get (Debian/Ubuntu), yum (RHEL/CentOS), or Homebrew (macOS) with appropriate privileges
- **PATH**: Automatically adds `~/.local/bin` to PATH for non-root installations
- **Dependencies**: Automatically installs curl and unzip if not present

## Reference

- [AWS SAM CLI Documentation](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/install-sam-cli.html)
- [AWS SAM CLI GitHub Repository](https://github.com/aws/aws-sam-cli)
10 changes: 10 additions & 0 deletions src/aws-sam-cli/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "AWS SAM CLI",
"id": "aws-sam-cli",
"version": "1.0.0",
"description": "Installs AWS SAM CLI for serverless application development",
"documentationURL": "https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/install-sam-cli.html",
"installsAfter": [
"ghcr.io/devcontainers/features/common-utils"
]
}
Loading