Skip to content

Commit 9716be3

Browse files
authored
Merge pull request #400 from epam/release/1.13
Release 1.13
2 parents 772a3f7 + 868d2ce commit 9716be3

File tree

71 files changed

+2498
-170
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+2498
-170
lines changed

.github/workflows/ci-java.yml

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,40 @@ jobs:
2525
uses: ./.github/workflows/maven.yml
2626
if: github.repository_owner == 'epam'
2727

28+
check-modified-files:
29+
runs-on: ubuntu-latest
30+
outputs:
31+
files_modified: ${{ steps.check_files.outputs.run_publish_steps }}
32+
steps:
33+
- name: Checkout code
34+
uses: actions/checkout@v4
35+
- name: Check modified files
36+
id: check_files
37+
run: |
38+
git fetch origin master
39+
changed_files=$(git diff --name-only origin/master)
40+
echo "Changed files: ${changed_files}"
41+
checked_directory="plugin/"
42+
for file in ${changed_files}
43+
do
44+
if [[ ${file} == ${checked_directory}* ]]
45+
then
46+
echo "Target directory was modified."
47+
echo "run_publish_steps=true" >>$GITHUB_OUTPUT
48+
exit 0
49+
fi
50+
done
51+
echo "Target directory was not modified."
52+
echo "run_publish_steps=false" >>$GITHUB_OUTPUT
53+
echo "dist=/tmp/bavp/dist" >>$GITHUB_OUTPUT
54+
shell: bash
55+
2856
release-snapshot-to-maven-central:
2957
name: Publish SNAPSHOT package to MavenCentral
3058
environment: release-snapshot
31-
if: github.repository_owner == 'epam' && github.event_name == 'push' && github.ref == 'refs/heads/master'
59+
needs: [maven, check-modified-files]
3260
runs-on: ubuntu-latest
33-
needs: maven
61+
if: github.repository_owner == 'epam' && github.event_name == 'push' && github.ref == 'refs/heads/master' && needs.check-modified-files.outputs.files_modified == 'true'
3462

3563
steps:
3664
- uses: actions/checkout@v4
@@ -46,14 +74,15 @@ jobs:
4674
settings-path: ${{ github.workspace }}
4775
- name: Set SNAPSHOT in version
4876
run: |
77+
gpg --version
4978
syndicate_plugin_version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout --file ./plugin/pom.xml | xargs)
5079
mvn versions:set -DnewVersion="${syndicate_plugin_version}-SNAPSHOT" --file ./plugin/pom.xml
5180
mvn versions:commit --file ./plugin/pom.xml
5281
- name: Build with Maven
5382
run: mvn -B package --file ./plugin/pom.xml
5483
- name: Deploy development version binaries (Snapshots)
5584
env:
56-
OSS_SONATYPE_USERNAME: ${{ vars.OSSRH_USERNAME }}
85+
OSS_SONATYPE_USERNAME: ${{ secrets.OSSRH_USERNAME }}
5786
OSS_SONATYPE_TOKEN: ${{ secrets.OSSRH_TOKEN }}
5887
run: |
5988
echo Checking variables ${{ secrets.OSSRH_USERNAME }}
@@ -64,9 +93,9 @@ jobs:
6493
release-to-maven-central:
6594
name: Publish released package to MavenCentral
6695
environment: release-maven-central
67-
if: github.repository_owner == 'epam' && github.event.action == 'published'
96+
needs: [maven, check-modified-files]
6897
runs-on: ubuntu-latest
69-
needs: maven
98+
if: github.repository_owner == 'epam' && github.event.action == 'published' && needs.check-modified-files.outputs.files_modified == 'true'
7099

71100
steps:
72101
- uses: actions/checkout@v4
@@ -88,6 +117,7 @@ jobs:
88117
# -U force updates just to make sure we are using latest dependencies
89118
# -B Batch mode (do not ask for user input), just in case
90119
# -P activate profile
120+
gpg --version
91121
mvn -U -B clean deploy -P release --file ./plugin/pom.xml
92122
env:
93123
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,24 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
# [1.13.0] - 2024-07-10
8+
- Added possibility to configure `FunctionResponseTypes` for lambda functions
9+
- Updated maven plugin version to 1.12.0 with support of `FunctionResponseTypes`
10+
- Added possibility to set up Cognito user pool ID in lambda function environment variable
11+
- Added possibility to set up Cognito user pool client ID in lambda function environment variable
12+
- Fix lambda triggers deletion when removed from meta
13+
- Fix resources dependencies resolving
14+
- Fix losing successfully deployed resources from the output file during deployment with the option `--continue_deploy`
15+
- Fix API Gateway duplication in case of existing API Gateway with the same name
16+
- Fix detection of usage `--rollback_on_error` option with an incompatible option `--continue_deploy`
17+
- Changed datetime format for lock attributes in the `.syndicate` file to UTC format
18+
- The Syndicate Java plugin version updated to 1.13.0 with changes:
19+
- The ResourceType enum for the @DependsOn annotation extended with new type ResourceType.COGNITO_USER_POOL
20+
- The @EnvironmentVariable annotation for the Syndicate Java plugin improved to support the value transformer
21+
- A new value transformer type created ValueTransformer.USER_POOL_NAME_TO_USER_POOL_ID
22+
- A new value transformer type created ValueTransformer.USER_POOL_NAME_TO_CLIENT_ID
23+
- The generate Java lambda template changed to use the Syndicate Java plugin version 1.13.0
24+
725
# [1.12.0] - 2024-06-20
826
- Added ability for `clean` command to automatically resolve if `--rollback` is needed.
927
- Fixed an issue related to `log group already exists` error while deploying or updating `lambda`.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
account_id: ACCOUNT_ID
2+
region: REGION_NAME
3+
deploy_target_bucket: BUCKET_NAME
4+
project_path: PROJECT_FOLDER
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
account_id: ACCOUNT_ID
2+
region: REGION_NAME
3+
logs_expiration: 30
4+
5+
pool_name: USERPOOL_NAME
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#### This example shows a Syndicate configuration for deploying:
2+
* 1 Java Lambda function;
3+
* 1 IAM role attached to lambda;
4+
* 1 Custom IAM policy attached to role;
5+
* 1 API Gateway
6+
* 1 Cognito User Pool
7+
8+
#### To deploy this example:
9+
10+
##### 1. Replace following placeholders in `syndicate.yml`:
11+
* `ACCOUNT_ID` - AWS account id where syndicate will deploy this demo;
12+
* `REGION_NAME` - AWS region where syndicate will deploy this demo;
13+
* `BUCKET_NAME` - bucket name to upload deployment artifacts, must be unique across all AWS accounts;
14+
* `PROJECT_FOLDER` - absolute path to the project folder;
15+
16+
##### 2. Replace following placeholder in `syndicate_aliases.yml`:
17+
* `ACCOUNT_ID` - AWS account id where syndicate will deploy this demo;
18+
* `REGION_NAME` - AWS region where syndicate will deploy this demo;
19+
* `USERPOOL_NAME` - desired Cognito User Pool name;
20+
21+
##### 3. Export config files path (set environment variable SDCT_CONF):
22+
* Unix: `export SDCT_CONF=$CONFIG_FOLDER`, in this example $CONFIG_FOLDER is PROJECT_FOLDER/.syndicate-config-demo-apigateway-cognito;
23+
* Windows (cmd): `set SDCT_CONF=%CONFIG_FOLDER%`, in this example %CONFIG_FOLDER% is PROJECT_FOLDER/.syndicate-config-demo-apigateway-cognito;
24+
25+
##### 4. Build bundle:
26+
27+
`syndicate build`
28+
29+
##### 5. Deploy:
30+
31+
`syndicate deploy`
32+
33+
#### 6. To clean project resources:
34+
35+
`syndicate clean`
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
{
2+
"lambda-cognito-execution": {
3+
"policy_content": {
4+
"Statement": [
5+
{
6+
"Action": [
7+
"logs:CreateLogGroup",
8+
"logs:CreateLogStream",
9+
"logs:PutLogEvents",
10+
11+
"cognito-idp:DescribeUserPool",
12+
"cognito-idp:GetUser",
13+
"cognito-idp:ListUsers",
14+
"cognito-idp:AdminCreateUser",
15+
"cognito-idp:AdminInitiateAuth",
16+
"cognito-idp:GetIdentityProviderByIdentifier",
17+
"cognito-idp:ListUserPools",
18+
"cognito-idp:ListUserPoolClients",
19+
"cognito-idp:AdminRespondToAuthChallenge",
20+
21+
"ssm:PutParameter",
22+
"ssm:GetParameter",
23+
"kms:Decrypt"
24+
],
25+
"Effect": "Allow",
26+
"Resource": "*"
27+
}
28+
],
29+
"Version": "2012-10-17"
30+
},
31+
"resource_type": "iam_policy"
32+
},
33+
34+
"api-handler-role": {
35+
"predefined_policies": [],
36+
"principal_service": "lambda",
37+
"custom_policies": [
38+
"lambda-cognito-execution"
39+
],
40+
"resource_type": "iam_role"
41+
},
42+
43+
"${pool_name}": {
44+
"resource_type": "cognito_idp",
45+
"password_policy": {
46+
"minimum_length": 8,
47+
"require_uppercase": false,
48+
"require_symbols": false,
49+
"require_lowercase": false,
50+
"require_numbers": false
51+
},
52+
"auto_verified_attributes": [],
53+
"sms_configuration": {},
54+
"username_attributes": [],
55+
"custom_attributes": [],
56+
"client": {
57+
"client_name": "client-app",
58+
"generate_secret": false,
59+
"explicit_auth_flows": [
60+
"ALLOW_ADMIN_USER_PASSWORD_AUTH",
61+
"ALLOW_CUSTOM_AUTH",
62+
"ALLOW_USER_SRP_AUTH",
63+
"ALLOW_REFRESH_TOKEN_AUTH"
64+
]
65+
}
66+
},
67+
68+
"demo-api-gateway": {
69+
"resource_type": "api_gateway",
70+
"deploy_stage": "api",
71+
"authorizers": {
72+
"authorizer": {
73+
"type": "COGNITO_USER_POOLS",
74+
"identity_source": "method.request.header.Authorization",
75+
"user_pools": [
76+
"${pool_name}"
77+
],
78+
"ttl": 300
79+
}
80+
},
81+
"resources": {
82+
"/": {
83+
"enable_cors": false,
84+
"GET": {
85+
"enable_proxy": true,
86+
"authorization_type": "NONE",
87+
"integration_type": "lambda",
88+
"lambda_name": "api-handler",
89+
"api_key_required": false,
90+
"method_request_parameters": {},
91+
"integration_request_body_template": {},
92+
"responses": [],
93+
"integration_responses": [],
94+
"default_error_pattern": true
95+
}
96+
},
97+
"/secured": {
98+
"enable_cors": false,
99+
"GET": {
100+
"enable_proxy": true,
101+
"authorization_type": "authorizer",
102+
"integration_type": "lambda",
103+
"lambda_name": "api-handler",
104+
"api_key_required": false,
105+
"method_request_parameters": {},
106+
"integration_request_body_template": {},
107+
"responses": [],
108+
"integration_responses": [],
109+
"default_error_pattern": true
110+
}
111+
},
112+
"/signin": {
113+
"enable_cors": false,
114+
"POST": {
115+
"enable_proxy": true,
116+
"authorization_type": "NONE",
117+
"integration_type": "lambda",
118+
"lambda_name": "api-handler",
119+
"api_key_required": false,
120+
"method_request_parameters": {},
121+
"integration_request_body_template": {},
122+
"responses": [],
123+
"integration_responses": [],
124+
"default_error_pattern": true
125+
}
126+
},
127+
"/signup": {
128+
"enable_cors": false,
129+
"POST": {
130+
"enable_proxy": true,
131+
"authorization_type": "NONE",
132+
"integration_type": "lambda",
133+
"lambda_name": "api-handler",
134+
"api_key_required": false,
135+
"method_request_parameters": {},
136+
"integration_request_body_template": {},
137+
"responses": [],
138+
"integration_responses": [],
139+
"default_error_pattern": true
140+
}
141+
}
142+
}
143+
}
144+
}

0 commit comments

Comments
 (0)