diff --git a/src/backend/test/__snapshots__/snapshot.test.ts.snap b/src/backend/test/__snapshots__/snapshot.test.ts.snap index a242bd9..d9ef9e5 100644 --- a/src/backend/test/__snapshots__/snapshot.test.ts.snap +++ b/src/backend/test/__snapshots__/snapshot.test.ts.snap @@ -336,7 +336,7 @@ exports[`Snapshot test 1`] = ` "Type": "AWS::IAM::Role", "UpdateReplacePolicy": "Delete", }, - "ApiDiaryApiDeploymentCA0DCBF5b04204490493f7bae0d0fbb51bda4809": { + "ApiDiaryApiDeploymentCA0DCBF5ddc2bf13dbc3d7fbb845a336b665119f": { "DependsOn": [ "ApiDiaryApibouquetGET7AC93032", "ApiDiaryApibouquetPOST2DEB7999", @@ -350,6 +350,7 @@ exports[`Snapshot test 1`] = ` "ApiDiaryApiflowerGETEAC01B09", "ApiDiaryApiflowerOPTIONS2A81112B", "ApiDiaryApiflower7C61878D", + "ApiDiaryApisettingsGET4E223DBA", "ApiDiaryApisettingsPOST5E845A8B", "ApiDiaryApisettings70D21EB5", "ApiDiaryApititleGET40FCE039", @@ -380,7 +381,7 @@ exports[`Snapshot test 1`] = ` "Format": "{"requestId":"$context.requestId","ip":"$context.identity.sourceIp","user":"$context.identity.user","caller":"$context.identity.caller","requestTime":"$context.requestTime","httpMethod":"$context.httpMethod","resourcePath":"$context.resourcePath","status":"$context.status","protocol":"$context.protocol","responseLength":"$context.responseLength"}", }, "DeploymentId": { - "Ref": "ApiDiaryApiDeploymentCA0DCBF5b04204490493f7bae0d0fbb51bda4809", + "Ref": "ApiDiaryApiDeploymentCA0DCBF5ddc2bf13dbc3d7fbb845a336b665119f", }, "MethodSettings": [ { @@ -1400,6 +1401,127 @@ exports[`Snapshot test 1`] = ` }, "Type": "AWS::ApiGateway::Resource", }, + "ApiDiaryApisettingsGET4E223DBA": { + "Properties": { + "AuthorizationType": "COGNITO_USER_POOLS", + "AuthorizerId": { + "Ref": "ApiCognitoAuthorizer23B91BA2", + }, + "HttpMethod": "GET", + "Integration": { + "IntegrationHttpMethod": "POST", + "Type": "AWS_PROXY", + "Uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition", + }, + ":apigateway:", + { + "Ref": "AWS::Region", + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "SettingsgetProfileImageFunctionDBA40214", + "Arn", + ], + }, + "/invocations", + ], + ], + }, + }, + "ResourceId": { + "Ref": "ApiDiaryApisettings70D21EB5", + }, + "RestApiId": { + "Ref": "ApiDiaryApi1E03348A", + }, + }, + "Type": "AWS::ApiGateway::Method", + }, + "ApiDiaryApisettingsGETApiPermissionCdkSampleStackApiDiaryApi4AB3EF3AGETsettings7E6B2258": { + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Fn::GetAtt": [ + "SettingsgetProfileImageFunctionDBA40214", + "Arn", + ], + }, + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition", + }, + ":execute-api:", + { + "Ref": "AWS::Region", + }, + ":", + { + "Ref": "AWS::AccountId", + }, + ":", + { + "Ref": "ApiDiaryApi1E03348A", + }, + "/", + { + "Ref": "ApiDiaryApiDeploymentStageprodD9912276", + }, + "/GET/settings", + ], + ], + }, + }, + "Type": "AWS::Lambda::Permission", + }, + "ApiDiaryApisettingsGETApiPermissionTestCdkSampleStackApiDiaryApi4AB3EF3AGETsettings86A23BEE": { + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Fn::GetAtt": [ + "SettingsgetProfileImageFunctionDBA40214", + "Arn", + ], + }, + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition", + }, + ":execute-api:", + { + "Ref": "AWS::Region", + }, + ":", + { + "Ref": "AWS::AccountId", + }, + ":", + { + "Ref": "ApiDiaryApi1E03348A", + }, + "/test-invoke-stage/GET/settings", + ], + ], + }, + }, + "Type": "AWS::Lambda::Permission", + }, "ApiDiaryApisettingsPOST5E845A8B": { "Properties": { "AuthorizationType": "COGNITO_USER_POOLS", @@ -4050,6 +4172,114 @@ exports[`Snapshot test 1`] = ` }, "Type": "AWS::IAM::Policy", }, + "SettingsgetProfileImageFunctionDBA40214": { + "DependsOn": [ + "SettingsgetProfileImageFunctionServiceRoleDefaultPolicyBC909A15", + "SettingsgetProfileImageFunctionServiceRole36952281", + ], + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", + }, + "S3Key": "HASH_REPLACED.zip", + }, + "Environment": { + "Variables": { + "USER_SETTINGS_BUCKET": { + "Ref": "SettingsuserSettingsBucket1D2B648F", + }, + }, + }, + "Handler": "get_profile_image.lambda_handler", + "Role": { + "Fn::GetAtt": [ + "SettingsgetProfileImageFunctionServiceRole36952281", + "Arn", + ], + }, + "Runtime": "python3.11", + "Timeout": 15, + }, + "Type": "AWS::Lambda::Function", + }, + "SettingsgetProfileImageFunctionServiceRole36952281": { + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com", + }, + }, + ], + "Version": "2012-10-17", + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition", + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", + ], + ], + }, + ], + }, + "Type": "AWS::IAM::Role", + }, + "SettingsgetProfileImageFunctionServiceRoleDefaultPolicyBC909A15": { + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "s3:GetObject*", + "s3:GetBucket*", + "s3:List*", + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "SettingsuserSettingsBucket1D2B648F", + "Arn", + ], + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "SettingsuserSettingsBucket1D2B648F", + "Arn", + ], + }, + "/*", + ], + ], + }, + ], + }, + ], + "Version": "2012-10-17", + }, + "PolicyName": "SettingsgetProfileImageFunctionServiceRoleDefaultPolicyBC909A15", + "Roles": [ + { + "Ref": "SettingsgetProfileImageFunctionServiceRole36952281", + }, + ], + }, + "Type": "AWS::IAM::Policy", + }, "SettingsuploadProfileImageFunction5C7EC09C": { "DependsOn": [ "SettingsuploadProfileImageFunctionServiceRoleDefaultPolicy8B4E4832",