Skip to content

Commit

Permalink
docs: Add example for lambda networking configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinAltmayerTMH committed Dec 4, 2024
1 parent 698098d commit a3419a1
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -127,6 +127,28 @@ const secret = new SopsSecret(this, 'SopsComplexSecretJSON', {
});
```


### Use a VPC for the Lambda Function

Internally, SopsSync uses a lambda function. In some environments it may be necessary to place this lambda function into a VPC and configure subnets and/or security groups for it.
This can be done by creating a custom `SopsSyncProvider`, setting the required networking configuration and passing it to the secret like this:

```typescript
// Create the provider
const provider = new SopsSyncProvider(this, 'CustomSopsSyncProvider', {
vpc: myVpc,
vpcSubnets: subnetSelection,
securityGroups: [mySecurityGroup],
});
// create the secret and pass the the provider to it
const secret = new SopsSecret(this, 'SopsSecret', {
sopsProvider: provider,
secretName: 'myCoolSecret',
sopsFilePath: 'secrets/sopsfile-encrypted.json',
});
```


### UploadType: INLINE / ASSET

I decided, that the default behavior should be "INLINE" because of the following consideration:
@@ -247,4 +269,4 @@ The problem this Construct addresses is so good, already two other implementatio

## License

The Apache-2.0 license. Please have a look at the [LICENSE](LICENSE) and [LICENSE-3RD-PARTY](LICENSE-3RD-PARTY).
The Apache-2.0 license. Please have a look at the [LICENSE](LICENSE) and [LICENSE-3RD-PARTY](LICENSE-3RD-PARTY).

0 comments on commit a3419a1

Please sign in to comment.