Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
c4f4496
DXE-5227 Changelog boilerplate
mgwoj Aug 6, 2025
0a3ac42
DXE-5181 Replace response edgegrid structs for namespace
Slonimskaia Jun 17, 2025
1dac648
SECKSD-27443 api definitions
BartlomiejAdamczyk Feb 11, 2025
661830b
SECKSD-27443 api definitions
BartlomiejAdamczyk Mar 26, 2025
760933d
SECKSD-27443 api definitions
BartlomiejAdamczyk Feb 11, 2025
1d5c3a6
BOTMAN-15495 fix rebase conflicts
rhegdeakamai Mar 27, 2025
b3f954a
BOTMAN-15495 fix rebase conflicts
rhegdeakamai Mar 27, 2025
a1a68d7
BOTMAN-15495 rebase and fix conflicts..
rhegdeakamai Mar 9, 2025
154e76d
BOTMAN-15495 removed duplicate edgerc config in operations.tf template
rhegdeakamai Mar 10, 2025
52e42e3
BOTMAN-15495 addressing review comments
rhegdeakamai Mar 10, 2025
6fd9e79
BOTMAN-15495 rebase and fix conflicts
rhegdeakamai Mar 11, 2025
1fe5892
BOTMAN-15495 fix formatting error
rhegdeakamai Mar 16, 2025
e15ed27
BOTMAN-15495 fix rebase coflicts
rhegdeakamai Mar 27, 2025
8a17e2c
BOTMAN-15495 fix address review comments
rhegdeakamai Mar 28, 2025
786b6b4
BOTMAN-15495 address review comments on moving operations terraform f…
rhegdeakamai Apr 8, 2025
c062ab5
BOTMAN-15495 address review comments on moving operations terraform f…
rhegdeakamai Apr 8, 2025
5684d3f
BOTMAN-15495 add version as part of input to terraform files
rhegdeakamai Apr 14, 2025
bffe202
BOTMAN-15495 add version as part of import
rhegdeakamai Apr 14, 2025
34ba690
BOTMAN-15495 address review comments
rhegdeakamai Apr 14, 2025
2a1a2d4
BOTMAN-15495 address review comments
rhegdeakamai Apr 14, 2025
b8eb194
BOTMAN-15495 address review comments
rhegdeakamai Apr 14, 2025
3222b46
BOTMAN-15495 changes enums to lowercase
rhegdeakamai Apr 21, 2025
6c24558
DXE-5120 Add fix to edgegrid version after post release rebase of sp-…
mimazaka May 29, 2025
debbc9c
SECKSD-27443 apidefinitions
BartlomiejAdamczyk Jun 17, 2025
2061591
IPR-12486 apr changes for export api
divAkamai Jun 24, 2025
c4c910b
SECKSD-27443 API Definitions Sub Provider
BartlomiejAdamczyk Jul 23, 2025
0420880
BOTMAN-17317 and BOTMAN-17339 fixes
rhegdeakamai Aug 26, 2025
84831f6
DXE-5052 truststore implement export for ca set and ca set activations
artbookspirit Jul 31, 2025
425c4a5
DXE-5052 Remove empty line from CA set import template
artbookspirit Aug 5, 2025
cedf2a9
DXE-5456 Changelog bump versions and vulnerabilities fix
mimazaka Aug 28, 2025
ac902dd
DXE-5456 Update edgegrid version in go sum
mimazaka Sep 1, 2025
1b62c84
DXISSUE-3164 readme cleanup
niemczyk-m Sep 3, 2025
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
bin/
bin/
.idea
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# RELEASE NOTES

## 2.4.0 (Sep 4, 2025)

### FEATURES/ENHANCEMENTS:

* API Definitions (Beta)
* Added the new `export-apidefinitions` command to create the API Definitions resources.

* AppSec
* Added support for Account Protection when exporting a security configuration.

* mTLS Truststore (Beta)
* Added support for exporting the `akamai_mtlstruststore_ca_set` resource for a specified CA set's name and version.
For each network where the CA set is active, the `akamai_mtlstruststore_ca_set_activation` resource will also be generated.

## 2.3.0 (Aug 6, 2025)

### FEATURES/ENHANCEMENTS:
Expand Down
58 changes: 57 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ Global Flags:
## Core export commands

<ul>
<li><a href="#export-apidefinitions">export-apidefinitions</a></li>
<li><a href="#exportappsec">export-appsec</a></li>
<li><a href="#exportclientlist">export-clientlist</a></li>
<li><a href="#export-cloudaccess">export-cloudaccess</a></li>
Expand All @@ -155,7 +156,8 @@ Global Flags:
<li><a href="#exportedgeworker">export-edgeworker</a></li>
<li><a href="#exportiam">export-iam</a></li>
<li><a href="#exportimaging">export-imaging</a></li>
<li><a href="#exportmtlskeystore">export-mtls-keystore</a></li>
<li><a href="#exportmtls-keystore">export-mtls-keystore</a></li>
<li><a href="#export-mtls-truststore">export-mtls-truststore</a></li>
<li><a href="#exportproperty">export-property</a></li>
<li><a href="#exportproperty-include">export-property-include</a></li>
<li><a href="#exportzone">export-zone</a></li>
Expand Down Expand Up @@ -183,6 +185,30 @@ For details of command flags specific to individual export commands, see the inf
| <code>&#x2011;&#x2011;tfworkpath</code> (string) | Sets the path to a directory in which you want to store the files created when running the export commands. The default is your active directory. |
| <code>&#x2011;&#x2011;help</code> (boolean) | Outputs a specific command's available options and descriptions. |


## export-apidefinitions

Export a Terraform configuration for your API definitions.

### Syntax

```shell
akamai terraform [global flags] export-apidefinitions [flags] <api_id>
```

### Basic usage

```shell
akamai terraform export-apidefinitions 12345
```

### Command flags

| Flag | Description | Example |
| ------- | --------- | --------- |
| `--version` (integer) | The API's version number. If not specified, it exports the API's `latest` version by default. | `akamai terraform export-apidefinitions --version 1 12345` |
| `--format` (string) | The format of the API file, either `openapi` or `json`. Defaults to `openapi` if not specified. | `akamai terraform export-apidefinitions --format "openapi" 12345` |

## export‑appsec

Export a Terraform declarative security configuration and its targets and policies in JSON.
Expand Down Expand Up @@ -432,6 +458,36 @@ akamai [global flags] terraform export-mtls-keystore [command flags] <certificat
akamai terraform export-mtls-keystore 12345
```

## export-mtls-truststore

Export a Terraform configuration for your Mutual TLS Edge Truststore CA set, along with
associated activations if they exist.

> **Note:**
>
> If the CA set you're exporting hasn't been activated on any networks, staging or production,
> the `akamai_mtlstruststore_ca_set_activation` resource will still be included in your
> configuration but commented out. This is to avoid accidental activation. To activate the CA set,
> uncomment the `akamai_mtlstruststore_ca_set_activation` resource and run `terraform apply`.

### Syntax

```shell
akamai [global flags] terraform export-mtls-truststore [command flags] <CA set name>
```

### Basic usage

```shell
akamai terraform export-mtls-truststore "my-ca-set-name"
```

### Command flags

| Flag | Description | Example |
| ------- |----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------|
| `--version` (string) | Exports your declarative CA set configuration with possible activations for a specific CA set version. If provided, must be a positive integer. <br /><br /> <blockquote><b>Notes:</b> <ul><li>If you don't provide the <code>--version</code> flag, by default, it exports the <code>latest</code> CA set version whether it is active or not.</li><li>Since the `akamai_mtlstruststore_ca_set` resource always represents the latest version of a CA set, generating configuration for an older version will result in a non-empty Terraform plan.</li></ul></blockquote> | `akamai terraform export-mtls-truststore --version "1" "my-ca-set-name"` |

## export‑property

Export a Terraform configuration for your property along with its JSON-formatted rules, but without the includes. Use the [`export-property-include`](#exportproperty-include) command to export your includes.
Expand Down
2 changes: 1 addition & 1 deletion build/docker_jenkins.bash
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ docker exec akatf-container sh -c 'cd edgegrid; git checkout ${EDGEGRID_BRANCH_N
cd ../cli; git checkout ${CLI_BRANCH_NAME};
go mod tidy;
cd ../cli-terraform; git checkout ${CLI_TERRAFORM_BRANCH_NAME};
go mod edit -replace github.com/akamai/AkamaiOPEN-edgegrid-golang/v11=../edgegrid;
go mod edit -replace github.com/akamai/AkamaiOPEN-edgegrid-golang/v12=../edgegrid;
go mod edit -replace github.com/akamai/cli/v2=../cli;
go mod tidy'

Expand Down
2 changes: 1 addition & 1 deletion cli.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"commands": [
{
"name": "terraform",
"version": "2.3.0",
"version": "2.4.0",
"description": "Export selected resources for faster adoption in Terraform",
"bin": "https://github.com/akamai/cli-terraform/releases/download/v{{.Version}}/akamai-{{.Name}}-{{.Version}}-{{.OS}}{{.Arch}}{{.BinSuffix}}",
"auto-complete": true,
Expand Down
6 changes: 3 additions & 3 deletions cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"context"
"os"

sesslog "github.com/akamai/AkamaiOPEN-edgegrid-golang/v11/pkg/log"
"github.com/akamai/AkamaiOPEN-edgegrid-golang/v11/pkg/session"
sesslog "github.com/akamai/AkamaiOPEN-edgegrid-golang/v12/pkg/log"
"github.com/akamai/AkamaiOPEN-edgegrid-golang/v12/pkg/session"
"github.com/akamai/cli-terraform/v2/pkg/commands"
"github.com/akamai/cli-terraform/v2/pkg/edgegrid"
akacli "github.com/akamai/cli/v2/pkg/app"
Expand All @@ -17,7 +17,7 @@ import (

var (
// Version holds current version of cli-terraform
Version = "2.3.0"
Version = "2.4.0"
)

// Run initializes the cli and runs it
Expand Down
2 changes: 1 addition & 1 deletion cli/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"flag"
"testing"

"github.com/akamai/AkamaiOPEN-edgegrid-golang/v11/pkg/session"
"github.com/akamai/AkamaiOPEN-edgegrid-golang/v12/pkg/session"
"github.com/akamai/cli/v2/pkg/log"
"github.com/stretchr/testify/assert"
"github.com/urfave/cli/v2"
Expand Down
12 changes: 8 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ module github.com/akamai/cli-terraform/v2
go 1.23.6

require (
github.com/akamai/AkamaiOPEN-edgegrid-golang/v11 v11.1.0
github.com/akamai/cli/v2 v2.0.1
github.com/akamai/AkamaiOPEN-edgegrid-golang/v12 v12.0.0
github.com/akamai/cli/v2 v2.0.2
github.com/fatih/color v1.18.0
github.com/hashicorp/hcl/v2 v2.23.0
github.com/jinzhu/copier v0.4.0
github.com/shirou/gopsutil v3.21.11+incompatible
github.com/stretchr/testify v1.10.0
github.com/urfave/cli/v2 v2.19.3
github.com/wk8/go-ordered-map/v2 v2.1.8
)

require (
Expand All @@ -18,11 +20,12 @@ require (
github.com/agext/levenshtein v1.2.3 // indirect
github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
github.com/bahlo/generic-list-go v0.2.0 // indirect
github.com/benbjohnson/clock v1.3.5 // indirect
github.com/briandowns/spinner v1.23.1 // indirect
github.com/buger/jsonparser v1.1.1 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.5 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fatih/color v1.18.0 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/go-ozzo/ozzo-validation/v4 v4.3.0 // indirect
github.com/google/go-cmp v0.6.0 // indirect
Expand All @@ -31,6 +34,7 @@ require (
github.com/hashicorp/go-retryablehttp v0.7.7 // indirect
github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
Expand All @@ -55,6 +59,6 @@ require (
gopkg.in/yaml.v3 v3.0.1 // indirect
)

//replace github.com/akamai/AkamaiOPEN-edgegrid-golang/v11 => ../akamaiopen-edgegrid-golang
//replace github.com/akamai/AkamaiOPEN-edgegrid-golang/v12 => ../akamaiopen-edgegrid-golang
//replace github.com/akamai/cli/v2 => ../cli
replace gopkg.in/yaml.v2 v2.2.2 => gopkg.in/yaml.v2 v2.4.0 // Fix security vulnerability
23 changes: 15 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,23 @@ github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2 h1:+vx7roKuyA63n
github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2/go.mod h1:HBCaDeC1lPdgDeDbhX8XFpy1jqjK0IBG8W5K+xYqA0w=
github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7lmo=
github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558=
github.com/akamai/AkamaiOPEN-edgegrid-golang/v11 v11.1.0 h1:h/33OxYLqBk0BYmEbSUy7MlvgQR/m1w1/7OJFKoPL1I=
github.com/akamai/AkamaiOPEN-edgegrid-golang/v11 v11.1.0/go.mod h1:rvh3imDA6EaQi+oM/GQHkQAOHbXPKJ7EWJvfjuw141Q=
github.com/akamai/cli/v2 v2.0.1 h1:K5624ReV3K12AehPF9GK/IOCRhUea1dRJoaVjj35m2k=
github.com/akamai/cli/v2 v2.0.1/go.mod h1:FLUVPrBcP0sPEYy9HopagZWvKcAMwmJBHCe2WCiJgUM=
github.com/akamai/AkamaiOPEN-edgegrid-golang/v12 v12.0.0 h1:UED1jCu37aILAC6MuXE+K7j4EL3F0dT9wgcqASJlOos=
github.com/akamai/AkamaiOPEN-edgegrid-golang/v12 v12.0.0/go.mod h1:Bf6hnZkloZnfL4I/gFGnMMMdMHiu/ERnSOWtFgnodDk=
github.com/akamai/cli/v2 v2.0.2 h1:gqjVTqN5lp3t5RjVVl+q7u+aW8YOZ4/kIYG0bg6Xhy8=
github.com/akamai/cli/v2 v2.0.2/go.mod h1:5tLoIp57aX21plVEcI0TeYz6C54ek6zlPnIHhfe1YRk=
github.com/apparentlymart/go-textseg/v15 v15.0.0 h1:uYvfpb3DyLSCGWnctWKGj857c6ew1u1fNQOlOtuGxQY=
github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmmsvpAG721bKi0joRfFdHIWJ4=
github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg=
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so=
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw=
github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk=
github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg=
github.com/benbjohnson/clock v1.3.5 h1:VvXlSJBzZpA/zum6Sj74hxwYI2DIxRWuNIoXAzHZz5o=
github.com/benbjohnson/clock v1.3.5/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
github.com/briandowns/spinner v1.23.1 h1:t5fDPmScwUjozhDj4FA46p5acZWIPXYE30qW2Ptu650=
github.com/briandowns/spinner v1.23.1/go.mod h1:LaZeM4wm2Ywy6vO571mvhQNRcWfRUnXOs0RcKV0wYKM=
github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs=
github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0=
github.com/cpuguy83/go-md2man/v2 v2.0.5 h1:ZtcqGrnekaHpVLArFSe4HK5DoKx1T0rq2DwVB0alcyc=
github.com/cpuguy83/go-md2man/v2 v2.0.5/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/creack/pty v1.1.17 h1:QeVUsEDNrLBW4tMgZHvxy18sKtr6VI492kBhUfhDJNI=
Expand Down Expand Up @@ -55,6 +59,7 @@ github.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec h1:qv2VnGeEQHchGaZ/u
github.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec/go.mod h1:Q48J4R4DvxnHolD5P8pOtXigYlRuPLGl6moFx3ulM68=
github.com/jinzhu/copier v0.4.0 h1:w3ciUoD19shMCRargcpm0cm91ytaBhDvuRpz1ODO/U8=
github.com/jinzhu/copier v0.4.0/go.mod h1:DfbEm0FYsaqBcKcFuvmOZb218JkPGtvSHsKg8S8hyyg=
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 h1:iQTw/8FWTuc7uiaSepXwyf3o52HaUYcV+Tu66S3F5GA=
github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8=
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs=
Expand All @@ -63,6 +68,8 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
Expand All @@ -77,8 +84,6 @@ github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0=
github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
Expand All @@ -98,6 +103,8 @@ github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOf
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/urfave/cli/v2 v2.19.3 h1:GsJ5D2qZWF6hk/F276qqf8v/Ff4IzAUTB+CUFSNhN6M=
github.com/urfave/cli/v2 v2.19.3/go.mod h1:1CNUng3PtjQMtRzJO4FMXBQvkGtuYRxxiR9xMa7jMwI=
github.com/wk8/go-ordered-map/v2 v2.1.8 h1:5h/BUHu93oj4gIdvHHHGsScSTMijfx5PeYkE/fJgbpc=
github.com/wk8/go-ordered-map/v2 v2.1.8/go.mod h1:5nJHM5DyteebpVlHnWMV0rPz6Zp7+xBAnxjb1X5vnTw=
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGCjxCBTO/36wtF6j2nSip77qHd4x4=
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
Expand Down Expand Up @@ -154,8 +161,8 @@ golang.org/x/tools v0.28.0 h1:WuB6qZ4RPCQo5aP3WdKZS7i595EdWqWR8vqJTlwTVK8=
golang.org/x/tools v0.28.0/go.mod h1:dcIOrVd3mfQKTgrDVQHqCPMWy6lnhfhtX3hLXYVLfRw=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
Expand Down
49 changes: 49 additions & 0 deletions pkg/commands/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
package commands

import (
"github.com/akamai/cli-terraform/v2/pkg/providers/apidefinitions"
"github.com/akamai/cli-terraform/v2/pkg/providers/appsec"
"github.com/akamai/cli-terraform/v2/pkg/providers/clientlists"
"github.com/akamai/cli-terraform/v2/pkg/providers/cloudaccess"
Expand All @@ -14,6 +15,7 @@ import (
"github.com/akamai/cli-terraform/v2/pkg/providers/iam"
"github.com/akamai/cli-terraform/v2/pkg/providers/imaging"
"github.com/akamai/cli-terraform/v2/pkg/providers/mtlskeystore"
"github.com/akamai/cli-terraform/v2/pkg/providers/mtlstruststore"
"github.com/akamai/cli-terraform/v2/pkg/providers/papi"
"github.com/akamai/cli-terraform/v2/pkg/tools"
"github.com/akamai/cli/v2/pkg/apphelp"
Expand All @@ -24,6 +26,31 @@ import (
// CommandLocator creates and returns a list of subcommands.
func CommandLocator() []*cli.Command {
return []*cli.Command{
{
Name: "export-apidefinitions",
Description: "Generates Terraform configuration for API Definitions resources.",
Usage: "export-apidefinitions",
ArgsUsage: "<api_id>",
Action: validatedAction(apidefinitions.CmdCreateAPIDefinition, requireValidWorkpath, requireNArguments(1)),
Flags: []cli.Flag{
&cli.StringFlag{
Name: "tfworkpath",
Usage: "Directory used to store files created when running commands.",
DefaultText: "current directory",
},
&cli.Int64Flag{
Name: "version",
Usage: "API version to import.",
DefaultText: "latest",
},
&cli.StringFlag{
Name: "format",
Usage: "Format of the API file, either `openapi` or `json`.",
DefaultText: "openapi",
},
},
BashComplete: autocomplete.Default,
},
{
Name: "export-appsec",
Description: "Generates Terraform configuration for Application Security resources.",
Expand Down Expand Up @@ -279,6 +306,28 @@ func CommandLocator() []*cli.Command {
},
BashComplete: autocomplete.Default,
},
{
Name: "export-mtls-truststore",
Description: "Generates Terraform configuration for Mutual TLS Edge Truststore CA set resource, " +
"along with associated activations if they exist.",
Usage: "export-mtls-truststore",
ArgsUsage: "<CA set name>",
Action: validatedAction(mtlstruststore.CmdCreateCASet, requireValidWorkpath,
requireNArguments(1), validateVersion),
Flags: []cli.Flag{
&cli.StringFlag{
Name: "tfworkpath",
Usage: "Directory used to store files created when running commands.",
DefaultText: "current directory",
},
&cli.IntFlag{
Name: "version",
Usage: "CA set version to import. If provided, must be a positive integer.",
DefaultText: "LATEST",
},
},
BashComplete: autocomplete.Default,
},
{
Name: "export-property",
Description: "Generates Terraform configuration for Property resources.",
Expand Down
Loading