Skip to content

Commit

Permalink
v1.12.1 (#176)
Browse files Browse the repository at this point in the history
* #167 - Add support for GovCloud (US) Regions

* #173 - Fix mapping SAML groups to Cognito Groups

* #174 - Saving Document can result in "Provided list of item keys contains duplicates" error

* #175 - Strip quotes around checksum
  • Loading branch information
mfriesen committed Sep 24, 2023
1 parent e15c258 commit 96df739
Show file tree
Hide file tree
Showing 35 changed files with 872 additions and 468 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ def getCmdParam() {
repositories { mavenCentral() }

allprojects {
version = '1.12.0'
ext.awsCognitoVersion = '1.5.1'
version = '1.12.1'
ext.awsCognitoVersion = '1.5.3'
group = 'com.formkiq.stacks'

apply plugin: 'com.diffplug.spotless'
Expand Down
32 changes: 25 additions & 7 deletions console/src/main/resources/cloudformation/template-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,15 @@ Parameters:
Type: String
Default: ""

Partition:
Description: The partition in which the resource is located. A partition is a group of AWS Regions
Type: String

IsGovCloud:
Description: Is Installation AWS Region gov cloud
Type: String
AllowedValues: ["true", "false"]

Conditions:

HasCertificateStackName:
Expand All @@ -114,10 +123,16 @@ Conditions:
- Fn::Equals:
- Ref: HostedZoneId
- ''


IsNotGovCloud:
Fn::Equals:
- Ref: IsGovCloud
- 'false'

Resources:

ConsoleInstallerParameter:
Condition: IsNotGovCloud
Type: AWS::SSM::Parameter
Properties:
Description: "Lambda for Console Installation"
Expand All @@ -136,6 +151,7 @@ Resources:

ConsoleInstaller:
Type: AWS::Serverless::Function
Condition: IsNotGovCloud
Properties:
Handler: com.formkiq.stacks.console.ConsoleInstallHandler
Description: Lambda function that Installs the FormKiQ Console
Expand Down Expand Up @@ -189,6 +205,7 @@ Resources:

ConsoleInstallRole:
Type: AWS::IAM::Role
Condition: IsNotGovCloud
Properties:
Tags:
- Key: "Application"
Expand Down Expand Up @@ -224,7 +241,7 @@ Resources:
Action:
- ssm:GetParameter
Resource:
- Fn::Sub: "arn:aws:ssm:${AWS::Region}:${AWS::AccountId}:parameter/formkiq/*"
- Fn::Sub: "arn:${Partition}:ssm:${AWS::Region}:${AWS::AccountId}:parameter/formkiq/*"
- Effect: Allow
Action:
- s3:GetObject
Expand All @@ -234,11 +251,11 @@ Resources:
Resource:
- Fn::Join:
- ''
- - 'arn:aws:s3:::'
- - Fn::Sub: "arn:${Partition}:s3:::"
- Ref: ConsoleBucket
- Fn::Join:
- ''
- - 'arn:aws:s3:::'
- - Fn::Sub: "arn:${Partition}:s3:::"
- Ref: ConsoleBucket
- '/*'
- Effect: Allow
Expand All @@ -249,11 +266,11 @@ Resources:
Resource:
- Fn::Join:
- ''
- - 'arn:aws:s3:::'
- - Fn::Sub: "arn:${Partition}:s3:::"
- Ref: CognitoConfigBucket
- Fn::Join:
- ''
- - 'arn:aws:s3:::'
- - Fn::Sub: "arn:${Partition}:s3:::"
- Ref: CognitoConfigBucket
- '/*'
- Effect: Allow
Expand All @@ -262,7 +279,7 @@ Resources:
Resource:
- Fn::Join:
- ''
- - 'arn:aws:s3:::'
- - Fn::Sub: "arn:${Partition}:s3:::"
- Ref: DistributionBucket
- '/*'
- Effect: Allow
Expand All @@ -276,6 +293,7 @@ Resources:

ConsoleInstallerRef:
Type: Custom::ConsoleInstallerRef
Condition: IsNotGovCloud
Properties:
Nonce:
Ref: ConsoleVersion
Expand Down
21 changes: 20 additions & 1 deletion console/src/main/resources/cloudformation/template-users.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,27 @@ Parameters:
Description: Cognito User Pool Client
AllowedPattern: ".+"

Partition:
Description: The partition in which the resource is located. A partition is a group of AWS Regions
Type: String

IsGovCloud:
Description: Is Installation AWS Region gov cloud
Type: String
AllowedValues: ["true", "false"]

Conditions:

IsNotGovCloud:
Fn::Equals:
- Ref: IsGovCloud
- 'false'

Resources:

ConsoleAdminUser:
Type: AWS::Cognito::UserPoolUser
Condition: IsNotGovCloud
Properties:
DesiredDeliveryMediums:
- EMAIL
Expand All @@ -60,6 +77,7 @@ Resources:

ConsoleAddUserToGroup:
Type: AWS::Cognito::UserPoolUserToGroupAttachment
Condition: IsNotGovCloud
DependsOn:
- ConsoleAdminUser
Properties:
Expand All @@ -72,6 +90,7 @@ Resources:

ConsoleAddUserToDefaultGroup:
Type: AWS::Cognito::UserPoolUserToGroupAttachment
Condition: IsNotGovCloud
DependsOn:
- ConsoleAdminUser
Properties:
Expand Down Expand Up @@ -203,7 +222,7 @@ Resources:
- "sts:AssumeRole"
Path: "/"
ManagedPolicyArns:
- arn:aws:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole
- Fn::Sub: "arn:${Partition}:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole"
Policies:
-
PolicyName:
Expand Down
42 changes: 31 additions & 11 deletions console/src/main/resources/cloudformation/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,24 @@ Parameters:
Description: The name of the FormKiQ Certificate Stack Name
Default: ""

IsGovCloud:
Description: Is Installation AWS Region gov cloud
Type: String
AllowedValues: ["true", "false"]

Conditions:

HasCertificateStackName:
Fn::Not:
- Fn::Equals:
- Ref: CertificateStackName
- ''


IsNotGovCloud:
Fn::Equals:
- Ref: IsGovCloud
- 'false'

Resources:

Console:
Expand Down Expand Up @@ -158,6 +168,7 @@ Resources:

CloudFrontDistribution:
Type: AWS::CloudFront::Distribution
Condition: IsNotGovCloud
Properties:
DistributionConfig:
Origins:
Expand Down Expand Up @@ -228,6 +239,7 @@ Resources:

ConsoleUrlParameter:
Type: AWS::SSM::Parameter
Condition: IsNotGovCloud
Properties:
Description: "The URL for the FormKiQ Console"
Name:
Expand Down Expand Up @@ -258,13 +270,15 @@ Resources:
Fn::Sub: "${AWS::StackName}"

CloudFrontOriginAccessIdentity:
Condition: IsNotGovCloud
Type: AWS::CloudFront::CloudFrontOriginAccessIdentity
Properties:
CloudFrontOriginAccessIdentityConfig:
Comment:
Fn::Sub: "FormKiQ Console CloudFront Identity"

ConsoleBucketPolicy:
Condition: IsNotGovCloud
Type: "AWS::S3::BucketPolicy"
Properties:
Bucket:
Expand Down Expand Up @@ -303,13 +317,16 @@ Outputs:
- 'https://'
- Fn::ImportValue:
Fn::Sub: '${CertificateStackName}-ConsoleDomain'
- Fn::Join:
- ""
-
- 'https://'
- Fn::GetAtt:
- CloudFrontDistribution
- DomainName
- Fn::If:
- IsNotGovCloud
- Fn::Join:
- ""
-
- 'https://'
- Fn::GetAtt:
- CloudFrontDistribution
- DomainName
- "none"

ConsoleBucket:
Value:
Expand All @@ -329,6 +346,9 @@ Outputs:

CloudFrontDistributionDomainName:
Value:
Fn::GetAtt:
- CloudFrontDistribution
- DomainName
Fn::If:
- IsNotGovCloud
- Fn::GetAtt:
- CloudFrontDistribution
- DomainName
- ""
Loading

0 comments on commit 96df739

Please sign in to comment.