You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.
Class: Aws::ElasticBeanstalk::Client
- Inherits:
-
Seahorse::Client::Base
- Object
- Seahorse::Client::Base
- Aws::ElasticBeanstalk::Client
- Defined in:
- (unknown)
Overview
An API client for AWS Elastic Beanstalk. To construct a client, you need to configure a :region
and :credentials
.
elasticbeanstalk = Aws::ElasticBeanstalk::Client.new(
region: region_name,
credentials: credentials,
# ...
)
See #initialize for a full list of supported configuration options.
Region
You can configure a default region in the following locations:
ENV['AWS_REGION']
Aws.config[:region]
Go here for a list of supported regions.
Credentials
Default credentials are loaded automatically from the following locations:
ENV['AWS_ACCESS_KEY_ID']
andENV['AWS_SECRET_ACCESS_KEY']
Aws.config[:credentials]
- The shared credentials ini file at
~/.aws/credentials
(more information) - From an instance profile when running on EC2
You can also construct a credentials object from one of the following classes:
Alternatively, you configure credentials with :access_key_id
and
:secret_access_key
:
# load credentials from disk
creds = YAML.load(File.read('/path/to/secrets'))
Aws::ElasticBeanstalk::Client.new(
access_key_id: creds['access_key_id'],
secret_access_key: creds['secret_access_key']
)
Always load your credentials from outside your application. Avoid configuring credentials statically and never commit them to source control.
Instance Attribute Summary
Attributes inherited from Seahorse::Client::Base
Constructor collapse
-
#initialize(options = {}) ⇒ Aws::ElasticBeanstalk::Client
constructor
Constructs an API client.
API Operations collapse
-
#abort_environment_update(options = {}) ⇒ Struct
Cancels in-progress environment configuration update or application version deployment.
.
-
#apply_environment_managed_action(options = {}) ⇒ Types::ApplyEnvironmentManagedActionResult
Applies a scheduled managed action immediately.
-
#associate_environment_operations_role(options = {}) ⇒ Struct
Add or change the operations role used by an environment.
-
#check_dns_availability(options = {}) ⇒ Types::CheckDNSAvailabilityResultMessage
Checks if the specified CNAME is available.
.
-
#compose_environments(options = {}) ⇒ Types::EnvironmentDescriptionsMessage
Create or update a group of environments that each run a separate component of a single application.
-
#create_application(options = {}) ⇒ Types::ApplicationDescriptionMessage
Creates an application that has one configuration template named
default
and no application versions..
-
#create_application_version(options = {}) ⇒ Types::ApplicationVersionDescriptionMessage
Creates an application version for the specified application.
-
#create_configuration_template(options = {}) ⇒ Types::ConfigurationSettingsDescription
Creates an AWS Elastic Beanstalk configuration template, associated with a specific Elastic Beanstalk application.
-
#create_environment(options = {}) ⇒ Types::EnvironmentDescription
Launches an AWS Elastic Beanstalk environment for the specified application using the specified configuration.
.
-
#create_platform_version(options = {}) ⇒ Types::CreatePlatformVersionResult
Create a new version of your custom platform.
.
-
#create_storage_location(options = {}) ⇒ Types::CreateStorageLocationResultMessage
Creates a bucket in Amazon S3 to store application versions, logs, and other files used by Elastic Beanstalk environments.
-
#delete_application(options = {}) ⇒ Struct
Deletes the specified application along with all associated versions and configurations.
-
#delete_application_version(options = {}) ⇒ Struct
Deletes the specified version from the specified application.
You cannot delete an application version that is associated with a running environment.
-
#delete_configuration_template(options = {}) ⇒ Struct
Deletes the specified configuration template.
When you launch an environment using a configuration template, the environment gets a copy of the template.
-
#delete_environment_configuration(options = {}) ⇒ Struct
Deletes the draft configuration associated with the running environment.
Updating a running environment with any configuration changes creates a draft configuration set.
-
#delete_platform_version(options = {}) ⇒ Types::DeletePlatformVersionResult
Deletes the specified version of a custom platform.
.
-
#describe_account_attributes(options = {}) ⇒ Types::DescribeAccountAttributesResult
Returns attributes related to AWS Elastic Beanstalk that are associated with the calling AWS account.
The result currently has one set of attributes—resource quotas.
. -
#describe_application_versions(options = {}) ⇒ Types::ApplicationVersionDescriptionsMessage
Retrieve a list of application versions.
.
-
#describe_applications(options = {}) ⇒ Types::ApplicationDescriptionsMessage
Returns the descriptions of existing applications.
.
-
#describe_configuration_options(options = {}) ⇒ Types::ConfigurationOptionsDescription
Describes the configuration options that are used in a particular configuration template or environment, or that a specified solution stack defines.
-
#describe_configuration_settings(options = {}) ⇒ Types::ConfigurationSettingsDescriptions
Returns a description of the settings for the specified configuration set, that is, either a configuration template or the configuration set associated with a running environment.
When describing the settings for the configuration set associated with a running environment, it is possible to receive two sets of setting descriptions.
-
#describe_environment_health(options = {}) ⇒ Types::DescribeEnvironmentHealthResult
Returns information about the overall health of the specified environment.
-
#describe_environment_managed_action_history(options = {}) ⇒ Types::DescribeEnvironmentManagedActionHistoryResult
Lists an environment's completed and failed managed actions.
.
-
#describe_environment_managed_actions(options = {}) ⇒ Types::DescribeEnvironmentManagedActionsResult
Lists an environment's upcoming and in-progress managed actions.
.
-
#describe_environment_resources(options = {}) ⇒ Types::EnvironmentResourceDescriptionsMessage
Returns AWS resources for this environment.
.
-
#describe_environments(options = {}) ⇒ Types::EnvironmentDescriptionsMessage
Returns descriptions for existing environments.
.
-
#describe_events(options = {}) ⇒ Types::EventDescriptionsMessage
Returns list of event descriptions matching criteria up to the last 6 weeks.
This action returns the most recent 1,000 events from the specified
NextToken
. -
#describe_instances_health(options = {}) ⇒ Types::DescribeInstancesHealthResult
Retrieves detailed information about the health of instances in your AWS Elastic Beanstalk.
-
#describe_platform_version(options = {}) ⇒ Types::DescribePlatformVersionResult
Describes a platform version.
-
#disassociate_environment_operations_role(options = {}) ⇒ Struct
Disassociate the operations role from an environment.
-
#list_available_solution_stacks(options = {}) ⇒ Types::ListAvailableSolutionStacksResultMessage
Returns a list of the available solution stack names, with the public version first and then in reverse chronological order.
.
-
#list_platform_branches(options = {}) ⇒ Types::ListPlatformBranchesResult
Lists the platform branches available for your account in an AWS Region.
-
#list_platform_versions(options = {}) ⇒ Types::ListPlatformVersionsResult
Lists the platform versions available for your account in an AWS Region.
-
#list_tags_for_resource(options = {}) ⇒ Types::ResourceTagsDescriptionMessage
Return the tags applied to an AWS Elastic Beanstalk resource.
-
#rebuild_environment(options = {}) ⇒ Struct
Deletes and recreates all of the AWS resources (for example: the Auto Scaling group, load balancer, etc.) for a specified environment and forces a restart.
.
-
#request_environment_info(options = {}) ⇒ Struct
Initiates a request to compile the specified type of information of the deployed environment.
Setting the
InfoType
totail
compiles the last lines from the application server log files of every Amazon EC2 instance in your environment. -
#restart_app_server(options = {}) ⇒ Struct
Causes the environment to restart the application container server running on each Amazon EC2 instance.
.
- #retrieve_environment_info(options = {}) ⇒ Types::RetrieveEnvironmentInfoResultMessage
-
#swap_environment_cnames(options = {}) ⇒ Struct
Swaps the CNAMEs of two environments.
.
-
#terminate_environment(options = {}) ⇒ Types::EnvironmentDescription
Terminates the specified environment.
.
-
#update_application(options = {}) ⇒ Types::ApplicationDescriptionMessage
Updates the specified application to have the specified properties.
If a property (for example,
description
) is not provided, the value remains unchanged. -
#update_application_resource_lifecycle(options = {}) ⇒ Types::ApplicationResourceLifecycleDescriptionMessage
Modifies lifecycle settings for an application.
.
-
#update_application_version(options = {}) ⇒ Types::ApplicationVersionDescriptionMessage
Updates the specified application version to have the specified properties.
If a property (for example,
description
) is not provided, the value remains unchanged. -
#update_configuration_template(options = {}) ⇒ Types::ConfigurationSettingsDescription
Updates the specified configuration template to have the specified properties or configuration option values.
If a property (for example,
ApplicationName
) is not provided, its value remains unchanged. -
#update_environment(options = {}) ⇒ Types::EnvironmentDescription
Updates the environment description, deploys a new application version, updates the configuration settings to an entirely new configuration template, or updates select configuration option values in the running environment.
Attempting to update both the release and configuration is not allowed and AWS Elastic Beanstalk returns an
InvalidParameterCombination
error. -
#update_tags_for_resource(options = {}) ⇒ Struct
Update the list of tags applied to an AWS Elastic Beanstalk resource.
-
#validate_configuration_settings(options = {}) ⇒ Types::ConfigurationSettingsValidationMessages
Takes a set of configuration settings and either a configuration template or environment, and determines whether those values are valid.
This action returns a list of messages indicating any errors or warnings associated with the selection of option values.
.
Instance Method Summary collapse
-
#wait_until(waiter_name, params = {}) {|waiter| ... } ⇒ Boolean
Waiters polls an API operation until a resource enters a desired state.
-
#waiter_names ⇒ Array<Symbol>
Returns the list of supported waiters.
Methods inherited from Seahorse::Client::Base
add_plugin, api, #build_request, clear_plugins, define, new, #operation, #operation_names, plugins, remove_plugin, set_api, set_plugins
Methods included from Seahorse::Client::HandlerBuilder
#handle, #handle_request, #handle_response
Constructor Details
#initialize(options = {}) ⇒ Aws::ElasticBeanstalk::Client
Constructs an API client.
Instance Method Details
#abort_environment_update(options = {}) ⇒ Struct
Cancels in-progress environment configuration update or application version deployment.
#apply_environment_managed_action(options = {}) ⇒ Types::ApplyEnvironmentManagedActionResult
Applies a scheduled managed action immediately. A managed action can be applied only if its status is Scheduled
. Get the status and action ID of a managed action with DescribeEnvironmentManagedActions.
#associate_environment_operations_role(options = {}) ⇒ Struct
Add or change the operations role used by an environment. After this call is made, Elastic Beanstalk uses the associated operations role for permissions to downstream services during subsequent calls acting on this environment. For more information, see Operations roles in the AWS Elastic Beanstalk Developer Guide.
#check_dns_availability(options = {}) ⇒ Types::CheckDNSAvailabilityResultMessage
Checks if the specified CNAME is available.
#compose_environments(options = {}) ⇒ Types::EnvironmentDescriptionsMessage
Create or update a group of environments that each run a separate component of a single application. Takes a list of version labels that specify application source bundles for each of the environments to create or update. The name of each environment and other required information must be included in the source bundles in an environment manifest named env.yaml
. See Compose Environments for details.
#create_application(options = {}) ⇒ Types::ApplicationDescriptionMessage
Creates an application that has one configuration template named default
and no application versions.
#create_application_version(options = {}) ⇒ Types::ApplicationVersionDescriptionMessage
Creates an application version for the specified application. You can create an application version from a source bundle in Amazon S3, a commit in AWS CodeCommit, or the output of an AWS CodeBuild build as follows:
Specify a commit in an AWS CodeCommit repository with SourceBuildInformation
.
Specify a build in an AWS CodeBuild with SourceBuildInformation
and BuildConfiguration
.
Specify a source bundle in S3 with SourceBundle
Omit both SourceBuildInformation
and SourceBundle
to use the default sample application.
After you create an application version with a specified Amazon S3 bucket and key location, you can't change that Amazon S3 location. If you change the Amazon S3 location, you receive an exception when you attempt to launch an environment from the application version.
#create_configuration_template(options = {}) ⇒ Types::ConfigurationSettingsDescription
Creates an AWS Elastic Beanstalk configuration template, associated with a specific Elastic Beanstalk application. You define application configuration settings in a configuration template. You can then use the configuration template to deploy different versions of the application with the same configuration settings.
Templates aren't associated with any environment. The EnvironmentName
response element is always null
.
Related Topics
#create_environment(options = {}) ⇒ Types::EnvironmentDescription
Launches an AWS Elastic Beanstalk environment for the specified application using the specified configuration.
#create_platform_version(options = {}) ⇒ Types::CreatePlatformVersionResult
Create a new version of your custom platform.
#create_storage_location(options = {}) ⇒ Types::CreateStorageLocationResultMessage
Creates a bucket in Amazon S3 to store application versions, logs, and other files used by Elastic Beanstalk environments. The Elastic Beanstalk console and EB CLI call this API the first time you create an environment in a region. If the storage location already exists, CreateStorageLocation
still returns the bucket name but does not create a new bucket.
#delete_application(options = {}) ⇒ Struct
Deletes the specified application along with all associated versions and configurations. The application versions will not be deleted from your Amazon S3 bucket.
You cannot delete an application that has a running environment.
#delete_application_version(options = {}) ⇒ Struct
Deletes the specified version from the specified application.
You cannot delete an application version that is associated with a running environment.
#delete_configuration_template(options = {}) ⇒ Struct
Deletes the specified configuration template.
When you launch an environment using a configuration template, the environment gets a copy of the template. You can delete or modify the environment's copy of the template without affecting the running environment.
#delete_environment_configuration(options = {}) ⇒ Struct
Deletes the draft configuration associated with the running environment.
Updating a running environment with any configuration changes creates a draft configuration set. You can get the draft configuration using DescribeConfigurationSettings while the update is in progress or if the update fails. The DeploymentStatus
for the draft configuration indicates whether the deployment is in process or has failed. The draft configuration remains in existence until it is deleted with this action.
#delete_platform_version(options = {}) ⇒ Types::DeletePlatformVersionResult
Deletes the specified version of a custom platform.
#describe_account_attributes(options = {}) ⇒ Types::DescribeAccountAttributesResult
Returns attributes related to AWS Elastic Beanstalk that are associated with the calling AWS account.
The result currently has one set of attributes—resource quotas.
#describe_application_versions(options = {}) ⇒ Types::ApplicationVersionDescriptionsMessage
Retrieve a list of application versions.
#describe_applications(options = {}) ⇒ Types::ApplicationDescriptionsMessage
Returns the descriptions of existing applications.
#describe_configuration_options(options = {}) ⇒ Types::ConfigurationOptionsDescription
Describes the configuration options that are used in a particular configuration template or environment, or that a specified solution stack defines. The description includes the values the options, their default values, and an indication of the required action on a running environment if an option value is changed.
#describe_configuration_settings(options = {}) ⇒ Types::ConfigurationSettingsDescriptions
Returns a description of the settings for the specified configuration set, that is, either a configuration template or the configuration set associated with a running environment.
When describing the settings for the configuration set associated with a running environment, it is possible to receive two sets of setting descriptions. One is the deployed configuration set, and the other is a draft configuration of an environment that is either in the process of deployment or that failed to deploy.
Related Topics
#describe_environment_health(options = {}) ⇒ Types::DescribeEnvironmentHealthResult
Returns information about the overall health of the specified environment. The DescribeEnvironmentHealth operation is only available with AWS Elastic Beanstalk Enhanced Health.
#describe_environment_managed_action_history(options = {}) ⇒ Types::DescribeEnvironmentManagedActionHistoryResult
Lists an environment's completed and failed managed actions.
#describe_environment_managed_actions(options = {}) ⇒ Types::DescribeEnvironmentManagedActionsResult
Lists an environment's upcoming and in-progress managed actions.
#describe_environment_resources(options = {}) ⇒ Types::EnvironmentResourceDescriptionsMessage
Returns AWS resources for this environment.
#describe_environments(options = {}) ⇒ Types::EnvironmentDescriptionsMessage
Returns descriptions for existing environments.
#describe_events(options = {}) ⇒ Types::EventDescriptionsMessage
Returns list of event descriptions matching criteria up to the last 6 weeks.
This action returns the most recent 1,000 events from the specified NextToken
.
#describe_instances_health(options = {}) ⇒ Types::DescribeInstancesHealthResult
Retrieves detailed information about the health of instances in your AWS Elastic Beanstalk. This operation requires enhanced health reporting.
#describe_platform_version(options = {}) ⇒ Types::DescribePlatformVersionResult
Describes a platform version. Provides full details. Compare to ListPlatformVersions, which provides summary information about a list of platform versions.
For definitions of platform version and other platform-related terms, see AWS Elastic Beanstalk Platforms Glossary.
#disassociate_environment_operations_role(options = {}) ⇒ Struct
Disassociate the operations role from an environment. After this call is made, Elastic Beanstalk uses the caller's permissions for permissions to downstream services during subsequent calls acting on this environment. For more information, see Operations roles in the AWS Elastic Beanstalk Developer Guide.
#list_available_solution_stacks(options = {}) ⇒ Types::ListAvailableSolutionStacksResultMessage
Returns a list of the available solution stack names, with the public version first and then in reverse chronological order.
#list_platform_branches(options = {}) ⇒ Types::ListPlatformBranchesResult
Lists the platform branches available for your account in an AWS Region. Provides summary information about each platform branch.
For definitions of platform branch and other platform-related terms, see AWS Elastic Beanstalk Platforms Glossary.
#list_platform_versions(options = {}) ⇒ Types::ListPlatformVersionsResult
Lists the platform versions available for your account in an AWS Region. Provides summary information about each platform version. Compare to DescribePlatformVersion, which provides full details about a single platform version.
For definitions of platform version and other platform-related terms, see AWS Elastic Beanstalk Platforms Glossary.
#list_tags_for_resource(options = {}) ⇒ Types::ResourceTagsDescriptionMessage
Return the tags applied to an AWS Elastic Beanstalk resource. The response contains a list of tag key-value pairs.
Elastic Beanstalk supports tagging of all of its resources. For details about resource tagging, see Tagging Application Resources.
#rebuild_environment(options = {}) ⇒ Struct
Deletes and recreates all of the AWS resources (for example: the Auto Scaling group, load balancer, etc.) for a specified environment and forces a restart.
#request_environment_info(options = {}) ⇒ Struct
Initiates a request to compile the specified type of information of the deployed environment.
Setting the InfoType
to tail
compiles the last lines from the application server log files of every Amazon EC2 instance in your environment.
Setting the InfoType
to bundle
compresses the application server log files for every Amazon EC2 instance into a .zip
file. Legacy and .NET containers do not support bundle logs.
Use RetrieveEnvironmentInfo to obtain the set of logs.
Related Topics
#restart_app_server(options = {}) ⇒ Struct
Causes the environment to restart the application container server running on each Amazon EC2 instance.
#retrieve_environment_info(options = {}) ⇒ Types::RetrieveEnvironmentInfoResultMessage
#swap_environment_cnames(options = {}) ⇒ Struct
Swaps the CNAMEs of two environments.
#terminate_environment(options = {}) ⇒ Types::EnvironmentDescription
Terminates the specified environment.
#update_application(options = {}) ⇒ Types::ApplicationDescriptionMessage
Updates the specified application to have the specified properties.
If a property (for example, description
) is not provided, the value remains unchanged. To clear these properties, specify an empty string.
#update_application_resource_lifecycle(options = {}) ⇒ Types::ApplicationResourceLifecycleDescriptionMessage
Modifies lifecycle settings for an application.
#update_application_version(options = {}) ⇒ Types::ApplicationVersionDescriptionMessage
Updates the specified application version to have the specified properties.
If a property (for example, description
) is not provided, the value remains unchanged. To clear properties, specify an empty string.
#update_configuration_template(options = {}) ⇒ Types::ConfigurationSettingsDescription
Updates the specified configuration template to have the specified properties or configuration option values.
If a property (for example, ApplicationName
) is not provided, its value remains unchanged. To clear such properties, specify an empty string.
Related Topics
#update_environment(options = {}) ⇒ Types::EnvironmentDescription
Updates the environment description, deploys a new application version, updates the configuration settings to an entirely new configuration template, or updates select configuration option values in the running environment.
Attempting to update both the release and configuration is not allowed and AWS Elastic Beanstalk returns an InvalidParameterCombination
error.
When updating the configuration settings to a new template or individual settings, a draft configuration is created and DescribeConfigurationSettings for this environment returns two setting descriptions with different DeploymentStatus
values.
#update_tags_for_resource(options = {}) ⇒ Struct
Update the list of tags applied to an AWS Elastic Beanstalk resource. Two lists can be passed: TagsToAdd
for tags to add or update, and TagsToRemove
.
Elastic Beanstalk supports tagging of all of its resources. For details about resource tagging, see Tagging Application Resources.
If you create a custom IAM user policy to control permission to this operation, specify one of the following two virtual actions (or both) instead of the API operation name:
- elasticbeanstalk:AddTags
-
Controls permission to call
UpdateTagsForResource
and pass a list of tags to add in theTagsToAdd
parameter. - elasticbeanstalk:RemoveTags
-
Controls permission to call
UpdateTagsForResource
and pass a list of tag keys to remove in theTagsToRemove
parameter.
For details about creating a custom user policy, see Creating a Custom User Policy.
#validate_configuration_settings(options = {}) ⇒ Types::ConfigurationSettingsValidationMessages
Takes a set of configuration settings and either a configuration template or environment, and determines whether those values are valid.
This action returns a list of messages indicating any errors or warnings associated with the selection of option values.
#wait_until(waiter_name, params = {}) {|waiter| ... } ⇒ Boolean
Waiters polls an API operation until a resource enters a desired state.
Basic Usage
Waiters will poll until they are succesful, they fail by entering a terminal state, or until a maximum number of attempts are made.
# polls in a loop, sleeping between attempts client.waiter_until(waiter_name, params)
Configuration
You can configure the maximum number of polling attempts, and the delay (in seconds) between each polling attempt. You configure waiters by passing a block to #wait_until:
# poll for ~25 seconds
client.wait_until(...) do |w|
w.max_attempts = 5
w.delay = 5
end
Callbacks
You can be notified before each polling attempt and before each
delay. If you throw :success
or :failure
from these callbacks,
it will terminate the waiter.
started_at = Time.now
client.wait_until(...) do |w|
# disable max attempts
w.max_attempts = nil
# poll for 1 hour, instead of a number of attempts
w.before_wait do |attempts, response|
throw :failure if Time.now - started_at > 3600
end
end
Handling Errors
When a waiter is successful, it returns true
. When a waiter
fails, it raises an error. All errors raised extend from
Waiters::Errors::WaiterFailed.
begin
client.wait_until(...)
rescue Aws::Waiters::Errors::WaiterFailed
# resource did not enter the desired state in time
end
#waiter_names ⇒ Array<Symbol>
Returns the list of supported waiters. The following table lists the supported waiters and the client method they call:
Waiter Name | Client Method | Default Delay: | Default Max Attempts: |
---|---|---|---|
:environment_exists | #describe_environments | 20 | 20 |
:environment_terminated | #describe_environments | 20 | 20 |
:environment_updated | #describe_environments | 20 | 20 |