forked from awslabs/ssosync
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
41 changed files
with
2,561 additions
and
579 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
version: 0.2 | ||
|
||
phases: | ||
|
||
build: | ||
commands: | ||
# Create parameters | ||
- export AppVersion="${GitTag#v}-${GitVersionHash}" | ||
|
||
# Copy in the executable | ||
- cp ${CODEBUILD_SRC_DIR_Built}/dist/ssosync_linux_amd64_v1/ssosync ./ | ||
|
||
# Copy in the tests | ||
- cp -r cicd/tests ./ | ||
|
||
# Copy in the stack and params templates | ||
- mkdir deploy | ||
- cp cicd/account_execution/staging/stack.yml ./deploy/ | ||
|
||
# Update params with the values for this run for a developer account | ||
- | | ||
jq -n \ | ||
--argjson Parameters "{\"AppArn\": \"$AppArn\", \"AppVersion\": \"$AppVersion\", \"GoogleAdminEmailArn\": \"$SecretGoogleAdminEmail\", \"GoogleCredentialsArn\": \"$SecretGoogleCredentials\", \"SCIMEndpointUrlArn\": \"$SecretSCIMEndpoint\", \"SCIMAccessTokenArn\": \"$SecretSCIMAccessToken\", \"RegionArn\": \"$SecretRegion\", \"IdentityStoreIdArn\": \"$SecretIdentityStoreID\", \"GroupMatch\": \"name:AWS*,name=NestedGroups\"}" \ | ||
--argjson StackPolicy "{\"Statement\":[{\"Effect\": \"Allow\", \"NotAction\": \"Update:Delete\", \"Principal\": \"*\", \"Resource\": \"*\"}]}" \ | ||
'$ARGS.named' > ./deploy/developer.json | ||
- cat ./deploy/developer.json | ||
|
||
# Update params with the values for this run for the management account | ||
- | | ||
jq -n \ | ||
--argjson Parameters "{\"AppArn\": \"$AppArn\", \"AppVersion\": \"$AppVersion\", \"GoogleAdminEmailArn\": \"$SecretGoogleAdminEmail\", \"GoogleCredentialsArn\": \"$SecretGoogleCredentials\", \"SCIMEndpointUrlArn\": \"$SecretSCIMEndpoint\", \"SCIMAccessTokenArn\": \"$SecretSCIMAccessToken\", \"RegionArn\": \"$SecretRegion\", \"IdentityStoreIdArn\": \"$SecretIdentityStoreID\", \"GroupMatch\": \"name:Man*\"}" \ | ||
--argjson StackPolicy "{\"Statement\":[{\"Effect\": \"Allow\", \"NotAction\": \"Update:Delete\", \"Principal\": \"*\", \"Resource\": \"*\"}]}" \ | ||
'$ARGS.named' > ./deploy/cli.json | ||
- cat ./deploy/cli.json | ||
|
||
# Update params with the values for this run for the delegated account | ||
- | | ||
jq -n \ | ||
--argjson Parameters "{\"AppArn\": \"$AppArn\", \"AppVersion\": \"$AppVersion\", \"GoogleAdminEmailArn\": \"$SecretGoogleAdminEmail\", \"GoogleCredentialsArn\": \"$SecretGoogleCredentials\", \"SCIMEndpointUrlArn\": \"$SecretSCIMEndpoint\", \"SCIMAccessTokenArn\": \"$SecretSCIMAccessToken\", \"RegionArn\": \"$SecretRegion\", \"IdentityStoreIdArn\": \"$SecretIdentityStoreID\", \"GroupMatch\": \"name:Del*\"}" \ | ||
--argjson StackPolicy "{\"Statement\":[{\"Effect\": \"Allow\", \"NotAction\": \"Update:Delete\", \"Principal\": \"*\", \"Resource\": \"*\"}]}" \ | ||
'$ARGS.named' > ./deploy/lambda.json | ||
- cat ./deploy/lambda.json | ||
|
||
# Update params with the values for this run for non-delegated account | ||
- | | ||
jq -n \ | ||
--argjson Parameters "{\"AppArn\": \"$AppArn\", \"AppVersion\": \"$AppVersion\", \"GoogleAdminEmailArn\": \"$SecretGoogleAdminEmail\", \"GoogleCredentialsArn\": \"$SecretGoogleCredentials\", \"SCIMEndpointUrlArn\": \"$SecretSCIMEndpoint\", \"SCIMAccessTokenArn\": \"$SecretSCIMAccessToken\", \"RegionArn\": \"$SecretRegion\", \"IdentityStoreIdArn\": \"$SecretIdentityStoreID\", \"GroupMatch\": \"name:Non*\"}" \ | ||
--argjson StackPolicy "{\"Statement\":[{\"Effect\": \"Allow\", \"NotAction\": \"Update:Delete\", \"Principal\": \"*\", \"Resource\": \"*\"}]}" \ | ||
'$ARGS.named' > ./deploy/codepipeline.json | ||
- cat ./deploy/codepipeline.json | ||
|
||
|
||
artifacts: | ||
files: | ||
- ssosync | ||
- deploy/**/* | ||
- tests/**/* |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
AWSTemplateFormatVersion: '2010-09-09' | ||
Transform: 'AWS::Serverless-2016-10-31' | ||
|
||
Description: | ||
This CloudFormation template will deploy an instance of the SSOSync-Staging | ||
candidate releases (via privately shared app in the AWS Serverless Application | ||
Repository (SAR) within the Staging Account. | ||
|
||
Parameters: | ||
AppArn: | ||
Description: The candidate release in the SAR | ||
Default: 'arn:aws:serverlessrepo:<AWS::Region>:<AccountId>:applications/<ApplicationName>' | ||
Type: String | ||
AppVersion: | ||
Description: The version of this build in SAR | ||
Default: 'v1.0.0-rc.10' | ||
Type: String | ||
GoogleAdminEmailArn: | ||
Type: String | ||
GoogleCredentialsArn: | ||
Type: String | ||
SCIMEndpointUrlArn: | ||
Type: String | ||
SCIMAccessTokenArn: | ||
Type: String | ||
RegionArn: | ||
Type: String | ||
IdentityStoreIdArn: | ||
Type: String | ||
GroupMatch: | ||
Description: The search string to match Groups in Google Workspace | ||
Default: 'name:AWS*' | ||
Type: String | ||
|
||
Resources: | ||
SARApp: | ||
Type: AWS::Serverless::Application | ||
Properties: | ||
Location: | ||
ApplicationId: !Ref AppArn | ||
SemanticVersion: !Ref AppVersion | ||
Parameters: | ||
FunctionName: SSOSyncFunction | ||
GoogleAdminEmail: !Join | ||
- '' | ||
- - '{{resolve:secretsmanager:' | ||
- !Ref GoogleAdminEmailArn | ||
- '}}' | ||
GoogleCredentials: !Join | ||
- '' | ||
- - '{{resolve:secretsmanager:' | ||
- !Ref GoogleCredentialsArn | ||
- '}}' | ||
SCIMEndpointUrl: !Join | ||
- '' | ||
- - '{{resolve:secretsmanager:' | ||
- !Ref SCIMEndpointUrlArn | ||
- '}}' | ||
SCIMEndpointAccessToken: !Join | ||
- '' | ||
- - '{{resolve:secretsmanager:' | ||
- !Ref SCIMAccessTokenArn | ||
- '}}' | ||
Region: !Join | ||
- '' | ||
- - '{{resolve:secretsmanager:' | ||
- !Ref RegionArn | ||
- '}}' | ||
IdentityStoreID: !Join | ||
- '' | ||
- - '{{resolve:secretsmanager:' | ||
- !Ref IdentityStoreIdArn | ||
- '}}' | ||
SyncMethod: groups | ||
GoogleGroupMatch: !Ref GroupMatch | ||
LogLevel: info | ||
LogFormat: json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.