Ejemplo n.º 1
0
        public void ElasticBeanstalkUpdateEnvironment()
        {
            #region to-update-an-environment-to-a-new-version-1456278210718

            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;

            #endregion
        }
Ejemplo n.º 2
0
        public void DisableScheduleActions(bool command)
        {
            var requestSettings = new DescribeConfigurationSettingsRequest()
            {
                ApplicationName = $"Safe-Arrival-{ environment.ToString()}-{GlobalVariables.Color}",
                EnvironmentName = $"{ environment.ToString()}-{GlobalVariables.Color}-API",
            };
            var response = client.DescribeConfigurationSettings(requestSettings);

            var suspendSettings = response.ConfigurationSettings[0].OptionSettings.FindAll(
                o => o.Namespace == "aws:autoscaling:scheduledaction" && o.OptionName == "Suspend");

            foreach (var setting in suspendSettings)
            {
                setting.Value = command.ToString();
            }
            var request = new UpdateEnvironmentRequest()
            {
                ApplicationName = $"Safe-Arrival-{ environment.ToString()}-{GlobalVariables.Color}",
                EnvironmentName = $"{ environment.ToString()}-{GlobalVariables.Color}-API",
                OptionSettings  = suspendSettings
            };
            var responseUpdate = client.UpdateEnvironment(request);
        }
Ejemplo n.º 3
0
        public void ElasticBeanstalkUpdateEnvironment()
        {
            #region to-configure-option-settings-1456278286349

            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;

            #endregion
        }