Skip to content

Commit 4cd4b7e

Browse files
committed
Updating README and CICD.
1 parent 0e0e787 commit 4cd4b7e

File tree

6 files changed

+28
-9
lines changed

6 files changed

+28
-9
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,4 @@ release.yaml
4040
staging.yaml
4141
*.orig
4242
*.rej
43+
cicd/.DS_Store

README.md

+9
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ SSO Sync will run on any platform that Go can build for. It is available in the
1818
* if deploying the lambda from the [AWS Serverless Application Repository](https://console.aws.amazon.com/lambda/home#/create/app?applicationId=arn:aws:serverlessrepo:us-east-2:004480582608:applications/SSOSync) then it needs to be deployed into the [IAM Identity Center delegated administration](https://docs.aws.amazon.com/singlesignon/latest/userguide/delegated-admin.html) account. Technically you could deploy in the management account but we would recommend against this.
1919
* if you are running the project as a cli tool, then the environment will need to be using credentials of a user in the [IAM Identity Center delegated administration](https://docs.aws.amazon.com/singlesignon/latest/userguide/delegated-admin.html) account, with appropriate permissions.
2020

21+
> :warning: `>= 2.1.0` make use of named IAM resources, so if deploying via CICD or IaC template will require **CAPABILITY_NAMED_IAM** to be specified.
22+
2123
## Why?
2224

2325
As per the [AWS SSO](https://aws.amazon.com/single-sign-on/) Homepage:
@@ -178,6 +180,13 @@ AWS SSO. To sync regularly, you can run ssosync via AWS Lambda.
178180

179181
:warning: You find it in the [AWS Serverless Application Repository](https://eu-west-1.console.aws.amazon.com/lambda/home#/create/app?applicationId=arn:aws:serverlessrepo:us-east-2:004480582608:applications/SSOSync).
180182

183+
:warning: v2.1 onwards now supports multiple deployment patterns, defaults are consistent with previous versions.
184+
**App + secrets** This is the default mode and fully backwards compatible with previous versions
185+
**App only** This mode does not create the secrets but expects you to deployed a separate stack using the **Secrets only** mode within the same account
186+
**App for cross-account** This mode is used where you have deployed the secrets in a separate account, the arns of the KMS key and secrets need to be passed into the CrossStackConfig field, It is easiest to have created the secrets in the other account using the ** Secrest for cross-account** mode, as the output can simply copied and pasted into the above field.
187+
**Secrets only** This mode creates a set of secrets but does not deploy the app itself, it requires the app is deployed in that same account using the **App only** mode. This allows for decoupling of the secrets and the app.
188+
**Secrets for cross-account** This mode creates a set of secrets and KMS key but does not deploy the app itself, this is for use with an app stack, deployed using the **App for cross-account** mode. This allows for a single set of secrets to be shared with multipl app instance for testing, and improve secrets security.
189+
181190
## SAM
182191

183192
You can use the AWS Serverless Application Model (SAM) to deploy this to your account.

cicd/.DS_Store

-2 KB
Binary file not shown.

cicd/build/build/buildspec.yml

+15-8
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,28 @@ env:
88
phases:
99
install:
1010
commands:
11+
# Add goreleaser repo
12+
- echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | sudo tee /etc/apt/sources.list.d/goreleaser.list
13+
14+
# Update the repos
15+
- apt -qq --yes update
16+
- apt -qq --yes upgrade
17+
1118
# Install go.lang
1219
- GoVersion=${GOLANG_20_VERSION}
1320

14-
# Install golint
21+
# Install golint - now deprecated
1522
- go install golang.org/x/lint/golint@latest
1623

17-
# Install staticcheck
18-
- go install honnef.co/go/tools/cmd/staticcheck@latest
24+
# Install staticcheck - use static install from tarball
25+
- wget -qO- https://github.com/dominikh/go-tools/releases/download/2023.1.6/staticcheck_linux_386.tar.gz | tar -xvz -C ./
1926

2027
# Install Testify to use common assertions and mocks in tests
21-
- go get -u github.com/stretchr/testify
28+
- go get github.com/stretchr/testify
2229

23-
# Install goreleaser
24-
- go install github.com/goreleaser/goreleaser@latest
30+
# Install goreleaser - go install method broken due to dependancies using apt static binary approach
31+
# - go install github.com/goreleaser/goreleaser@latest
32+
- apt -qq --yes install goreleaser
2533

2634
pre_build:
2735
commands:
@@ -33,7 +41,7 @@ phases:
3341
- go get ./...
3442

3543
# Run staticcheck
36-
- staticcheck ./...
44+
- staticcheck/staticcheck ./...
3745

3846
# Ensure code passes all lint tests
3947
#- golint -set_exit_status ./...
@@ -74,4 +82,3 @@ artifacts:
7482
files:
7583
- ${APP_NAME}
7684
- dist/**/*
77-

cicd/cloudformation/developer.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ Resources:
257257
Provider: CloudFormation
258258
Configuration:
259259
ActionMode: CREATE_UPDATE
260-
Capabilities: CAPABILITY_IAM,CAPABILITY_AUTO_EXPAND
260+
Capabilities: CAPABILITY_IAM,CAPABILITY_AUTO_EXPAND,CAPABILITY_NAMED_IAM
261261
StackName: SmokeTest
262262
RoleArn: !GetAtt [CloudFormationDeployerRole, Arn]
263263
TemplateConfiguration: !Sub 'Tests::deploy/developer.json'

cicd/staging/build/stack.yml

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ Resources:
2929
SemanticVersion: !Ref AppVersion
3030
Parameters:
3131
FunctionName: SSOSyncFunction
32+
DeploymentPattern: 'App + secrets'
33+
CrossStackConfig: ''
3234
GoogleAdminEmail: '{{resolve:secretsmanager:TestGoogleAdminEmail}}'
3335
GoogleCredentials: '{{resolve:secretsmanager:TestGoogleCredentials}}'
3436
SCIMEndpointUrl: '{{resolve:secretsmanager:TestSCIMEndpointUrl}}'

0 commit comments

Comments
 (0)