Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
0ef1a78
Update to display full results when --version flag is specified
Mickeypeng Feb 15, 2022
53a2887
Update eb create command to create application elb as default
Mickeypeng Feb 15, 2022
6931cc5
Resolve Notfound Error for Docker AL2 platform
Mickeypeng Feb 22, 2022
76969d5
Update supported codecommit regions
Mickeypeng May 2, 2022
98fea28
Fix a unit test
Mickeypeng Jul 12, 2022
48de41f
Merge remote-tracking branch 'github/master'
Mickeypeng Jul 13, 2022
029ec38
Fix zipping permission bug
Mickeypeng Jul 6, 2022
292287d
Updated previous commit with CR comments
Aug 17, 2022
5d491c4
Fixed a Unit Test Bug
Sep 20, 2022
1e3e3fb
Add new region (CGK)
Mickeypeng Sep 26, 2022
75aca15
Add new Region (KIX)
Nov 27, 2022
e46768e
Modules option bugfix
Jan 9, 2023
13b87c7
Merge with squash from github bugfix branch
Mickeypeng Jan 18, 2023
258758f
Remove future package
Mickeypeng Jan 27, 2023
e0fa998
Update CHANGES.rst and increment version to 3.20.4
Mickeypeng Feb 27, 2023
898d090
Include requirements.txt into pypi distribution tarball
Mickeypeng Feb 28, 2023
85a8da4
Update CHANGES.rst and increment version to 3.20.5
Mickeypeng Mar 1, 2023
8f56502
Add TLV region
Mar 6, 2023
3b7187d
Codebuild Bugfix
Mar 14, 2023
32aae98
Symlink and Performance fix
dependabot[bot] Mar 20, 2023
69f19f6
Symlink and Performance Bugfix
Mar 30, 2023
af754d7
Platform Bugfix
Mar 30, 2023
6f45793
Update CHANGES.rst and increment version to 3.20.6
Apr 11, 2023
d5f4659
Merging in latest changes from github
Mickeypeng May 26, 2023
927eecf
Update CHANGES.rst and increment version to 3.20.7
Jun 21, 2023
4529991
Merge from github repos
Mickeypeng Aug 15, 2023
682c35e
Update CHANGES.rst and increment version to 3.20.8
Mickeypeng Aug 15, 2023
392ff63
Update dependabot configuration to only update minor version; Expand …
Mickeypeng Aug 25, 2023
fc8b421
Fix to allow customers create environments via eb create if they have…
Aug 29, 2023
2e928d9
Updated CHANGES.rst and increment version to 3.20.9
Aug 31, 2023
45ff907
Fix typo and updated version to 3.20.9
Aug 31, 2023
85576b8
Removing Docker-compose as a dependancy as per issue #456
Sep 5, 2023
0665bac
Updating as per comments
Sep 5, 2023
c8ff43c
Refactor and fix unit tests for ebcli initialize module to fix distor…
Sep 13, 2023
cf42155
Updated CHANGES.rst and __init__.py for Version Update
Sep 15, 2023
b29a6f0
Updated CHANGES.rst and increment version to 3.20.10
Mickeypeng Sep 15, 2023
2d7bd5b
Updated code to fix warnings.
Oct 9, 2023
6960653
Validate if service role exists before proceeding with environment cr…
Oct 20, 2023
e2ff96c
Fix for issue #144
Oct 24, 2023
c54af60
Fix for lb setting in saved_configs
Oct 27, 2023
9241ba3
Updating based on comments and added boundary test case
Oct 27, 2023
108f26e
Revision 3
Oct 27, 2023
fa89ef8
Merge remote-tracking branch 'github/master' before 3.22 release
rahulrajaram Apr 14, 2025
dc4397e
Merge branch 'githubmaster'
rahulrajaram Apr 17, 2025
069a2fb
Revert changes in origin/master that are not in github/master
rahulrajaram Apr 18, 2025
474bdd0
Merge remote-tracking branch 'github/master'
rahulrajaram Apr 21, 2025
6969c4a
Merge remote-tracking branch 'github/master' following 3.23.2 release
rahulrajaram Apr 23, 2025
67e85dc
Fix bug that causes eb on non-IIS server Windows machines to crash
rahulrajaram May 1, 2025
fefaa53
Update string messages, CHANGES.rst and version number to 3.23.3
rahulrajaram May 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@

Changelog
=========
--------------------
3.23.3 (2025-05-01)
--------------------
- Fixed bug that causes eb on non-IIS server Windows machines to crash

--------------------
3.23.2 (2025-04-22)
--------------------
Expand Down
2 changes: 1 addition & 1 deletion ebcli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
__version__ = '3.23.2'
__version__ = '3.23.3'
69 changes: 40 additions & 29 deletions ebcli/controllers/migrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,33 +24,39 @@
import json
import argparse

IIS_MODULES_ARE_AVAILABLE = False
if sys.platform.startswith("win"):
import winreg
import clr
import win32com.client

clr.AddReference("System.Reflection")
clr.AddReference(r"C:\Windows\System32\inetsrv\Microsoft.Web.Administration.dll")
clr.AddReference("System")
clr.AddReference("System.Core")
clr.AddReference("System.DirectoryServices.AccountManagement")
from System.DirectoryServices.AccountManagement import (
PrincipalContext,
ContextType,
UserPrincipal,
PrincipalSearcher,
)
from System.Collections.Generic import HashSet, Queue
from System.Reflection import Assembly
from Microsoft.Web.Administration import (
ServerManager,
Binding,
Site,
Application,
ObjectState,
)
from System.Diagnostics import Process, ProcessStartInfo
from System.Runtime.InteropServices import COMException
try:
clr.AddReference("System.Reflection")
clr.AddReference(r"C:\Windows\System32\inetsrv\Microsoft.Web.Administration.dll")
clr.AddReference("System")
clr.AddReference("System.Core")
clr.AddReference("System.DirectoryServices.AccountManagement")
from System.DirectoryServices.AccountManagement import (
PrincipalContext,
ContextType,
UserPrincipal,
PrincipalSearcher,
)
from System.Collections.Generic import HashSet, Queue
from System.Reflection import Assembly
from Microsoft.Web.Administration import (
ServerManager,
Binding,
Site,
Application,
ObjectState,
)
from System.Diagnostics import Process, ProcessStartInfo
from System.Runtime.InteropServices import COMException

IIS_MODULES_ARE_AVAILABLE = True
except Exception as e:
print(f"Failed to import DLL or MS Server Python module. Sure necessary modules are installed and enabled on your server: {e}")

from cement.utils.misc import minimal_logger

Expand Down Expand Up @@ -84,6 +90,8 @@ class Meta:
def do_command(self):
if not sys.platform.startswith("win"):
raise NotSupportedError("'eb migrate explore' is only supported on Windows")
if not IIS_MODULES_ARE_AVAILABLE:
raise NotSupportedError("'eb migrate explore' couldn't find one or more IIS modules or features. Ensure access to Microsoft.Web.Administration.dll")
verbose = self.app.pargs.verbose

if verbose:
Expand All @@ -107,6 +115,8 @@ class Meta:
def do_command(self):
if not sys.platform.startswith("win"):
raise NotSupportedError("'eb migrate cleanup' is only supported on Windows")
if not IIS_MODULES_ARE_AVAILABLE:
raise NotSupportedError("'eb migrate explore' couldn't find one or more IIS modules or features. Ensure access to Microsoft.Web.Administration.dll")
force = self.app.pargs.force
cleanup_previous_migration_artifacts(force, self.app.pargs.verbose)

Expand All @@ -116,7 +126,7 @@ class MigrateController(AbstractBaseController):
class Meta:
argument_formatter = argparse.RawTextHelpFormatter
label = "migrate"
description = "This is an experimental command that enables you to migrate an IIS site from a source machine to Elastic Beanstalk"
description = "This command migrates an IIS site or application from a source Windows machine to an environment hosted on AWS Elastic Beanstalk."
usage = "eb migrate [options ...]"
arguments = [
(["-s", "--sites"], dict(help=flag_text["migrate.sites"])),
Expand Down Expand Up @@ -281,6 +291,8 @@ def generate_ms_deploy_source_bundle(
def do_command(self):
if not sys.platform.startswith("win"):
raise NotSupportedError("'eb migrate' is only supported on Windows")
if not IIS_MODULES_ARE_AVAILABLE:
raise NotSupportedError("'eb migrate explore' couldn't find one or more IIS modules or features. Ensure access to Microsoft.Web.Administration.dll")
validate_iis_version_greater_than_7_0()
verbose = self.app.pargs.verbose

Expand Down Expand Up @@ -595,7 +607,7 @@ def generate_upload_target_archive(upload_target_dir, env_name, region):
except NotFoundError:
io.echo(
f"\nGenerated destination archive directory at .\\{relative_normalized_upload_target_dir_path}.zip. "
"You can create en environment with the zip using:\n\n"
"You can create an environment with the zip using:\n\n"
f" eb migrate --environment-name {env_name} --archive .\\migrations\\latest\\upload_target.zip --region {region}\n"
)

Expand Down Expand Up @@ -1078,7 +1090,7 @@ def setup_migrations_dir(verbose: bool) -> str:
)
io.echo(f" .\\{relative_normalized_path}\\error.log -> msbuild.exe error logs")
io.echo(
f" .\\{relative_normalized_path}\\upload_target\\ -> destination archive dir"
f" .\\{relative_normalized_path}\\upload_target\\ -> destination archive directory"
)
return latest_migration_run_path

Expand Down Expand Up @@ -1613,7 +1625,7 @@ def do_ms_deploy_sync_application(
else:
io.log_error(f"MSDeploy process exited with code {process.ExitCode}.")
raise RuntimeError(
f"MSDeploy process exited with code {process.ExitCode}. You can find execution logs at .\\migrations\\latest\\error.log')"
f"MSDeploy process exited with code {process.ExitCode}. You can find execution logs at .\\migrations\\latest\\error.log"
)


Expand Down Expand Up @@ -1761,8 +1773,7 @@ def warn_about_password_protection(site, application):
for vdir in application.VirtualDirectories:
if vdir.Password:
io.log_warning(
f"{_iis_application_name_value} is hosted at {vdir.PhysicalPath} "
"which is password-protected and won't be copied."
f"Cannot copy virtual directory associated with site because it is password protected: Site [{site.Name}/{_iis_application_name_value}], Path hosting:[{vdir.PhysicalPath}]"
)
except AttributeError:
pass
Expand Down Expand Up @@ -1891,7 +1902,7 @@ def export_arr_config(upload_target_dir: str, verbose: bool) -> None:
"system.webServer/caching",
]
if not _arr_enabled() and verbose:
io.echo("No Automatic Request Routing configuration found.")
io.echo("No Automatic Request Routing (ARR) configuration found.")
return
else:
io.echo("Automatic Request Routing (ARR) configuration found.")
Expand Down
23 changes: 14 additions & 9 deletions ebcli/resources/strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,9 @@
'sharedlb.shared_load_balancer_prompt': 'Select a shared load balancer',
'sharedlb.listener_prompt': 'Select a listener port for your shared load balancer',

'migrate.should_cleanup': 'Are you sure you would like to cleanup older artifacts within `./migrations/`?',
'migrate.should_cleanup': "Are you sure you want to clean up older artifacts within the\n"
"'./migrations/directory'? The most recent successful migration\n"
"in directory './migrations/latest' will be preserved.",
}

alerts = {
Expand Down Expand Up @@ -867,26 +869,28 @@

'migrate.sites': 'Specify a comma-separated list of IIS sites to migrate. If not specified,\n'
'migrates all available sites on the server.',
'migrate.environment_name': 'Name for the new Elastic Beanstalk environment. Defaults to EBMigratedApp.',
'migrate.application_name': 'Name for the new Elastic Beanstalk application. Defaults to EBMigratedEnv.',
'migrate.environment_name': 'Name for the new Elastic Beanstalk environment. Defaults to EBMigratedEnv.',
'migrate.application_name': 'Name for the new Elastic Beanstalk application. Defaults to EBMigratedApp.',

'migrate.platform': 'Elastic Beanstalk platform runtime for the environment. If not specified,\n'
'automatically detected from host VM or application.\n'
'Example: "64bit Windows Server 2016 v2.16.2 running IIS 10.0"',
'Example: "64bit Windows Server 2016 v2.16.2 running IIS 10.0".'
"For a list of available platform versions, use the command 'eb platform list'.",

'migrate.execution_role': 'IAM role for executing eb migrate. Uses credentials from:\n'
'1. ~/.aws/config\n'
'2. AWS CLI credential chain (if config not found)',
'migrate.instance_type': 'EC2 instance type for the Elastic Beanstalk environment. Defaults to c5.2xlarge.',
'migrate.cname': 'CNAME prefix for the Elastic Beanstalk environment.',
'migrate.instance_profile': 'Instance Profile to associate with the environment\'s EC2 instances.',
'migrate.service_role': 'IAM service role for Elastic Beanstalk to manage related AWS services.',
'migrate.instance_profile': 'Instance Profile to associate with the EC2 instances running on the environment.',
'migrate.service_role': 'The name of the IAM service role for Elastic Beanstalk to manage related AWS services.\n '
'If not specified, creates a default service role with necessary permissions.',
'migrate.ebs_snapshots': 'Comma-separated list of EBS snapshot IDs to associate with the environment.',
'migrate.stream_to_cloudwatch': 'Stream EB CLI debug logs and execution metrics to CloudWatch.',
'migrate.use_host_ebs_configuration': 'Generate EBS snapshots from volumes attached to the current instance.',
'migrate.keyname': 'EC2 key pair to enable SSH/RDP access to environment instances.\n'
'Useful for investigating instance-level issues not visible in logs.',
'migrate.interactive': 'Force interactive mode for the migration process.',
'migrate.interactive': 'Force interactive mode for the migration process. Prompts for configuration values even when defaults are available.',
'migrate.tags': 'Comma-separated list of key=value pairs to tag new resources:\n'
'- Elastic Beanstalk application\n'
'- Environment\n'
Expand All @@ -907,10 +911,11 @@
'migrate.encrypt_ebs_volumes': 'Enforce encryption for all new EBS volumes.\n'
'Note: This is an account-wide setting that affects all future\n'
'EBS volume creation.',
'migrate.ssl_certificate_arns': 'Comma-Separated list of Amazon Certificate Manager (ACM) SSL certificate\n'
'migrate.ssl_certificate_arns': 'Comma-separated list of ARNs for Amazon Certificate Manager (ACM) SSL certificate\n'
'ARN to associate with the Application Load Balancer.',
'migrate.archive': 'The directory or the ZIP file containing source code that\n'
'`eb migrate --archive-only` previously generated.',
'`eb migrate --archive-only` previously generated. Use this\n'
'option to deploy a previously created migration package.',
'migrate.vpc_config': """VPC config for the environment either in the form of a JSON file or'
a string. In both cases, config must have the format:
{
Expand Down
Loading