Hello.
I wanted to create a simple lambda that will be triggered each time someone is doing deployment for AWS Appconfig profile inside the specific application and only trigger when deployment is completed. So it will run only for envs and profiles connected to that AWS AppConfig application.
I did try to do that:
Resources:
MyLambda:
Condition: isAppConfigRegion
Type: AWS::Serverless::Function
Properties:
CodeUri: src
DeploymentPreference:
Type: AllAtOnce
Role: !GetAtt 'CodeDeployRole.Arn'
Handler: my_app.handler
Role: !GetAtt 'MyLambdaRole.Arn'
AppConfigApplication:
Type: AWS::AppConfig::Application
Condition: isAppConfigRegion
DeletionPolicy: Retain
UpdateReplacePolicy: Retain
Properties:
Name: !Ref AppConfigApplicationName
AppConfigOnDeployExtension:
Condition: isAppConfigRegion
Type: AWS::AppConfig::Extension
Properties:
Name: !Sub "${Name} On Deploy"
Actions:
ON_DEPLOYMENT_COMPLETE:
- Name: OnDeploymentComplete
Uri: !GetAtt MyLambda.Arn
RoleArn: !GetAtt MyLambda.Arn
AppConfigExtensionAssociation:
Condition: isAppConfigRegion
Type: AWS::AppConfig::ExtensionAssociation
Properties:
ExtensionIdentifier: !Ref AppConfigOnDeployExtension
ResourceIdentifier: !Sub
- "arn:aws:appconfig:${AWS::Region}:${AWS::AccountId}:application/${APPLICATION}"
- APPLICATION: !Ref AppConfigApplication
and it looked like its working, but:
- any application which deploys configuration profiles will trigger the extension, even ones that aren't connected to it with
AppConfigExtensionAssociation
- logs from his profile attempts spawn inside log handler connected to my MyLambda, also any log connected to any profile deployment start showing in my logs and trigger my lambda
Is it something wrong with my template.yaml or this is something broken with this extension?