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.

Container for the parameters to the UpdateEnvironment operation. 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.

Inheritance Hierarchy

System.Object
  Amazon.Runtime.AmazonWebServiceRequest
    Amazon.ElasticBeanstalk.AmazonElasticBeanstalkRequest
      Amazon.ElasticBeanstalk.Model.UpdateEnvironmentRequest

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

Syntax

C#
public class UpdateEnvironmentRequest : AmazonElasticBeanstalkRequest
         IAmazonWebServiceRequest

The UpdateEnvironmentRequest type exposes the following members

Constructors

NameDescription
Public Method UpdateEnvironmentRequest()

Empty constructor used to set properties independently even when a simple constructor is available

Properties

NameTypeDescription
Public Property ApplicationName System.String

Gets and sets the property ApplicationName.

The name of the application with which the environment is associated.

Public Property Description System.String

Gets and sets the property Description.

If this parameter is specified, AWS Elastic Beanstalk updates the description of this environment.

Public Property EnvironmentId System.String

Gets and sets the property EnvironmentId.

The ID of the environment to update.

If no environment with this ID exists, AWS Elastic Beanstalk returns an InvalidParameterValue error.

Condition: You must specify either this or an EnvironmentName, or both. If you do not specify either, AWS Elastic Beanstalk returns MissingRequiredParameter error.

Public Property EnvironmentName System.String

Gets and sets the property EnvironmentName.

The name of the environment to update. If no environment with this name exists, AWS Elastic Beanstalk returns an InvalidParameterValue error.

Condition: You must specify either this or an EnvironmentId, or both. If you do not specify either, AWS Elastic Beanstalk returns MissingRequiredParameter error.

Public Property GroupName System.String

Gets and sets the property GroupName.

The name of the group to which the target environment belongs. Specify a group name only if the environment's name is specified in an environment manifest and not with the environment name or environment ID parameters. See Environment Manifest (env.yaml) for details.

Public Property OptionSettings System.Collections.Generic.List<Amazon.ElasticBeanstalk.Model.ConfigurationOptionSetting>

Gets and sets the property OptionSettings.

If specified, AWS Elastic Beanstalk updates the configuration set associated with the running environment and sets the specified configuration options to the requested value.

Public Property OptionsToRemove System.Collections.Generic.List<Amazon.ElasticBeanstalk.Model.OptionSpecification>

Gets and sets the property OptionsToRemove.

A list of custom user-defined configuration options to remove from the configuration set for this environment.

Public Property PlatformArn System.String

Gets and sets the property PlatformArn.

The ARN of the platform, if used.

Public Property SolutionStackName System.String

Gets and sets the property SolutionStackName.

This specifies the platform version that the environment will run after the environment is updated.

Public Property TemplateName System.String

Gets and sets the property TemplateName.

If this parameter is specified, AWS Elastic Beanstalk deploys this configuration template to the environment. If no such configuration template is found, AWS Elastic Beanstalk returns an InvalidParameterValue error.

Public Property Tier Amazon.ElasticBeanstalk.Model.EnvironmentTier

Gets and sets the property Tier.

This specifies the tier to use to update the environment.

Condition: At this time, if you change the tier version, name, or type, AWS Elastic Beanstalk returns InvalidParameterValue error.

Public Property VersionLabel System.String

Gets and sets the property VersionLabel.

If this parameter is specified, AWS Elastic Beanstalk deploys the named application version to the environment. If no such application version is found, returns an InvalidParameterValue error.

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:
Supported in: 8.0 and newer, Core 3.1

.NET Standard:
Supported in: 2.0

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