How can you get the Elastic Beanstalk Application

2019-06-15 13:39发布

We want to be able to retrieve the elastic beanstalk application version in our PHP code. I don't see that EB passes it to us in any server configuration files, which I find it strange. Does anyone else know how we might be able to get this?

7条回答
你好瞎i
2楼-- · 2019-06-15 14:18

You can use AWS Elastic Beanstalk API to retrieve your application version information.

Describe Application Versions returns descriptions for existing application versions.

Sample request

https://elasticbeanstalk.us-east-1.amazon.com/?ApplicationName=SampleApp
&Operation=DescribeApplicationVersions
&AuthParams 

Sample response

<DescribeApplicationVersionsResponse xmlns="https://elasticbeanstalk.amazonaws.com/docs/2010-12-01/">
  <DescribeApplicationVersionsResult>
    <ApplicationVersions>
      <member>
        <SourceBundle>
          <S3Bucket>amazonaws.com</S3Bucket>
          <S3Key>sample.war</S3Key>
        </SourceBundle>
        <VersionLabel>Version1</VersionLabel>
        <Description>description</Description>
        <ApplicationName>SampleApp</ApplicationName>
        <DateCreated>2010-11-17T03:21:59.161Z</DateCreated>
        <DateUpdated>2010-11-17T03:21:59.161Z</DateUpdated>
      </member>
    </ApplicationVersions>
  </DescribeApplicationVersionsResult>
  <ResponseMetadata>
    <RequestId>773cd80a-f26c-11df-8a78-9f77047e0d0c</RequestId>
  </ResponseMetadata>
</DescribeApplicationVersionsResponse>
查看更多
登录 后发表回答