Search code examples
amazon-web-servicesyamlamazon-elastic-beanstalkaws-cloudformationamazon-iam

elastic beanstalk no platform error when trying to create EBS using YAML


I am trying to creat an elastic bean stalk using IAC for that I am getting the error message "Resource handler returned message: "No Platform named 'arn:aws:elasticbeanstalk:us-east-1::platform/Python 3.7 running on 64bit Amazon Linux 2023/3.0.3' found. (Service: ElasticBeanstalk, Status Code: 400, Request ID: a77a23cb-7424-4dcf-bf80-0de16b317b0a)" (RequestToken: 90389ea8-1a57-7168-7572-4ff0a6770861, HandlerErrorCode: InvalidRequest)"

MyEBSProfile:
    Type: AWS::ElasticBeanstalk::Environment
    Properties:
      ApplicationName: cloud-devops
      CNAMEPrefix: coivid_app
      Description: EBS to deploy covid analysis web app
      EnvironmentName: cloud_devops_covid_app
      OperationsRole: 
        Fn::GetAtt: 
          - RootRole
          - Arn
      PlatformArn: arn:aws:elasticbeanstalk:us-east-1::platform/Python 3.11 running on 64bit Amazon Linux 2023/4.0.5
      #SolutionStackName: String
      TemplateName: String
      Tier: 
        Name: WebServer
        Type: Standard
      VersionLabel: v1.0

I have tried a lot of options including I have tried to create a fake Python environment using the console and copying the arn provided by AWS console, but still no use. I am not able to find the error properly. This is my first YAML script so I am not sure what to do.


Solution

  • PlatformArn is for custom platfroms only. If you want to use AWS provided one, you have to use SolutionStackName instead:

    MyEBSProfile:
        Type: AWS::ElasticBeanstalk::Environment
        Properties:
          ApplicationName: cloud-devops
          CNAMEPrefix: coivid_app
          Description: EBS to deploy covid analysis web app
          EnvironmentName: cloud_devops_covid_app
          OperationsRole: 
            Fn::GetAtt: 
              - RootRole
              - Arn
          SolutionStackName: 64bit Amazon Linux 2023 v4.0.5 running Python 3.11 
          #SolutionStackName: String
          TemplateName: String
          Tier: 
            Name: WebServer
            Type: Standard
          VersionLabel: v1.0