Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: deployment workflow fails if there is no default vpc #672

Merged
merged 1 commit into from
Aug 24, 2022

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.

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 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