Use of Parameter Store in Elastic Beanstalk ebextension config

0

Hi

I need help to use Parameter Store variables in Elastic Beanstalk ebextension config but I getting error while depoying using Codepipeline.

Here is my file in /.ebextensions/certs.config


option_settings:
  aws:elasticbeanstalk:application:environment: 
    SSL-BUCKET: '{{resolve:ssm:SSL-BUCKET:2}}' 
    
Resources:
  AWSEBAutoScalingGroup:
    Metadata:
      AWS::CloudFormation::Authentication:
        S3Auth:
          type: "s3"
          buckets: ["$SSL-BUCKET"]
          roleName: 
            "Fn::GetOptionSetting": 
              Namespace: "aws:autoscaling:launchconfiguration"
              OptionName: "IamInstanceProfile"
              DefaultValue: "aws-elasticbeanstalk-ec2-role"
              
files: 
  # Chain Crt
  "/etc/pki/tls/certs/certs.crt":
    mode: "000644"
    owner: root
    group: root
    authentication: "S3Auth"
    source: https://{$SSL-BUCKET}.s3.ca-central-1.amazonaws.com/certs.crt
    ignoreErrors: true  

container_commands:   
  01-build:
    command: "npm run build"
  02-restart_nginx:
    command: "service nginx restart"   

Is anyone can help

  • Hello, Can you elaborate on what error you are receiving?

  • Hi Andrew

    here is log of eb-engine

    2023/07/24 13:32:07.448603 [INFO] Error occurred during build: Failed to retrieve https://$SSL-BUCKET.s3.ca-central-1.amazonaws.com/cert.crt: 'NoneType' object has no attribute 'is_default'

    2023/07/24 13:32:07.448631 [ERROR] An error occurred during execution of command [app-deploy] - [PreBuildEbExtension]. Stop running the command. Error: EbExtension build failed. Please refer to /var/log/cfn-init.log for more details.

    2023/07/24 13:32:07.448637 [INFO] Executing cleanup logic 2023/07/24 13:32:07.448775 [INFO] CommandService Response: {"status":"FAILURE","api_version":"1.0","results":[{"status":"FAILURE","msg":"Engine execution has encountered an error.","returncode":1,"events":[{"msg":"Instance deployment failed. For details, see 'eb-engine.log'.","timestamp":1690205527448,"severity":"ERROR"}]}]}

    2023/07/24 13:32:07.449685 [INFO] Platform Engine finished execution on command: app-deploy

profile picture
Paresh
gefragt vor 10 Monaten90 Aufrufe
Keine Antworten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen