AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

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.

Note:

For .NET Core this operation is only available in asynchronous form. Please refer to UpdateEnvironmentAsync.

Namespace: Amazon.ElasticBeanstalk
Assembly: AWSSDK.ElasticBeanstalk.dll
Version: 3.x.y.z

Syntax

C#
public abstract UpdateEnvironmentResponse UpdateEnvironment(
         UpdateEnvironmentRequest request
)

Parameters

request
Type: Amazon.ElasticBeanstalk.Model.UpdateEnvironmentRequest

Container for the necessary parameters to execute the UpdateEnvironment service method.

Return Value


The response from the UpdateEnvironment service method, as returned by ElasticBeanstalk.

Exceptions

ExceptionCondition
InsufficientPrivilegesException The specified account does not have sufficient privileges for one or more AWS services.
TooManyBucketsException The specified account has reached its limit of Amazon S3 buckets.

Examples

The following operation updates an environment named "my-env" to version "v2" of the application to which it belongs:

To update an environment to a new version


var client = new AmazonElasticBeanstalkClient();
var response = client.UpdateEnvironment(new UpdateEnvironmentRequest 
{
    EnvironmentName = "my-env",
    VersionLabel = "v2"
});

string applicationName = response.ApplicationName;
string cname = response.CNAME;
DateTime dateCreated = response.DateCreated;
DateTime dateUpdated = response.DateUpdated;
string endpointURL = response.EndpointURL;
string environmentId = response.EnvironmentId;
string environmentName = response.EnvironmentName;
string health = response.Health;
string solutionStackName = response.SolutionStackName;
string status = response.Status;
EnvironmentTier tier = response.Tier;
string versionLabel = response.VersionLabel;

            

The following operation configures several options in the aws:elb:loadbalancer namespace:

To configure option settings


var client = new AmazonElasticBeanstalkClient();
var response = client.UpdateEnvironment(new UpdateEnvironmentRequest 
{
    EnvironmentName = "my-env",
    OptionSettings = new List<ConfigurationOptionSetting> {
        new ConfigurationOptionSetting {
            Namespace = "aws:elb:healthcheck",
            OptionName = "Interval",
            Value = "15"
        },
        new ConfigurationOptionSetting {
            Namespace = "aws:elb:healthcheck",
            OptionName = "Timeout",
            Value = "8"
        },
        new ConfigurationOptionSetting {
            Namespace = "aws:elb:healthcheck",
            OptionName = "HealthyThreshold",
            Value = "2"
        },
        new ConfigurationOptionSetting {
            Namespace = "aws:elb:healthcheck",
            OptionName = "UnhealthyThreshold",
            Value = "3"
        }
    }
});

bool abortableOperationInProgress = response.AbortableOperationInProgress;
string applicationName = response.ApplicationName;
string cname = response.CNAME;
DateTime dateCreated = response.DateCreated;
DateTime dateUpdated = response.DateUpdated;
string endpointURL = response.EndpointURL;
string environmentId = response.EnvironmentId;
string environmentName = response.EnvironmentName;
string health = response.Health;
string solutionStackName = response.SolutionStackName;
string status = response.Status;
EnvironmentTier tier = response.Tier;
string versionLabel = response.VersionLabel;

            

Version Information

.NET Framework:
Supported in: 4.5 and newer, 3.5

See Also