-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from Flaconi/plt-0-add-license-key-secret
PLT-9 - Add License Key Secret to allow usage of lambda extension for…
- Loading branch information
Showing
3 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
AWSTemplateFormatVersion: 2010-09-09 | ||
Parameters: | ||
LicenseKey: | ||
Type: String | ||
Description: The New Relic account license key | ||
AllowedPattern: '(?:eu-)?[0-9a-f]+(?:[A-Z]{4})?' | ||
NoEcho: true | ||
SecretName: | ||
Type: String | ||
Description: The friendly name for the license key secret | ||
Default: NEW_RELIC_LICENSE_KEY | ||
PolicyName: | ||
Type: String | ||
Description: Policy name of the policy to use to allow access to the license key secret. | ||
Default: NewRelic-ViewLicenseKey | ||
LicenseKeySecretExportName: | ||
Type: String | ||
Default: NewRelic-LicenseKeySecretARN | ||
ViewPolicyExportName: | ||
Type: String | ||
Default: NewRelic-ViewLicenseKeyPolicyARN | ||
Region: | ||
Type: String | ||
|
||
Resources: | ||
LicenseKeySecret: | ||
Type: 'AWS::SecretsManager::Secret' | ||
Properties: | ||
Description: The New Relic license key, for sending telemetry | ||
Name: !Sub "${SecretName}" | ||
SecretString: !Sub '{ "LicenseKey": "${LicenseKey}" }' | ||
ViewNewRelicLicenseKeyPolicy: | ||
Type: 'AWS::IAM::ManagedPolicy' | ||
Properties: | ||
ManagedPolicyName: !Sub | ||
- ${PolicyName}-${Region} | ||
- { PolicyName: !Ref PolicyName, Region: !Ref Region } | ||
PolicyDocument: | ||
Version: 2012-10-17 | ||
Statement: | ||
- Effect: Allow | ||
Action: | ||
- 'secretsmanager:GetSecretValue' | ||
Resource: !Ref LicenseKeySecret | ||
|
||
Outputs: | ||
LicenseKeySecretARN: | ||
Description: The ARN of the LicenseKey Secret | ||
Value: !Ref LicenseKeySecret | ||
Export: | ||
Name: !Sub "${AWS::StackName}-${LicenseKeySecretExportName}" | ||
ViewPolicyARN: | ||
Description: The ARN of the LicenseKey Secret's view policy | ||
Value: !Ref ViewNewRelicLicenseKeyPolicy | ||
Export: | ||
Name: !Sub "${AWS::StackName}-${ViewPolicyExportName}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters