Skip to content

Commit ae1735b

Browse files
markussiebertgithub-actions
and
github-actions
authored
fix: raw file content (#1035)
* fix: raw file content * chore: self mutation Signed-off-by: github-actions <[email protected]> --------- Signed-off-by: github-actions <[email protected]> Co-authored-by: github-actions <[email protected]>
1 parent 1afcd09 commit ae1735b

15 files changed

+3066
-2815
lines changed

.projen/deps.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.projenrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const { awscdk } = require('projen');
22
const project = new awscdk.AwsCdkConstructLibrary({
33
author: 'Markus Siebert',
44
authorAddress: '[email protected]',
5-
cdkVersion: '2.1.0',
5+
cdkVersion: '2.144.0',
66
stability: 'stable',
77
homepage: 'https://constructs.dev/packages/cdk-sops-secrets',
88
description:

API.md

+211-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lambda/main.go

+3-5
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,8 @@ func decryptSopsFileContent(content []byte, format string) (data []byte, err err
7676
func (a AWS) updateSecret(sopsHash string, secretArn string, secretContent []byte) (data *secretsmanager.PutSecretValueOutput, err error) {
7777
secretContentString := string(secretContent)
7878
input := &secretsmanager.PutSecretValueInput{
79-
SecretId: &secretArn,
80-
SecretString: &secretContentString,
81-
79+
SecretId: &secretArn,
80+
SecretString: &secretContentString,
8281
ClientRequestToken: &sopsHash,
8382
}
8483
secretResp, secretErr := a.secretsmanager.PutSecretValue(input)
@@ -156,7 +155,6 @@ func (a AWS) syncSopsToSecretsmanager(ctx context.Context, event cfn.Event) (phy
156155
if err != nil {
157156
return tempArn, nil, err
158157
}
159-
//log.Println(string(decryptedContent))
160158
var decryptedInterface interface{}
161159
switch resourceProperties.Format {
162160
case "json":
@@ -197,6 +195,7 @@ func (a AWS) syncSopsToSecretsmanager(ctx context.Context, event cfn.Event) (phy
197195
{
198196
resourceProperties.Flatten = "false"
199197
resourceProperties.StringifyValues = "false"
198+
resourceProperties.ConvertToJSON = "false"
200199
}
201200
default:
202201
return "", nil, errors.New(fmt.Sprintf("Format %s not supported", resourceProperties.Format))
@@ -254,7 +253,6 @@ func (a AWS) syncSopsToSecretsmanager(ctx context.Context, event cfn.Event) (phy
254253
return tempArn, nil, err
255254
}
256255
}
257-
258256
// Write the secret
259257
updateSecretResp, err := a.updateSecret(sopsHash, resourceProperties.SecretARN, decryptedContent)
260258
if err != nil {

package.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/secret-asset.integ.snapshot/SecretIntegrationAsset.assets.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
2-
"version": "15.0.0",
2+
"version": "36.0.0",
33
"files": {
4-
"5d28ae171b06a74255e5da3e3fad8477ed5dffc98b55e885ba99f56afe95cd58": {
4+
"ba702541966a10511eb4b7534ec99ec011e3eb46bf38fe5a5d95c03b97bcde67": {
55
"source": {
6-
"path": "asset.5d28ae171b06a74255e5da3e3fad8477ed5dffc98b55e885ba99f56afe95cd58.zip",
6+
"path": "asset.ba702541966a10511eb4b7534ec99ec011e3eb46bf38fe5a5d95c03b97bcde67.zip",
77
"packaging": "file"
88
},
99
"destinations": {
1010
"current_account-current_region": {
1111
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
12-
"objectKey": "5d28ae171b06a74255e5da3e3fad8477ed5dffc98b55e885ba99f56afe95cd58.zip",
12+
"objectKey": "ba702541966a10511eb4b7534ec99ec011e3eb46bf38fe5a5d95c03b97bcde67.zip",
1313
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
1414
}
1515
}
@@ -79,15 +79,15 @@
7979
}
8080
}
8181
},
82-
"3df20cebd8befd8c2eee521149078eeef238b022cabf42327fc78fa91a5e1539": {
82+
"6877367a0b0bf6c211df7db09e390a34f27dde480c9c7591a54f097775ed6c47": {
8383
"source": {
8484
"path": "SecretIntegrationAsset.template.json",
8585
"packaging": "file"
8686
},
8787
"destinations": {
8888
"current_account-current_region": {
8989
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
90-
"objectKey": "3df20cebd8befd8c2eee521149078eeef238b022cabf42327fc78fa91a5e1539.json",
90+
"objectKey": "6877367a0b0bf6c211df7db09e390a34f27dde480c9c7591a54f097775ed6c47.json",
9191
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
9292
}
9393
}

0 commit comments

Comments
 (0)