Is AppConfig extension association is broken?

1

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:

  1. any application which deploys configuration profiles will trigger the extension, even ones that aren't connected to it with AppConfigExtensionAssociation
  2. 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?

Rogal
已提問 8 個月前檢視次數 126 次
沒有答案

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南