Skip to content

Commit 4b51c4a

Browse files
committed
Only use PUT for app config not POST and PUT
1 parent 0172c89 commit 4b51c4a

File tree

6 files changed

+227
-215
lines changed

6 files changed

+227
-215
lines changed

resources/saas-boost-public-api.yaml

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,6 @@ Parameters:
6464
SettingsServiceGetAppConfig:
6565
Description: Settings Service get application configuration Lambda ARN
6666
Type: String
67-
SettingsServiceSetAppConfig:
68-
Description: Settings Service set application configuration Lambda ARN
69-
Type: String
7067
SettingsServiceUpdateAppConfig:
7168
Description: Settings Service update application configuration Lambda ARN
7269
Type: String
@@ -815,33 +812,6 @@ Resources:
815812
Action: lambda:InvokeFunction
816813
FunctionName: !Ref SettingsServiceGetAppConfig
817814
SourceArn: !Sub arn:aws:execute-api:${AWS::Region}:${AWS::AccountId}:${PublicApi}/*/GET/settings/config
818-
SettingsServiceSetAppConfigMethod:
819-
Type: AWS::ApiGateway::Method
820-
Properties:
821-
RestApiId: !Ref PublicApi
822-
ResourceId: !Ref SettingsServiceConfigResource
823-
HttpMethod: POST
824-
AuthorizationType: COGNITO_USER_POOLS
825-
AuthorizerId: !Ref CognitoAuthorizer
826-
AuthorizationScopes:
827-
- aws.cognito.signin.user.admin
828-
Integration:
829-
Type: AWS_PROXY
830-
IntegrationHttpMethod: POST
831-
Uri: !Sub arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${SettingsServiceSetAppConfig}/invocations
832-
PassthroughBehavior: WHEN_NO_MATCH
833-
MethodResponses:
834-
- StatusCode: '200'
835-
ResponseModels: {application/json: Empty}
836-
ResponseParameters:
837-
method.response.header.Access-Control-Allow-Origin: false
838-
SettingsServiceSetAppConfigLambdaPermission:
839-
Type: AWS::Lambda::Permission
840-
Properties:
841-
Principal: apigateway.amazonaws.com
842-
Action: lambda:InvokeFunction
843-
FunctionName: !Ref SettingsServiceSetAppConfig
844-
SourceArn: !Sub arn:aws:execute-api:${AWS::Region}:${AWS::AccountId}:${PublicApi}/*/POST/settings/config
845815
SettingsServiceUpdateAppConfigMethod:
846816
Type: AWS::ApiGateway::Method
847817
Properties:
@@ -1702,7 +1672,6 @@ Resources:
17021672
- SettingsServiceOptionsMethod
17031673
- SettingsServiceOptionsResourceCORS
17041674
- SettingsServiceGetAppConfigMethod
1705-
- SettingsServiceSetAppConfigMethod
17061675
- SettingsServiceUpdateAppConfigMethod
17071676
- SettingsServiceConfigResourceCORS
17081677
- SettingsServiceGetByIdMethod

resources/saas-boost-svc-onboarding.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,9 @@ Resources:
308308
Action:
309309
- lambda:AddPermission
310310
- lambda:RemovePermission
311+
- lambda:InvokeFunction
312+
- lambda:GetFunction
313+
- lambda:GetFunctionConfiguration
311314
Resource:
312315
- !Sub arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:*deploy*
313316
- !Sub arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:saas-boost-app-services-macro
@@ -659,8 +662,6 @@ Resources:
659662
Action:
660663
- lambda:InvokeFunction
661664
- lambda:DeleteFunction
662-
#- lambda:GetFunction
663-
#- lambda:GetFunctionConfiguration
664665
Resource:
665666
- !Sub arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:sb-${Environment}-rds-bootstrap-tenant-*
666667
OnboardingServiceStorageProvisionPolicy:

resources/saas-boost-svc-settings.yaml

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -312,37 +312,6 @@ Resources:
312312
Value: !Ref Environment
313313
- Key: "BoostService"
314314
Value: "Settings"
315-
SettingsServiceSetAppConfigLogs:
316-
Type: AWS::Logs::LogGroup
317-
Properties:
318-
LogGroupName: !Sub /aws/lambda/sb-${Environment}-settings-set-config
319-
RetentionInDays: 30
320-
SettingsServiceSetAppConfig:
321-
Type: AWS::Lambda::Function
322-
Properties:
323-
FunctionName: !Sub sb-${Environment}-settings-set-config
324-
Role: !GetAtt SettingsServiceExecutionRole.Arn
325-
Runtime: java11
326-
Timeout: 300
327-
MemorySize: 512
328-
Handler: com.amazon.aws.partners.saasfactory.saasboost.SettingsService::setAppConfig
329-
Code:
330-
S3Bucket: !Ref SaaSBoostBucket
331-
S3Key: !Sub ${LambdaSourceFolder}/SettingsService-lambda.zip
332-
Layers:
333-
- !Ref SaaSBoostUtilsLayer
334-
Environment:
335-
Variables:
336-
SAAS_BOOST_ENV: !Ref Environment
337-
SAAS_BOOST_EVENT_BUS: !Ref SaaSBoostEventBus
338-
RESOURCES_BUCKET: !Ref ResourcesBucket
339-
Tags:
340-
- Key: "Application"
341-
Value: "SaaSBoost"
342-
- Key: "Environment"
343-
Value: !Ref Environment
344-
- Key: "BoostService"
345-
Value: "Settings"
346315
SettingsServiceUpdateAppConfigLogs:
347316
Type: AWS::Logs::LogGroup
348317
Properties:
@@ -479,7 +448,7 @@ Resources:
479448
Runtime: java11
480449
Timeout: 300
481450
MemorySize: 1024
482-
Handler: com.amazon.aws.partners.saasfactory.saasboost.SettingsService::configOptions
451+
Handler: com.amazon.aws.partners.saasfactory.saasboost.SettingsService::options
483452
Code:
484453
S3Bucket: !Ref SaaSBoostBucket
485454
S3Key: !Sub ${LambdaSourceFolder}/SettingsService-lambda.zip
@@ -575,9 +544,6 @@ Outputs:
575544
SettingsServiceGetAppConfigArn:
576545
Description: Settings Service get application configuration Lambda ARN
577546
Value: !GetAtt SettingsServiceGetAppConfig.Arn
578-
SettingsServiceSetAppConfigArn:
579-
Description: Settings Service set application configuration Lambda ARN
580-
Value: !GetAtt SettingsServiceSetAppConfig.Arn
581547
SettingsServiceUpdateAppConfigArn:
582548
Description: Settings Service update application configuration Lambda ARN
583549
Value: !GetAtt SettingsServiceUpdateAppConfig.Arn

resources/saas-boost.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,6 @@ Resources:
765765
SettingsServiceById: !GetAtt settings.Outputs.SettingsServiceByIdArn
766766
SettingsServiceOptions: !GetAtt settings.Outputs.SettingsServiceOptionsArn
767767
SettingsServiceGetAppConfig: !GetAtt settings.Outputs.SettingsServiceGetAppConfigArn
768-
SettingsServiceSetAppConfig: !GetAtt settings.Outputs.SettingsServiceSetAppConfigArn
769768
SettingsServiceUpdateAppConfig: !GetAtt settings.Outputs.SettingsServiceUpdateAppConfigArn
770769
TenantServiceGetAll: !GetAtt tenant.Outputs.TenantServiceGetAllArn
771770
TenantServiceById: !GetAtt tenant.Outputs.TenantServiceByIdArn

0 commit comments

Comments
 (0)