@@ -87,6 +87,10 @@ Conditions:
8787 - 0
8888 UseParameterPrefix : !Not
8989 - !Equals [ !Ref ParameterPrefix, "none"]
90+ IsNotProduction : !Not [ !Equals [ !Ref Environment, production ] ]
91+ CreateTestResourcesParam : !And
92+ - !Condition IsDeployedFromPipeline
93+ - !Condition IsNotProduction
9094
9195Globals :
9296 Function :
@@ -191,7 +195,7 @@ Resources:
191195 Properties :
192196 Location :
193197 ApplicationId : arn:aws:serverlessrepo:eu-west-2:667736788427:applications/di-ipv-cri-oauth-common
194- SemanticVersion : 0.0 .0
198+ SemanticVersion : 0.3 .0
195199 Parameters :
196200 AuditEventNamePrefix : !Ref AuditEventNamePrefix
197201 CriIdentifier : !Ref CriIdentifier
@@ -569,6 +573,16 @@ Resources:
569573 ArnLike :
570574 " kms:EncryptionContext:aws:logs:arn " : !Sub "arn:aws:logs:${AWS::Region}:${AWS::AccountId}:*"
571575
576+ OAuthCommonStackNameParam :
577+ Type : AWS::SSM::Parameter
578+ Condition : CreateTestResourcesParam
579+ Properties :
580+ Name : /common-cri/oauth-common/stack-name
581+ Type : String
582+ Value : !GetAtt OAuth.Outputs.StackName
583+ Description : The stack currently used for OAuth (oauth-common). Only required for test-resources.
584+
585+
572586 # ###################################################################
573587 # #
574588 # Alarms #
@@ -718,7 +732,7 @@ Resources:
718732 Properties :
719733 Name : !Sub
720734 - " /${OAuthStackName}/clients/ipv-core-stub-local/jwtAuthentication/redirectUri"
721- - OAuthStackName : !Select [1, !Split ['/', !Select [5, !Split [':', !Ref OAuth]]]]
735+ - OAuthStackName : !GetAtt OAuth.Outputs.StackName
722736 Type : String
723737 Value : !FindInMap [ IPVCoreStubLocalMapping, !Ref Environment, redirectUri ]
724738
@@ -728,7 +742,7 @@ Resources:
728742 Properties :
729743 Name : !Sub
730744 - " /${OAuthStackName}/clients/ipv-core-stub-local/jwtAuthentication/issuer"
731- - OAuthStackName : !Select [1, !Split ['/', !Select [5, !Split [':', !Ref OAuth]]]]
745+ - OAuthStackName : !GetAtt OAuth.Outputs.StackName
732746 Type : String
733747 Value : !FindInMap [ IPVCoreStubLocalMapping, !Ref Environment, issuer ]
734748
@@ -738,7 +752,7 @@ Resources:
738752 Properties :
739753 Name : !Sub
740754 - " /${OAuthStackName}/clients/ipv-core-stub-local/jwtAuthentication/audience"
741- - OAuthStackName : !Select [1, !Split ['/', !Select [5, !Split [':', !Ref OAuth]]]]
755+ - OAuthStackName : !GetAtt OAuth.Outputs.StackName
742756 Type : String
743757 Value :
744758 !FindInMap [ IPVCoreStubLocalMapping, !Ref Environment, audience ]
@@ -749,7 +763,7 @@ Resources:
749763 Properties :
750764 Name : !Sub
751765 - " /${OAuthStackName}/clients/ipv-core-stub-local/jwtAuthentication/publicSigningJwkBase64"
752- - OAuthStackName : !Select [1, !Split ['/', !Select [5, !Split [':', !Ref OAuth]]]]
766+ - OAuthStackName : !GetAtt OAuth.Outputs.StackName
753767 Type : String
754768 Value : !FindInMap [ IPVCoreStubLocalMapping, !Ref Environment, publicSigningJwkBase64Mapping ]
755769
@@ -759,7 +773,7 @@ Resources:
759773 Properties :
760774 Name : !Sub
761775 - " /${OAuthStackName}/clients/ipv-core-stub-local/jwtAuthentication/jwksEndpoint"
762- - OAuthStackName : !Select [1, !Split ['/', !Select [5, !Split [':', !Ref OAuth]]]]
776+ - OAuthStackName : !GetAtt OAuth.Outputs.StackName
763777 Type : String
764778 Value : !FindInMap [ IPVCoreStubLocalMapping, !Ref Environment, jwksEndpoint ]
765779
@@ -769,7 +783,7 @@ Resources:
769783 Properties :
770784 Name : !Sub
771785 - " /${OAuthStackName}/clients/ipv-core-stub-local/jwtAuthentication/authenticationAlg"
772- - OAuthStackName : !Select [1, !Split ['/', !Select [5, !Split [':', !Ref OAuth]]]]
786+ - OAuthStackName : !GetAtt OAuth.Outputs.StackName
773787 Type : String
774788 Value : !FindInMap [ IPVCoreStubLocalMapping, !Ref Environment, authenticationAlg ]
775789
0 commit comments