cask

command module
v0.0.0-...-c586f74 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

README

cask: easy custodian exec via docker

custodian-cask is a Go wrapper over the cloudcustodian/c7n Docker image. It allows you to use the docker image with the same CLI you would use for a local Custodian installation.

This can be useful in situations where you would like to ensure a working CLI without requiring Python or package dependencies.

Install

Linux

sudo sh -c 'wget -q https://cloudcustodian.io/downloads/custodian-cask/linux-latest/custodian-cask -O /usr/local/bin/custodian-cask && chmod +x /usr/local/bin/custodian-cask'

MacOS (Darwin)

sudo sh -c '(cd /usr/local/bin && curl -fsSLO https://cloudcustodian.io/downloads/custodian-cask/darwin-latest/custodian-cask && chmod +x /usr/local/bin/custodian-cask)'

Windows (cmd.exe)

@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/cloud-custodian/cloud-custodian/master/tools/cask/scripts/install.ps1'))" && SET "PATH=%PATH%;%LOCALAPPDATA%\custodian\"

Windows (powershell.exe)

Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/cloud-custodian/cloud-custodian/master/tools/cask/scripts/install.ps1'))

Run

custodian-cask run -s . policy.yml

You may override the default docker image with the environment variable CUSTODIAN_IMAGE

Cask will only attempt to pull any specific image once per hour.
You can delete $(tmp)\custodian-cask* if you'd like to force an update.

Build

cd cloud-custodian\tools\custodian-cask
go build -o custodian-cask

Alternatively

make darwin
make linux
make windows

Documentation

Overview

Copyright 2019 Microsoft Corporation

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

The package provides a transparent pass-through for the Custodian CLI to a Custodian Docker Image

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL