Skip to content

Commit

Permalink
Merge pull request #135 from Cox-Automotive/upgradeSDK
Browse files Browse the repository at this point in the history
Upgrade SDK v2
  • Loading branch information
amagana3 authored Jul 7, 2021
2 parents 7aa1195 + 22494f6 commit ae7c36e
Show file tree
Hide file tree
Showing 1,852 changed files with 159,650 additions and 233,455 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ glide.lock
.DS_Store
.terraform/
gpg/

# ignore. For testing we don't want to store a specific provider.
.terraform.lock.hcl
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This provider is for creating and modifying IAM roles via the ALKS API.

## Pre-Requisites

* An ALKS Admin or IAMAdmin STS [assume-role](http://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html) session is needed. PowerUser access is not sufficient to create IAM roles.
* An ALKS Admin or IAMAdmin STS [assume-role](http://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html) session needed. PowerUser access is not sufficient to create IAM roles.
* This tool is best suited for users with an `Admin` role
* With an `IAMAdmin|LabAdmin` role, you can create roles and attach policies, but you can't create other infrastructure.
* Works with [Terraform](https://www.terraform.io/) version `0.10.0` or newer.
Expand Down
2 changes: 1 addition & 1 deletion data_source_alks_keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package main

import (
"github.com/Cox-Automotive/alks-go"
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"log"
"strings"
)
Expand Down
17 changes: 8 additions & 9 deletions docs/guides/local_installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,11 @@ mkdir -p ~/.terraform.d/plugins &&
**One-liner download for macOS / Linux:**

```sh
mkdir -p ~/.terraform.d/plugins/Cox-Automotive/engineering-enablement/alks/1.5.12/darwin_amd64 &&
curl -Ls https://api.github.com/repos/Cox-Automotive/terraform-provider-alks/releases/latest |
jq -r ".assets[] | select(.browser_download_url | contains(\"$(uname -s | tr A-Z a-z)\")) | select(.browser_download_url | contains(\"amd64\")) | .browser_download_url" |
xargs -n 1 curl -Lo ~/.terraform.d/plugins/Cox-Automotive/engineering-enablement/alks/1.5.12/darwin_amd64/terraform-provider-alks.zip &&
pushd ~/.terraform.d/plugins/Cox-Automotive/engineering-enablement/alks/1.5.12/darwin_amd64 &&
unzip ~/.terraform.d/plugins/Cox-Automotive/engineering-enablement/alks/1.5.12/darwin_amd64/terraform-provider-alks.zip -d terraform-provider-alks-tmp &&
mkdir -p ~/.terraform.d/plugins/Cox-Automotive/engineering-enablement/alks/2.0.0/darwin_amd64 &&
curl -Ls https://api.github.com/repos/Cox-Automotive/terraform-provider-alks/releases | jq -r --arg release "v2.0.0" --arg arch "$(uname -s | tr A-Z a-z)" '.[] | select(.tag_name | contains($release)) | .assets[]| select(.browser_download_url | contains($arch)) | select(.browser_download_url | contains("amd64")) | .browser_download_url' |
xargs -n 1 curl -Lo ~/.terraform.d/plugins/Cox-Automotive/engineering-enablement/alks/2.0.0/darwin_amd64/terraform-provider-alks.zip &&
pushd ~/.terraform.d/plugins/Cox-Automotive/engineering-enablement/alks/2.0.0/darwin_amd64 &&
unzip ~/.terraform.d/plugins/Cox-Automotive/engineering-enablement/alks/2.0.0/darwin_amd64/terraform-provider-alks.zip -d terraform-provider-alks-tmp &&
mv terraform-provider-alks-tmp/terraform-provider-alks* . &&
chmod +x terraform-provider-alks* &&
rm -rf terraform-provider-alks-tmp &&
Expand Down Expand Up @@ -94,6 +93,6 @@ mkdir -p ~/.terraform.d/plugins/Cox-Automotive/engineering-enablement/alks/1.5.1

### Supported Versions

| Terraform 0.10.x | Terraform 0.12.x | Terraform 0.13.x | Terraform 0.14.x |
| ---------------- | ---------------- | ---------------- | ---------------- |
| ALKS TFP 0.9.0 < 1.3.0 | ALKS TFP 1.3.0+ | ALKS TFP 1.3.0+ | ALKS TFP 1.3.0+ |
| Terraform 0.10.x | Terraform 0.11.x | Terraform 0.12.x | Terraform 0.13.x | Terraform 0.14.x |
| ---------------- | ---------------- | ---------------- | ---------------- | ---------------- |
| ALKS TFP 0.9.0 < 1.3.0 | ALKS TFP 1.3.0 < 1.5.15 | ALKS TFP 1.3.0+ | ALKS TFP 1.3.0+ | ALKS TFP 1.3.0+ |
6 changes: 3 additions & 3 deletions examples/alks.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ provider "aws" {

# CREATE IAM ROLE -- Initial Provider
resource "alks_iamrole" "test_role" {
name = "TEST-DELETE"
name = "TEST-DELETE-PRIMARY-PROVIDER"
type = "AWS CodeBuild"
include_default_policies = false
enable_alks_access = true
Expand All @@ -55,7 +55,7 @@ resource "alks_iamrole" "test_dynamic_role" {
# CREATE IAM ROLE -- Secondary Provider
resource "alks_iamrole" "test_role_nonprod" {
provider = alks.nonprod
name = "TEST-DELETE"
name = "TEST-DELETE-SECONDARY-PROVIDER"
type = "AWS CodeBuild"
include_default_policies = false
enable_alks_access = true
Expand Down Expand Up @@ -89,5 +89,5 @@ resource "aws_iam_role_policy_attachment" "sr-attach" {

# CREATE LTK USER
resource "alks_ltk" "ltk" {
iam_username = "TEST_LTK_USER"
iam_username = "TEST-LTK-USER"
}
2 changes: 1 addition & 1 deletion examples/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
alks = {
source = "Cox-Automotive/alks"
version = "1.5.8"
version = "2.0.0"
}
aws = {
source = "hashicorp/aws"
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ require (
github.com/Cox-Automotive/alks-go v0.0.0-20210414185953-754a7e5f7114
github.com/aws/aws-sdk-go v1.31.15
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/terraform v0.12.26
github.com/hashicorp/terraform-plugin-sdk/v2 v2.4.3
github.com/mitchellh/go-homedir v1.1.0
)
Loading

0 comments on commit ae7c36e

Please sign in to comment.