Skip to content

Conversation

@philasmar
Copy link
Contributor

Issue #, if available:
DOTNET-6108

Description of changes:

  • Added support for replacement tokens that are not of type String
  • Added new replacement token to check if there is a default VPC
  • Recipes that use Fargate now UseDefault VPC if there is a default VPC, if not then CreateNew will be selected by default.
  • All other recipes have been updated to support creating a new VPC

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@philasmar philasmar requested review from 96malhar, ashovlin and normj July 12, 2022 15:17
@philasmar philasmar force-pushed the asmarp/fix-no-default-vpc branch from e3fd591 to 7821440 Compare July 12, 2022 15:40
@philasmar philasmar force-pushed the asmarp/fix-no-default-vpc branch from 8fc2c21 to 8331e0b Compare August 3, 2022 16:25
@philasmar philasmar requested review from ashovlin and normj August 3, 2022 16:44
Copy link
Member

@normj normj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redeployment to a loadbalanced beanstalk environment that was created with the 1.0 version of the CLI fails with this branch. I'm getting the following serialization error.

Unhandled exception.  This is a bug.  Please copy the stack trace below and file a bug at https://github.com/aws/aws-dotnet-deploy.
Exception has been thrown by the target of an invocation.
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Span`1& arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at AWS.Deploy.CLI.Commands.DeployCommand.DisplayValue(Recommendation recommendation, OptionSettingItem optionSetting, Int32 optionSettingNumber, Int32 optionSettingsCount, Type typeHintResponseType, DisplayOptionSettingsMode mode) in C:\codebase\aws-dotnet-deploy\src\AWS.Deploy.CLI\Commands\DeployCommand.cs:line 785
   at AWS.Deploy.CLI.Commands.DeployCommand.DisplayOptionSetting(Recommendation recommendation, OptionSettingItem optionSetting, Int32 optionSettingNumber, Int32 optionSettingsCount, DisplayOptionSettingsMode mode) in C:\codebase\aws-dotnet-deploy\src\AWS.Deploy.CLI\Commands\DeployCommand.cs:line 685
   at AWS.Deploy.CLI.Commands.DeployCommand.GetSelectedRecommendationFromPreviousDeployment(Orchestrator orchestrator, List`1 recommendations, CloudApplication deployedApplication, DeploymentSettings deploymentSettings, String deploymentProjectPath) in C:\codebase\aws-dotnet-deploy\src\AWS.Deploy.CLI\Commands\DeployCommand.cs:line 361
   at AWS.Deploy.CLI.Commands.DeployCommand.InitializeDeployment(String cloudApplicationName, DeploymentSettings deploymentSettings, String deploymentProjectPath) in C:\codebase\aws-dotnet-deploy\src\AWS.Deploy.CLI\Commands\DeployCommand.cs:line 213
   at AWS.Deploy.CLI.Commands.DeployCommand.ExecuteAsync(String applicationName, String deploymentProjectPath, DeploymentSettings deploymentSettings) in C:\codebase\aws-dotnet-deploy\src\AWS.Deploy.CLI\Commands\DeployCommand.cs:line 118
   at AWS.Deploy.CLI.Commands.CommandFactory.<BuildDeployCommand>b__43_0(DeployCommandHandlerInput input) in C:\codebase\aws-dotnet-deploy\src\AWS.Deploy.CLI\Commands\CommandFactory.cs:line 255
Error converting value {null} to type 'System.Boolean'. Path 'CreateNew', line 1, position 29.
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader, Type objectType)
   at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
   at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
   at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value)
   at AWS.Deploy.Common.Recipes.OptionSettingItem.GetValue[T](IDictionary`2 replacementTokens, IDictionary`2 displayableOptionSettings) in C:\codebase\aws-dotnet-deploy\src\AWS.Deploy.Common\Recipes\OptionSettingItem.ValueOverride.cs:line 20
   at AWS.Deploy.Orchestration.OptionSettingHandler.GetOptionSettingValue[T](Recommendation recommendation, OptionSettingItem optionSetting) in C:\codebase\aws-dotnet-deploy\src\AWS.Deploy.Orchestration\OptionSettingHandler.cs:line 220
Null object cannot be converted to a value type.
   at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType)
[

Be sure to do lots of redeployment testing from environments created before this change. This has to be a seamless update for users.

Other then my redeployment concerns the changes to the Recipes and CDK projects look good. I did not get a chance to review the orchestrator/typehint code.

@philasmar philasmar force-pushed the asmarp/fix-no-default-vpc branch from cdf5326 to 538993c Compare August 10, 2022 19:05
@philasmar philasmar force-pushed the asmarp/fix-no-default-vpc branch from 538993c to 81c35f6 Compare August 24, 2022 13:02
@philasmar philasmar requested a review from ashovlin August 24, 2022 13:03
@philasmar philasmar merged commit c281104 into dev Aug 24, 2022
@philasmar philasmar deleted the asmarp/fix-no-default-vpc branch August 24, 2022 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants