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
8 changes: 4 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
- uses: actions/setup-go@v5
with:
go-version: 1.18
- uses: actions/checkout@v3
go-version: "1.24"
- uses: actions/checkout@v4
- name: golangci-lint
uses: golangci/golangci-lint-action@v3.1.0
with:
Expand All @@ -38,4 +38,4 @@ jobs:
# skip-pkg-cache: true

# Optional: if set to true then the action don't cache or restore ~/.cache/go-build.
# skip-build-cache: true
# skip-build-cache: true
19 changes: 8 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,23 @@ name: release
on:
push:
tags:
- 'v*'
- "v*"
jobs:
goreleaser:
permissions: write-all
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Set up Go
uses: actions/setup-go@v3
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.18
-
name: Run GoReleaser
go-version: "1.24"
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
version: "~> v2"
args: release --clean
env:
# GitHub sets this automatically
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ linters-settings:

run:
timeout: 25m
go: "1.18"
go: "1.24"
24 changes: 17 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
# Infinity Next Terraform CLI

The project provides a command line interface for using the API of Infinity Next

## Generating an API Key *(Required)*
## Generating an API Key _(Required)_

If already have an API key from setting up [terraform-provider-infinity-next](https://github.com/CheckPointSW/terraform-provider-infinity-next) then you can skip this section.
1. Go to https://portal.checkpoint.com, navigate to *Global Settings -> API Keys*

2. Create a new API key and select *Infinity Policy* as the service, with *Admin* role, we recommend that you specify a meaningful comment for the key so you could identify them later and avoid mistakes.
1. Go to https://portal.checkpoint.com, navigate to _Global Settings -> API Keys_

2. Create a new API key and select _Infinity Policy_ as the service, with _Admin_ role, we recommend that you specify a meaningful comment for the key so you could identify them later and avoid mistakes.

3. Store the *Client ID* and *Secret Key* in a secure location, and note there's no way to view the secret key afterward.
3. Store the _Client ID_ and _Secret Key_ in a secure location, and note there's no way to view the secret key afterward.

## Usage

Download and install the CLI found in the [latest release](https://github.com/CheckPointSW/infinity-next-terraform-cli/releases/latest)

You could run `inext help` and get all available options and commands.

The CLI requires the same credentials used to configure the provider, there are 3 options to pass these credentials to the CLI:

1. Set the environment variables: `INEXT_REGION`, `INEXT_CLIENT_ID` and `INEXT_ACCESS_KEY` and run `inext <command>`, this is more comfortable for usage right after `terraform apply` since it uses the same environment variables.

2. Set credentials using flags `--client-id` (shorthand `-c`) and `--access-key` (shorthand `-k`)

```
inext publish -c $INEXT_CLIENT_ID -k $INEXT_ACCESS_KEY -r us
```
Expand All @@ -32,19 +36,25 @@ The CLI requires the same credentials used to configure the provider, there are
Run `inext <command>` and the CLI would be configured using `~/.inext.yaml` by default, can be set using `inext --config <config-path> <command>`

## Example

```
inext publish && inext enforce
```

## Build

### Requirements
* Go 1.18+

- Go 1.24+

To build the CLI run:

```
go build -o inext
```

You could then install it by running:

```
cp inext /usr/local/bin
```
```
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ module github.com/CheckPointSW/infinity-next-terraform-cli

go 1.24.0

toolchain go1.24.2

require (
github.com/golang-jwt/jwt/v5 v5.3.0
github.com/spf13/cobra v1.10.1
Expand Down
Loading