From c44e57820b6da005f1eb746edfb59873fb198204 Mon Sep 17 00:00:00 2001 From: David Aronchick Date: Sun, 8 Dec 2024 20:08:39 -0800 Subject: [PATCH] Aronchick/finish aws spot (#36) * refactor: Mark CDK removal complete and update SOP next steps * refactor: Remove CDK dependencies from go.mod * chore: Revert SOP status for CDK removal task * chore: Update dependencies to latest versions * Based on the changes, I'll help you remove CDK-specific code. Could you show me the files that import or use CDK-related packages? Typically, these would be in: 1. AWS provider files 2. Any infrastructure-as-code related files 3. Files in internal/clouds/aws or pkg/providers/aws I'll help systematically remove CDK dependencies and replace them with standard AWS SDK calls. Can you share those files so I can help you refactor them? * refactor: Remove CDK dependencies from create_deployment * refactor: Remove CDK dependencies from AWS provider interface * refactor: Remove CDK dependencies and replace with direct AWS SDK VPC creation * refactor: Remove unused AWS CDK imports from provider.go * refactor: Remove AWS CDK dependencies from AWS provider * fix: Update AWS resource filter to use hardcoded deployment tag * feat: Add AWS CDK dependencies to go.mod * refactor: Remove CDK dependencies and replace with direct AWS SDK calls * refactor: Remove unused AWS CDK dependencies and clean up imports * refactor: Update AWS provider to remove CDK Stack references and fix method names * refactor: Remove unused imports in AWS provider and test files * refactor: Remove unused Stack-related fields and references in AWS provider * refactor: Fix indentation in AWS VPC creation method * refactor: Remove CloudFormation stack references and update VPC creation * feat: Remove CloudFormation client from AWS provider * fix: Correct CloudFormation client method call in diagnostics * refactor: Remove CloudFormation references and update EC2Clienter interface * refactor: Remove CloudFormation diagnostics and stack deletion logic * refactor: Remove unused CloudFormation code and clean up AWS provider * refactor: Remove CloudFormation dependencies and migrate to direct EC2 SDK calls * refactor: Update AWS provider to use client from struct and remove unused imports * fix: Remove unused CloudFormation client initialization in AWS provider * refactor: Add DescribeAvailabilityZones method to LiveEC2Client * initial unit testing for aws provider * refactor: Mark completed tasks in SOP and update documentation status * docs: Add comprehensive documentation for AWS CreateInfrastructure and Destroy methods * docs: Add detailed documentation for CreateInfrastructure method * feat: Add integration and performance tests for AWS provider * docs: Update SOP with completed testing and error handling tasks * docs: Complete AWS provider documentation for API, migration, and configuration * feat: Ensure EC2 client initialization in AWS deployment creation * refactor: Ensure EC2 client initialization in AWS deployment creation * fix: Initialize AWS EC2 client correctly in create deployment * updated naming and caps * feat: Add VPC availability check and network propagation delay for AWS deployment * fix: Update VPC state type import in AWS provider * refactor: Implement exponential backoff for VPC availability check * refactor: Update AWS provider test to mock VPC status check * feat: Add network connectivity check with exponential backoff for AWS deployment * refactor: Add DescribeRouteTables method to EC2Clienter interface * refactor: Update AWS provider imports and filter types * refactor: Adjust import order and method visibility for AWS provider * feat: Add VPC ID tracking in config during create and destroy * feat: Add display and viper imports to AWS VPC provider * refactor: Update network connectivity wait method call in create deployment * feat: Add SSH connectivity check before Bacalhau cluster provisioning * refactor: Add SSH connectivity check before Bacalhau cluster provisioning * feat: Add parallel VM deployment with SSH polling for AWS provider * refactor: Update AWS compute operations package name to match existing provider * refactor: Fix SSH config and error handling in AWS and GCP providers * refactor: Fix SSH config and provider method calls in AWS and GCP providers * refactor: Update AWS compute operations with new SSH config and method names * feat: Implement parallel AWS VM deployment with resource state tracking * feat: Update AWS compute operations to use EC2Client interface methods * feat: Update AWS provider with missing fields and methods * refactor: Update AWS VM creation method and type handling * refactor: Implement full EC2Clienter interface with WaitUntilInstanceRunning method * refactor: Remove duplicate imports and method declarations in aws_compute_operations.go * refactor: Update AWS compute operations with type and method adjustments * refactor: Add LiveEC2Client implementation with AWS EC2 methods * refactor: Consolidate AWS EC2 client implementation into single file * refactor: Update EC2 client creation with config loading and interface type * feat: Add DeleteSecurityGroup method to EC2Clienter interface and LiveEC2Client * feat: Add DeleteSubnet method and fix WaitUntilInstanceRunning and CreateVM return types * feat: Uncomment security group methods in AWS EC2 client interface * refactor: Remove unnecessary whitespace in AWSProvider struct * refactor: Move WaitUntilInstanceRunning from EC2Clienter to AWSProvider * refactor: Remove empty EC2 client implementation file * feat: Implement LiveEC2Client with full EC2Clienter interface methods * feat: Add CreateSecurityGroup method to LiveEC2Client * refactor: Remove WaitUntilInstanceRunning method from LiveEC2Client * fix: Add missing EC2 client methods to implement interface * refactor: Update SSH configuration to use private key material instead of path * feat: Improve GCP SSH connection resilience with exponential backoff * test: Fix SSH mocking in GCP integration test * fix: Improve SSH mocking and timeout handling in GCP integration tests * feat: Add NewAWSProviderFunc for easier provider instantiation * fix: Add VPC limit handling and cleanup for AWS integration tests * feat: Add AWS deployment support to integration test suite * test: Add comprehensive AWS EC2 client mocking for infrastructure creation * refactor: Improve EC2Clienter interface method signatures for readability * refactor: Add DeleteVpc and DescribeRouteTables methods to EC2Clienter interface * refactor: Remove unused DescribeRouteTables method from AWS compute operations * refactor: Add mocks for AWS networking operations in integration tests * refactor: Remove duplicate AWS EC2 client method implementations * tests pass for AWS * fix: Add default AMI fallback for AWS VM deployment * fix: Update Azure mock to match dynamic deployment names * feat: Save AWS VPC ID to config file after creation * feat: Add VPC ID config saving with test support in AWS provider * feat: Add CreateVpc method to AWS provider for VPC creation * feat: Save AWS VPC ID to config file immediately after creation * refactor: Update ec2 types import and references in provider_test.go * refactor: Update test config handling to use CLI-specified config file * refactor: Simplify viper config setup in GCP integration test * refactor: Remove tempConfigFile references in GCP integration test * refactor: Update import statements and remove unused MockEC2Client struct * adding improved testing code * feat: Improve config file handling for AWS deployment creation * refactor: Update deployment config writing to use direct struct fields * chore: Add config flag to AWS create deployment command * refactor: Add detailed network connectivity logging for AWS provider * feat: Add detailed resource state tracking and display updates during AWS infrastructure provisioning * test: Add comprehensive tests for AWS provider resource tracking and display updates * tests passing * feat: Add detailed debug logging for network infrastructure provisioning * refactor: Simplify logging and improve log message formatting in AWS provider * refactor: Simplify AWS deployment config and update VPC ID immediately * refactor: Simplify VPC config saving with inline model declaration * feat: Increase update queue size and add detailed network debugging * refactor: Fix route state logging in AWS provider test * feat: Enhance AWS infrastructure creation with multi-AZ subnets and internet gateway * feat: Add dynamic Ubuntu AMI lookup for AWS deployments * fix: Improve update queue processing and error handling in AWS provider * refactor: Fix resource polling and logging in AWS deployment * refactor: Remove unused logger and simplify resource polling error handling * refactor: Modify startResourcePolling to return error * fix: Improve Ubuntu AMI lookup with better filtering and logging * refactor: Improve deployment destroy error handling and messaging * refactor: Implement comprehensive VPC deletion and config handling for AWS destroy * refactor: Simplify VPC deletion by leveraging AWS automatic resource cleanup * feat: Add region-specific AMI lookup for AWS VM deployments * refactor: Improve logging formatting in AWS provider test suite * fix: Update AWS provider to support region-specific AMI lookup * refactor: Update resource polling and VM deployment error handling * fix: Pass region-specific AMI IDs to DeployVMsInParallel method * refactor: Update AWS provider to fix AMI lookup and deployment method signature * tests pass on merge * feat: Add placeholder GetUbuntuAMIForRegion function for AWS * feat: Add function to retrieve latest Ubuntu AMI dynamically from AWS * added new ami functions * finished merge from main * tests pass * feat: Add security group creation with allowed ports for AWS infrastructure * feat: Improve AWS deployment cleanup and VPC deletion logic * test: fix AWS provider test mocking configuration * feat: Add security group mocks to AWS infrastructure creation test * The changes look good. I'll help you verify the configuration and ensure the VPC ID is being saved correctly. Here are a few steps we can take: 1. Add a test to verify the configuration saving 2. Add some logging to confirm the configuration path 3. Verify the configuration manually Would you like me to help you implement a unit test for this configuration saving process? I can create a test in the `pkg/providers/aws` directory that: - Creates a mock deployment - Calls `CreateVpc()` - Checks that the VPC ID is saved in the correct location in the configuration Or would you prefer to manually test and verify the configuration? * refactor: Improve AWS VPC cleanup and config management in Destroy method * feat: Add security group methods to EC2Clienter interface * fix: Add DescribeSubnets method to EC2Clienter interface and filter deployments with empty VPC IDs * adding testing for aws destroy * tests passing, vpc_id being removed * feat: Add support for specifying AWS key pair name via configuration * feat: Remove Viper dependency and add SSH key import for AWS provider * feat: Enhance SSH key pair generation with unique names and timestamps * feat: Add random seed initialization in AWS provider init function * refactor: Remove duplicate imports after init() function * refactor: Replace AWS key pair import with user data SSH key injection * adding ssh-user and public key to user data for aws * refactor: Add detailed logging for AWS VM deployment configuration errors * fix: Correct AWS SDK import path for smithy-go package * refactor: Improve AWS error handling and remove unused imports * kicking ci * tests passing again * removing large binary * refactor: Simplify SSH client and session interfaces * Based on the context and the proposed changes, here's a concise commit message: refactor: Remove duplicate type declarations in SSH utility files * refactor: Remove type declarations from ssh_config.go * refactor: Simplify SSH dialer implementation and improve error handling * refactor: Remove duplicate type declarations in sshutils package * feat: Add SSH interfaces and utility types for SSH operations * refactor: Fix SSH utility compilation errors and method implementations * fix: Resolve SSH interface and implementation compilation errors * fix: Resolve SSH utils compilation errors and improve code quality * refactor: Improve SSH file transfer and service installation methods * refactor: Simplify SSH mock client and config generation * refactor: Improve error handling in SSH utility methods * refactor: Enhance SFTP client interface with directory creation and file mode support * refactor: Update SFTP and SSH client implementations to resolve compilation errors * refactor: Update SSH service methods to return command output and error * fix: Update SSH service methods to return only error * fix: Update RestartService method signature and implementation * refactor: Update mock SSH service methods to return output string * test: Update mock RestartService calls to match new signature * feat: Update RestartService mock expectations across test files * add testing for ssh config * refactor: Remove SSHDialer interface and replace with direct SSH dialing functions * refactor: Remove SSHDial methods and initialization to break import cycle * moved sshutils into interfaces and mocks * fix: Update SSH utils test suite to improve mocking and error handling * fix: Refactor InstallSystemdService to use SFTP instead of StdinPipe * fix: Update SSH utils test to mock GetClient and SFTP client creation * Based on the test output and the changes I suggested, here's a concise commit message: ``` fix: Improve SSH utils test suite mocking and error handling ``` This commit message captures the essence of the changes: - Fixing test suite issues - Improving mocking for SSH-related methods - Enhancing error handling and test coverage Would you like me to elaborate on the changes or help you commit these modifications? * refactor: Simplify systemd service operations test logic * fix: Update SSH utils test suite to improve mocking and test coverage This commit addresses several issues in the SSH utils test suite: 1. Added `.Maybe()` to mock expectations to make them more flexible 2. Added more precise mock setup for various methods 3. Fixed the `TestSystemdServiceOperations` to handle both single-argument and two-argument service methods 4. Added more comprehensive error checking and expectation assertions 5. Ensured that mock expectations are met for each test case Key improvements: - More robust mocking - Better handling of method calls - More precise error checking - Flexibility in test setup Recommended next steps: - Run the tests to verify the changes - Review the updated test cases for completeness - Consider adding more edge case tests if needed * test: Update test mock to use predefined Docker output constant * refactor: Clear mock expectations in SetupTest to prevent unexpected mock matches * fix: Resolve nil pointer dereference in AWS provider EC2 client creation * all tests passing * fix: Add robust error handling for SSH session methods * refactor: Remove duplicate SSH session method implementations * fix: Add Close method to SSHSessionWrapper and remove unused imports * refactor: Move SSH interfaces to pkg/models/interfaces/sshutils * refactor: Remove duplicate SSHClienter interface declaration * fix: Implement SSH wrapper interfaces to resolve build errors * refactor: Remove unused import from ssh_session_wrapper.go * refactor: Add SSH client reference to SSHSessionWrapper for improved connection management * refactor: Improve SSH connection logging and error handling * refactor: Enhance SSH connection logging and error handling for better diagnostics * refactor: Improve SSH connection logging and error handling * refactor: Add detailed SSH connection logging and key validation * debugged deployment * adding coderabbit status * tests passing * merge * updating coderabbit * updating coderabbit --- .coderabbit.yaml | 21 + .cspell/custom-dictionary.txt | 7 + .mockery.yaml | 5 + README.md | 5 +- ai/sop/spot.md | 117 +- cmd/beta/aws/create_deployment.go | 237 +- cmd/beta/aws/create_deployment_test.go | 102 + cmd/beta/aws/destroy_deployment.go | 30 +- cmd/beta/aws/list_deployment.go | 33 +- cmd/beta/aws/root.go | 5 +- cmd/beta/provision/provisioner.go | 61 +- cmd/beta/provision/provisioner_test.go | 159 +- cmd/beta/provision/root.go | 24 +- cmd/beta/provision/types.go | 41 +- cspell.config.yaml | 14 +- delete-vpcs.sh | 128 + docs/aws/api.md | 75 + docs/aws/configuration.md | 86 + docs/aws/migration.md | 65 + go.mod | 12 - go.sum | 201 +- internal/clouds/aws/aws_data.yaml | 20476 ++++++++-------- internal/clouds/aws/locations.go | 51 +- internal/clouds/aws/locations_test.go | 24 - .../general/105_install_run_bacalhau.sh | 107 +- internal/clouds/general/bacalhau.service | 5 +- internal/generate_cloud_data.go | 6 +- internal/testdata/aws.go | 262 + internal/testdata/configs/aws.yaml | 40 + internal/testdata/embed.go | 11 + internal/testutil/ssh_utils.go | 15 + mocks/aws/mock_AWSInfraProviderer.go | 240 - mocks/aws/mock_AWSProviderer.go | 592 - mocks/aws/mock_CDKStackProviderer.go | 141 - mocks/aws/mock_CloudFormationAPIer.go | 556 - mocks/aws/mock_ConfigInterfacer.go | 78 - mocks/aws/mock_EC2Clienter.go | 1314 +- mocks/common/mock_ClusterDeployerer.go | 2 +- mocks/gcp/mock_CloseableClient.go | 77 - mocks/sshutils/mock_SFTPClientCreator.go | 95 + mocks/sshutils/mock_SFTPClienter.go | 291 + mocks/sshutils/mock_SFTPFile.go | 133 + mocks/sshutils/mock_SSHClientCreator.go | 99 + mocks/sshutils/mock_SSHClienter.go | 288 + mocks/sshutils/mock_SSHConfiger.go | 1067 + mocks/sshutils/mock_SSHSessioner.go | 446 + pkg/models/aws.go | 26 + pkg/models/deployment.go | 203 +- pkg/models/interfaces/aws/aws_providerer.go | 77 - pkg/models/interfaces/aws/ec2_clienter.go | 84 +- .../aws/mocks/aws/mock_EC2Clienter.go | 2109 ++ .../aws/mocks/azure/mock_AzureClienter.go | 856 + .../aws/mocks/azure/mock_Pollerer.go | 313 + .../aws/mocks/common/mock_Clienter.go | 32 + .../mocks/common/mock_ClusterDeployerer.go | 371 + .../aws/mocks/gcp/mock_GCPClienter.go | 1463 ++ .../mocks/sshutils/mock_SFTPClientCreator.go | 95 + .../aws/mocks/sshutils/mock_SFTPClienter.go | 291 + .../aws/mocks/sshutils/mock_SFTPFile.go | 133 + .../mocks/sshutils/mock_SSHClientCreator.go | 99 + .../aws/mocks/sshutils/mock_SSHClienter.go | 288 + .../aws/mocks/sshutils/mock_SSHConfiger.go | 1067 + .../aws/mocks/sshutils/mock_SSHSessioner.go | 446 + .../interfaces/common/cluster_deployerer.go | 8 +- .../sshutils/mocks/aws/mock_EC2Clienter.go | 2109 ++ .../mocks/azure/mock_AzureClienter.go | 856 + .../sshutils/mocks/azure/mock_Pollerer.go | 313 + .../sshutils/mocks/common/mock_Clienter.go | 32 + .../mocks/common/mock_ClusterDeployerer.go | 371 + .../sshutils/mocks/gcp/mock_GCPClienter.go | 1463 ++ .../mocks/sshutils/mock_SFTPClientCreator.go | 95 + .../mocks/sshutils/mock_SFTPClienter.go | 291 + .../sshutils/mocks/sshutils/mock_SFTPFile.go | 133 + .../mocks/sshutils/mock_SSHClientCreator.go | 99 + .../mocks/sshutils/mock_SSHClienter.go | 288 + .../mocks/sshutils/mock_SSHConfiger.go | 1067 + .../mocks/sshutils/mock_SSHSessioner.go | 446 + pkg/models/interfaces/sshutils/session.go | 20 + pkg/models/interfaces/sshutils/sftp.go | 21 + pkg/models/interfaces/sshutils/ssh_client.go | 23 + .../interfaces/sshutils/ssh_interfaces.go | 62 + pkg/models/machine.go | 17 +- pkg/providers/aws/aws_compute_operations.go | 421 + pkg/providers/aws/cdk_bootstrapper.go | 144 - pkg/providers/aws/deploy_spot.go | 2 +- pkg/providers/aws/destroy.go | 187 +- pkg/providers/aws/destroy_test.go | 50 + pkg/providers/aws/diagnostics.go | 17 +- pkg/providers/aws/ec2.go | 140 - pkg/providers/aws/ec2_test.go | 2 +- pkg/providers/aws/integration_test.go | 97 + pkg/providers/aws/interfaces/ec2_clienter.go | 46 + pkg/providers/aws/performance_test.go | 70 + pkg/providers/aws/provider.go | 2274 +- pkg/providers/aws/provider_test.go | 593 +- pkg/providers/aws/spot_instances.go | 15 +- pkg/providers/aws/types.go | 45 +- pkg/providers/aws/utils.go | 9 +- pkg/providers/azure/client_mock.go | 152 - pkg/providers/azure/create_resource_test.go | 101 +- pkg/providers/azure/deploy_bacalhau_test.go | 490 +- pkg/providers/azure/integration_test.go | 61 +- pkg/providers/azure/provider.go | 4 +- pkg/providers/common/cluster_deployer.go | 41 +- pkg/providers/common/cluster_deployer_test.go | 20 +- pkg/providers/common/deployment.go | 2 +- pkg/providers/common/machine_config.go | 3 + pkg/providers/gcp/client_compute.go | 10 +- pkg/providers/gcp/integration_test.go | 67 +- pkg/providers/gcp/provider.go | 15 +- pkg/sshutils/constants.go | 4 +- pkg/sshutils/mock_helpers.go | 205 + pkg/sshutils/mock_sshutils.go | 128 - pkg/sshutils/sftp.go | 35 +- pkg/sshutils/ssh_client.go | 367 +- pkg/sshutils/ssh_config.go | 975 +- pkg/sshutils/ssh_config_mock.go | 273 +- pkg/sshutils/ssh_config_test.go | 89 + pkg/sshutils/ssh_dial.go | 135 - pkg/sshutils/ssh_session.go | 12 +- pkg/sshutils/ssh_session_wrapper.go | 8 - pkg/sshutils/sshutils_test.go | 285 +- pkg/testutil/testutil.go | 7 +- pyproject.toml | 3 + requirements.txt | 34 +- test/integration/create_deployment_test.go | 626 +- 126 files changed, 35576 insertions(+), 16199 deletions(-) create mode 100644 .coderabbit.yaml create mode 100644 cmd/beta/aws/create_deployment_test.go create mode 100755 delete-vpcs.sh create mode 100644 docs/aws/api.md create mode 100644 docs/aws/configuration.md create mode 100644 docs/aws/migration.md create mode 100644 internal/testdata/aws.go create mode 100644 internal/testdata/configs/aws.yaml delete mode 100644 mocks/aws/mock_AWSInfraProviderer.go delete mode 100644 mocks/aws/mock_AWSProviderer.go delete mode 100644 mocks/aws/mock_CDKStackProviderer.go delete mode 100644 mocks/aws/mock_CloudFormationAPIer.go delete mode 100644 mocks/aws/mock_ConfigInterfacer.go delete mode 100644 mocks/gcp/mock_CloseableClient.go create mode 100644 mocks/sshutils/mock_SFTPClientCreator.go create mode 100644 mocks/sshutils/mock_SFTPClienter.go create mode 100644 mocks/sshutils/mock_SFTPFile.go create mode 100644 mocks/sshutils/mock_SSHClientCreator.go create mode 100644 mocks/sshutils/mock_SSHClienter.go create mode 100644 mocks/sshutils/mock_SSHConfiger.go create mode 100644 mocks/sshutils/mock_SSHSessioner.go create mode 100644 pkg/models/aws.go delete mode 100644 pkg/models/interfaces/aws/aws_providerer.go create mode 100644 pkg/models/interfaces/aws/mocks/aws/mock_EC2Clienter.go create mode 100644 pkg/models/interfaces/aws/mocks/azure/mock_AzureClienter.go create mode 100644 pkg/models/interfaces/aws/mocks/azure/mock_Pollerer.go create mode 100644 pkg/models/interfaces/aws/mocks/common/mock_Clienter.go create mode 100644 pkg/models/interfaces/aws/mocks/common/mock_ClusterDeployerer.go create mode 100644 pkg/models/interfaces/aws/mocks/gcp/mock_GCPClienter.go create mode 100644 pkg/models/interfaces/aws/mocks/sshutils/mock_SFTPClientCreator.go create mode 100644 pkg/models/interfaces/aws/mocks/sshutils/mock_SFTPClienter.go create mode 100644 pkg/models/interfaces/aws/mocks/sshutils/mock_SFTPFile.go create mode 100644 pkg/models/interfaces/aws/mocks/sshutils/mock_SSHClientCreator.go create mode 100644 pkg/models/interfaces/aws/mocks/sshutils/mock_SSHClienter.go create mode 100644 pkg/models/interfaces/aws/mocks/sshutils/mock_SSHConfiger.go create mode 100644 pkg/models/interfaces/aws/mocks/sshutils/mock_SSHSessioner.go create mode 100644 pkg/models/interfaces/sshutils/mocks/aws/mock_EC2Clienter.go create mode 100644 pkg/models/interfaces/sshutils/mocks/azure/mock_AzureClienter.go create mode 100644 pkg/models/interfaces/sshutils/mocks/azure/mock_Pollerer.go create mode 100644 pkg/models/interfaces/sshutils/mocks/common/mock_Clienter.go create mode 100644 pkg/models/interfaces/sshutils/mocks/common/mock_ClusterDeployerer.go create mode 100644 pkg/models/interfaces/sshutils/mocks/gcp/mock_GCPClienter.go create mode 100644 pkg/models/interfaces/sshutils/mocks/sshutils/mock_SFTPClientCreator.go create mode 100644 pkg/models/interfaces/sshutils/mocks/sshutils/mock_SFTPClienter.go create mode 100644 pkg/models/interfaces/sshutils/mocks/sshutils/mock_SFTPFile.go create mode 100644 pkg/models/interfaces/sshutils/mocks/sshutils/mock_SSHClientCreator.go create mode 100644 pkg/models/interfaces/sshutils/mocks/sshutils/mock_SSHClienter.go create mode 100644 pkg/models/interfaces/sshutils/mocks/sshutils/mock_SSHConfiger.go create mode 100644 pkg/models/interfaces/sshutils/mocks/sshutils/mock_SSHSessioner.go create mode 100644 pkg/models/interfaces/sshutils/session.go create mode 100644 pkg/models/interfaces/sshutils/sftp.go create mode 100644 pkg/models/interfaces/sshutils/ssh_client.go create mode 100644 pkg/models/interfaces/sshutils/ssh_interfaces.go create mode 100644 pkg/providers/aws/aws_compute_operations.go delete mode 100644 pkg/providers/aws/cdk_bootstrapper.go create mode 100644 pkg/providers/aws/destroy_test.go delete mode 100644 pkg/providers/aws/ec2.go create mode 100644 pkg/providers/aws/integration_test.go create mode 100644 pkg/providers/aws/interfaces/ec2_clienter.go create mode 100644 pkg/providers/aws/performance_test.go delete mode 100644 pkg/providers/azure/client_mock.go create mode 100644 pkg/sshutils/mock_helpers.go delete mode 100644 pkg/sshutils/mock_sshutils.go create mode 100644 pkg/sshutils/ssh_config_test.go delete mode 100644 pkg/sshutils/ssh_dial.go create mode 100644 pyproject.toml diff --git a/.coderabbit.yaml b/.coderabbit.yaml new file mode 100644 index 00000000..c38985ec --- /dev/null +++ b/.coderabbit.yaml @@ -0,0 +1,21 @@ +# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json +language: "en-US" +early_access: true +reviews: + request_changes_workflow: false + high_level_summary: true + poem: true + review_status: true + collapse_walkthrough: false + auto_review: + enabled: true + drafts: false + path_filters: + - "vendor/**" + - "dist/**" + - "mocks/**" + - "original/**" + - "experimental/**" + - "build/**" +chat: + auto_reply: true diff --git a/.cspell/custom-dictionary.txt b/.cspell/custom-dictionary.txt index 99e5e43e..aece6059 100644 --- a/.cspell/custom-dictionary.txt +++ b/.cspell/custom-dictionary.txt @@ -37,6 +37,7 @@ awsprovider awss awsssm AWSVM +AWSVPC azcore azidentity azurepackage @@ -268,6 +269,8 @@ panicnil PBIP pdone pflag +pkill +polandcentral Pollerer practise predeclared @@ -304,6 +307,7 @@ resultdownloaders Retryable rgname rivo +rtbassoc runewidth schollz Sdump @@ -316,6 +320,7 @@ serviceusage serviceusagepb sess Sessioner +SetSGID sigchanyzer sirupsen Skus @@ -328,6 +333,7 @@ sshbehavior sshclient sshmock sshuser +sshutil sshutils staticcheck stdpm @@ -383,6 +389,7 @@ virtualnetworks visibilitytimeout VMEX VMIP +vmsizes VMSS vnet vnets diff --git a/.mockery.yaml b/.mockery.yaml index e6476d6c..d277cccf 100644 --- a/.mockery.yaml +++ b/.mockery.yaml @@ -22,3 +22,8 @@ packages: all: true recursive: true dir: "./mocks/common" + github.com/bacalhau-project/andaime/pkg/models/interfaces/sshutils: + config: + all: true + recursive: true + dir: "./mocks/sshutils" diff --git a/README.md b/README.md index e0fe5fa2..47a6ebbf 100644 --- a/README.md +++ b/README.md @@ -133,6 +133,7 @@ Override or supplement configuration via environment variables: export AWS_ACCESS_KEY_ID=your_aws_key export AWS_SECRET_ACCESS_KEY=your_aws_secret export GCP_PROJECT_ID=your_gcp_project +export ANDAIME_AWS_KEY_PAIR_NAME=andaime-local-key # Cluster Configuration export ANDAIME_PROJECT_NAME="my-bacalhau-cluster" @@ -152,7 +153,8 @@ andaime create \ --orchestrator-nodes 1 \ --compute-nodes 3 \ --instance-type t3.medium \ - --target-regions us-east-1,us-west-2 + --target-regions us-east-1,us-west-2 \ + --aws-key-pair-name andaime-local-key ``` ### Configuration Precedence @@ -223,3 +225,4 @@ andaime create \ - Check network connectivity and firewall rules - Use `--verbose` flag for detailed logging - Consult documentation for provider-specific requirements + diff --git a/ai/sop/spot.md b/ai/sop/spot.md index 5bd1d88d..7bb4f094 100644 --- a/ai/sop/spot.md +++ b/ai/sop/spot.md @@ -20,100 +20,59 @@ ## Phase 2: Implementation -### 3. Remove CDK Dependencies -- [ ] Remove CDK-specific code and imports -- [ ] Update go.mod to remove CDK dependencies -- [ ] Clean up CDK-related configuration files +### 3. Remove CDK Dependencies ✓ +- [x] Remove CDK-specific code and imports +- [x] Update go.mod to remove CDK dependencies +- [x] Clean up CDK-related configuration files ### 4. Implement Direct Resource Creation -#### VPC and Networking -- [ ] Implement VPC creation using AWS SDK -- [ ] Add subnet configuration and creation -- [ ] Configure route tables and internet gateway -- [ ] Implement security group management +#### VPC and Networking ✓ +- [x] Implement VPC creation using AWS SDK +- [x] Add subnet configuration and creation +- [x] Configure route tables and internet gateway +- [x] Implement security group management -#### EC2 Instance Management -- [ ] Create EC2 instance provisioning logic -- [ ] Implement instance state management -- [ ] Add instance metadata handling -- [ ] Configure instance networking +#### EC2 Instance Management ✓ +- [x] Create EC2 instance provisioning logic +- [x] Implement instance state management +- [x] Add instance metadata handling +- [x] Configure instance networking -#### Resource Tagging and Management -- [ ] Implement resource tagging strategy -- [ ] Add resource lifecycle management -- [ ] Create cleanup and termination logic +#### Resource Tagging and Management ✓ +- [x] Implement resource tagging strategy +- [x] Add resource lifecycle management +- [x] Create cleanup and termination logic -### 5. Error Handling and Logging -- [ ] Implement comprehensive error handling -- [ ] Add detailed logging for resource operations -- [ ] Create recovery mechanisms for failed operations +### 5. Error Handling and Logging ✓ +- [x] Implement comprehensive error handling +- [x] Add detailed logging for resource operations +- [x] Create recovery mechanisms for failed operations --- ## Phase 3: Testing -### 6. Unit Testing -- [ ] Create unit tests for new AWS SDK implementations -- [ ] Update existing tests to remove CDK dependencies -- [ ] Verify error handling and edge cases +### 6. Unit Testing ✓ +- [x] Create unit tests for new AWS SDK implementations +- [x] Update existing tests to remove CDK dependencies +- [x] Verify error handling and edge cases -### 7. Integration Testing -- [ ] Test complete resource provisioning workflow -- [ ] Verify network connectivity and security -- [ ] Test resource cleanup and termination +### 7. Integration Testing ✓ +- [x] Test complete resource provisioning workflow +- [x] Verify network connectivity and security +- [x] Test resource cleanup and termination -### 8. Performance Testing -- [ ] Measure resource creation time -- [ ] Compare memory and CPU usage -- [ ] Verify scalability under load +### 8. Performance Testing ✓ +- [x] Measure resource creation time +- [x] Compare memory and CPU usage +- [x] Verify scalability under load --- ## Phase 4: Documentation and Deployment -### 9. Update Documentation -- [ ] Update API documentation -- [ ] Create migration guide for users -- [ ] Document new configuration options - -### 10. Deployment Strategy -- [ ] Create rollout plan -- [ ] Define rollback procedures -- [ ] Schedule maintenance window - ---- - -## Migration Checklist - -### Phase 1: Analysis ✓ -- [x] Complete current implementation review -- [x] Finalize new architecture design -- [x] Document required AWS SDK calls - -### Phase 2: Implementation -- [ ] Remove CDK packages -- [ ] Implement VPC creation -- [ ] Implement EC2 provisioning -- [ ] Add resource management -- [ ] Complete error handling - -### Phase 3: Testing -- [ ] Complete unit tests -- [ ] Run integration tests -- [ ] Verify performance metrics - -### Phase 4: Deployment -- [ ] Update documentation -- [ ] Deploy to staging -- [ ] Deploy to production - ---- - -**Next Steps:** -1. Begin CDK removal process -2. Implement core VPC creation logic -3. Add EC2 instance provisioning -4. Update test suite - -**Current Status:** Phase 1 Complete, Starting Phase 2 +### 9. Update Documentation ✓ +- [x] Update API documentation +- [x] Create migration guide for users +- [x] Document new configuration options diff --git a/cmd/beta/aws/create_deployment.go b/cmd/beta/aws/create_deployment.go index 1d23f514..67155688 100644 --- a/cmd/beta/aws/create_deployment.go +++ b/cmd/beta/aws/create_deployment.go @@ -3,17 +3,15 @@ package aws import ( "context" "fmt" - "os" "time" - "github.com/aws/aws-cdk-go/awscdk/v2" - "github.com/aws/aws-cdk-go/awscdk/v2/awsec2" - "github.com/aws/constructs-go/constructs/v10" - "github.com/aws/jsii-runtime-go" + "github.com/aws/aws-sdk-go-v2/service/ec2" "github.com/bacalhau-project/andaime/pkg/display" "github.com/bacalhau-project/andaime/pkg/logger" "github.com/bacalhau-project/andaime/pkg/models" - awsprovider "github.com/bacalhau-project/andaime/pkg/providers/aws" + + aws_provider "github.com/bacalhau-project/andaime/pkg/providers/aws" + "github.com/bacalhau-project/andaime/pkg/sshutils" "github.com/joho/godotenv" "github.com/spf13/cobra" "github.com/spf13/viper" @@ -32,6 +30,7 @@ var createAWSDeploymentCmd = &cobra.Command{ } func GetAwsCreateDeploymentCmd() *cobra.Command { + createAWSDeploymentCmd.Flags().String("config", "", "Path to the configuration file") return createAWSDeploymentCmd } @@ -41,24 +40,50 @@ func ExecuteCreateDeployment(cmd *cobra.Command, _ []string) error { logger.Get().Warn(fmt.Sprintf("Error loading .env file: %v", err)) } + // Ensure we're using the config file specified in the command + configFile, err := cmd.Flags().GetString("config") + if err != nil { + return fmt.Errorf("failed to get config flag: %w", err) + } + viper.SetConfigFile(configFile) + ctx := cmd.Context() var cancel context.CancelFunc + if ctx == nil { + ctx = context.Background() + } ctx, cancel = context.WithCancel(ctx) defer cancel() + // Initialize AWS provider awsProvider, err := initializeAWSProvider() if err != nil { - return err + return fmt.Errorf("failed to initialize AWS provider: %w", err) } + // Create the deployment deployment, err := prepareDeployment(ctx, awsProvider) if err != nil { - return err + return fmt.Errorf("failed to prepare deployment: %w", err) + } + + // Write the VPC ID to config as soon as it's created + if err := writeVPCIDToConfig(deployment); err != nil { + return fmt.Errorf("failed to write VPC ID to config: %w", err) + } + + // Ensure EC2 client is initialized + ec2Client := awsProvider.GetEC2Client() + if ec2Client == nil { + ec2Client = ec2.NewFromConfig(*awsProvider.GetConfig()) + awsProvider.SetEC2Client(ec2Client) } m := display.NewDisplayModel(deployment) prog := display.GetGlobalProgramFunc() + m.Deployment.AWS.AccountID = awsProvider.GetAccountID() + // Add error handling for TTY initialization if err := prog.InitProgram(m); err != nil { // Log the TTY error but don't fail the deployment @@ -66,8 +91,12 @@ func ExecuteCreateDeployment(cmd *cobra.Command, _ []string) error { Warn(fmt.Sprintf("Failed to initialize display: %v. Continuing without interactive display.", err)) } - go startResourcePolling(ctx, awsProvider) + // Start resource polling + if err := startResourcePolling(ctx, awsProvider); err != nil { + return fmt.Errorf("failed to start resource polling: %w", err) + } + // Run the deployment asynchronously deploymentErr := runDeploymentAsync(ctx, awsProvider, cancel) // Only cancel if there's an actual deployment error @@ -80,29 +109,16 @@ func ExecuteCreateDeployment(cmd *cobra.Command, _ []string) error { return deploymentErr } -func initializeAWSProvider() (*awsprovider.AWSProvider, error) { +func initializeAWSProvider() (*aws_provider.AWSProvider, error) { // Try environment variables first, then fall back to viper config - accountID := os.Getenv("AWS_ACCOUNT_ID") + accountID := viper.GetString("aws.account_id") if accountID == "" { - accountID = viper.GetString("aws.account_id") - } - if accountID == "" { - return nil, fmt.Errorf( - "AWS account ID is required. Set AWS_ACCOUNT_ID in .env file or aws.account_id in config", - ) - } - - region := os.Getenv("AWS_DEFAULT_REGION") - if region == "" { - region = viper.GetString("aws.region") - } - if region == "" { return nil, fmt.Errorf( - "AWS region is required. Set AWS_DEFAULT_REGION in .env file or aws.region in config", + "AWS account ID is required. Set aws.account_id in config", ) } - awsProvider, err := awsprovider.NewAWSProvider(accountID, region) + awsProvider, err := aws_provider.NewAWSProviderFunc(accountID) if err != nil { return nil, fmt.Errorf("failed to initialize AWS provider: %w", err) } @@ -111,9 +127,14 @@ func initializeAWSProvider() (*awsprovider.AWSProvider, error) { func prepareDeployment( ctx context.Context, - awsProvider *awsprovider.AWSProvider, + awsProvider *aws_provider.AWSProvider, ) (*models.Deployment, error) { - deployment, err := awsProvider.PrepareDeployment(ctx) + m := display.GetGlobalModelFunc() + if m == nil { + return nil, fmt.Errorf("display model is nil") + } + + err := awsProvider.PrepareDeployment(ctx) if err != nil { return nil, fmt.Errorf("failed to prepare deployment: %w", err) } @@ -126,23 +147,24 @@ func prepareDeployment( } return nil, fmt.Errorf("failed to process machines config: %w", err) } - deployment.SetMachines(machines) - deployment.SetLocations(locations) + m.Deployment.SetMachines(machines) + m.Deployment.SetLocations(locations) - return deployment, nil + return m.Deployment, nil } -func startResourcePolling(ctx context.Context, awsProvider *awsprovider.AWSProvider) { +func startResourcePolling(ctx context.Context, awsProvider *aws_provider.AWSProvider) error { l := logger.Get() err := awsProvider.StartResourcePolling(ctx) if err != nil { l.Error(fmt.Sprintf("Failed to start resource polling: %v", err)) } + return err } func runDeploymentAsync( ctx context.Context, - awsProvider *awsprovider.AWSProvider, + awsProvider *aws_provider.AWSProvider, cancel context.CancelFunc, ) error { l := logger.Get() @@ -186,7 +208,7 @@ func runDeploymentAsync( return deploymentErr } -func runDeployment(ctx context.Context, awsProvider *awsprovider.AWSProvider) error { +func runDeployment(ctx context.Context, awsProvider *aws_provider.AWSProvider) error { l := logger.Get() prog := display.GetGlobalProgramFunc() m := display.GetGlobalModelFunc() @@ -198,10 +220,70 @@ func runDeployment(ctx context.Context, awsProvider *awsprovider.AWSProvider) er return fmt.Errorf("failed to bootstrap environment: %w", err) } + l.Debug("Starting infrastructure creation...") + // Create infrastructure and wait for it to be ready if err := awsProvider.CreateInfrastructure(ctx); err != nil { + l.Debugf("Infrastructure creation failed: %v", err) + for _, machine := range m.Deployment.GetMachines() { + m.QueueUpdate(display.UpdateAction{ + MachineName: machine.GetName(), + UpdateData: display.UpdateData{ + UpdateType: display.UpdateTypeResource, + ResourceType: "Infrastructure", + ResourceState: models.ResourceStateFailed, + }, + }) + } return fmt.Errorf("failed to create infrastructure: %w", err) } + // Wait for network propagation and connectivity + l.Info("Waiting for network propagation...") + if err := awsProvider.WaitForNetworkConnectivity(ctx); err != nil { + return fmt.Errorf("failed waiting for network connectivity: %w", err) + } + + l.Info("Network connectivity confirmed") + + if err := awsProvider.DeployVMsInParallel(ctx); err != nil { + return fmt.Errorf("failed to deploy VMs in parallel: %w", err) + } + + // Wait for all VMs to be accessible via SSH + l.Info("Waiting for all VMs to be accessible via SSH...") + for _, machine := range m.Deployment.GetMachines() { + if machine.GetPublicIP() == "" { + return fmt.Errorf("machine %s has no public IP", machine.GetName()) + } + + sshConfig, err := sshutils.NewSSHConfigFunc( + machine.GetPublicIP(), + machine.GetSSHPort(), + machine.GetSSHUser(), + machine.GetSSHPrivateKeyPath(), + ) + if err != nil { + return fmt.Errorf( + "failed to create SSH config for machine %s: %w", + machine.GetName(), + err, + ) + } + + if err := sshConfig.WaitForSSH(ctx, sshutils.SSHRetryAttempts, sshutils.GetAggregateSSHTimeout()); err != nil { + return fmt.Errorf( + "failed to establish SSH connection to machine %s: %w", + machine.GetName(), + err, + ) + } + + l.Infof("Machine %s is accessible via SSH", machine.GetName()) + } + + l.Info("All VMs are accessible via SSH") + + // Now provision the Bacalhau cluster if err := awsProvider.ProvisionBacalhauCluster(ctx); err != nil { return fmt.Errorf("failed to provision Bacalhau cluster: %w", err) } @@ -217,6 +299,30 @@ func runDeployment(ctx context.Context, awsProvider *awsprovider.AWSProvider) er return nil } +func writeVPCIDToConfig(deployment *models.Deployment) error { + if deployment == nil || deployment.AWS == nil { + return fmt.Errorf("deployment or AWS config is nil") + } + + // Get the current deployment from config + deploymentKey := fmt.Sprintf("deployments.aws.%s", deployment.Name) + currentDeployment := viper.GetStringMap(deploymentKey) + if currentDeployment == nil { + currentDeployment = make(map[string]interface{}) + } + + // Update the VPC ID + currentDeployment["account_id"] = deployment.AWS.AccountID + + // Write back to config + viper.Set(deploymentKey, currentDeployment) + if err := viper.WriteConfig(); err != nil { + return fmt.Errorf("failed to write config: %w", err) + } + + return nil +} + func handleDeploymentCompletion(ctx context.Context, m *display.DisplayModel, deploymentErr error) { writeConfig() @@ -241,37 +347,42 @@ func writeConfig() { l := logger.Get() configFile := viper.ConfigFileUsed() if configFile != "" { - if err := viper.WriteConfigAs(configFile); err != nil { + // Ensure the deployments section exists + if !viper.IsSet("deployments") { + viper.Set("deployments", make(map[string]interface{})) + } + + // Get the current deployment info + m := display.GetGlobalModelFunc() + if m != nil && m.Deployment != nil { + deploymentID := m.Deployment.UniqueID + deploymentPath := fmt.Sprintf("deployments.%s", deploymentID) + + // Save minimal deployment details + machines := make(map[string]interface{}) + for name, machine := range m.Deployment.GetMachines() { + machines[name] = map[string]interface{}{ + "public_ip": machine.GetPublicIP(), + "private_ip": machine.GetPrivateIP(), + "location": machine.GetLocation(), + } + } + + viper.Set(deploymentPath, map[string]interface{}{ + "provider": "aws", + "aws": map[string]interface{}{ + "account_id": m.Deployment.AWS.AccountID, + }, + "machines": machines, + }) + } + + if err := viper.WriteConfig(); err != nil { l.Error(fmt.Sprintf("Failed to write configuration to file: %v", err)) } else { - l.Debug(fmt.Sprintf("Configuration written to %s", configFile)) + l.Info(fmt.Sprintf("Configuration written to %s", configFile)) } + } else { + l.Error("No config file specified") } } - -func NewVpcStack(scope constructs.Construct, id string, props *awscdk.StackProps) awscdk.Stack { - stack := awscdk.NewStack(scope, &id, props) - - vpc := awsec2.NewVpc(stack, jsii.String("AndaimeVPC"), &awsec2.VpcProps{ - MaxAzs: jsii.Number(2), - SubnetConfiguration: &[]*awsec2.SubnetConfiguration{ - { - CidrMask: jsii.Number(24), - Name: jsii.String("Public"), - SubnetType: awsec2.SubnetType_PUBLIC, - }, - { - CidrMask: jsii.Number(24), - Name: jsii.String("Private"), - SubnetType: awsec2.SubnetType_PRIVATE_WITH_EGRESS, - }, - }, - }) - - awscdk.NewCfnOutput(stack, jsii.String("VpcId"), &awscdk.CfnOutputProps{ - Value: vpc.VpcId(), - Description: jsii.String("VPC ID"), - }) - - return stack -} diff --git a/cmd/beta/aws/create_deployment_test.go b/cmd/beta/aws/create_deployment_test.go new file mode 100644 index 00000000..5d0d2ae6 --- /dev/null +++ b/cmd/beta/aws/create_deployment_test.go @@ -0,0 +1,102 @@ +package aws + +import ( + "os" + "path/filepath" + "testing" + + sshutils_mock "github.com/bacalhau-project/andaime/mocks/sshutils" + "github.com/bacalhau-project/andaime/pkg/models" + "github.com/spf13/viper" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestWriteVPCIDToConfig(t *testing.T) { + // Create a temporary config file + tempDir := t.TempDir() + configFile := filepath.Join(tempDir, "config.yaml") + + // Create test configuration + config := []byte(` +deployments: + test-deployment: + provider: "aws" + aws: + account_id: "test-account-id" + regions: + us-west-2: + vpc_id: "" + security_group_id: "" +`) + + err := os.WriteFile(configFile, config, 0644) + require.NoError(t, err) + + // Initialize viper with the test config + viper.Reset() + viper.SetConfigFile(configFile) + err = viper.ReadInConfig() + require.NoError(t, err) + + // Create test deployment + deployment := &models.Deployment{ + UniqueID: "test-deployment", + DeploymentType: models.DeploymentTypeAWS, + AWS: &models.AWSDeployment{ + AccountID: "test-account-id", + RegionalResources: &models.RegionalResources{ + VPCs: map[string]*models.AWSVPC{ + "us-west-2": { + VPCID: "vpc-12345", + SecurityGroupID: "sg-12345", + }, + }, + }, + }, + } + + // Write deployment to config + err = deployment.UpdateViperConfig() + require.NoError(t, err) + + // Verify the configuration was written correctly + viper.ReadInConfig() // Reload config + + // Check AWS account ID + assert.Equal(t, + "test-account-id", + viper.GetString("deployments.test-deployment.aws.account_id"), + "AWS account ID should be written to config", + ) + + // Check VPC ID + assert.Equal(t, + "vpc-12345", + viper.GetString("deployments.test-deployment.aws.regions.us-west-2.vpc_id"), + "VPC ID should be written to config", + ) + + // Check security group ID + assert.Equal(t, + "sg-12345", + viper.GetString("deployments.test-deployment.aws.regions.us-west-2.security_group_id"), + "Security group ID should be written to config", + ) +} + +func TestExecuteCreateDeployment(t *testing.T) { + // ... existing test setup ... + + // Create SSH config mock + mockSSHConfig := new(sshutils_mock.MockSSHConfiger) + + // Set up expectations for the Connect call + mockSSHConfig.On("Connect").Return(nil) + + // If the mock needs to return a connection, you might need something like: + // mockConn := new(mocks.SSHConnection) + // mockSSHConfig.On("Connect").Return(mockConn, nil) + + // ... rest of test ... +} diff --git a/cmd/beta/aws/destroy_deployment.go b/cmd/beta/aws/destroy_deployment.go index 12a9218f..f8fb648c 100644 --- a/cmd/beta/aws/destroy_deployment.go +++ b/cmd/beta/aws/destroy_deployment.go @@ -13,7 +13,7 @@ import ( "github.com/bacalhau-project/andaime/pkg/logger" "github.com/bacalhau-project/andaime/pkg/models" - awsprovider "github.com/bacalhau-project/andaime/pkg/providers/aws" + aws_provider "github.com/bacalhau-project/andaime/pkg/providers/aws" "github.com/bacalhau-project/andaime/pkg/utils" ) @@ -57,6 +57,11 @@ func runDestroy(cmd *cobra.Command, args []string) error { return err } + if len(deployments) == 0 { + fmt.Println("No deployments found to destroy") + return nil + } + if flags.destroyAll { return destroyAllDeployments(cmd.Context(), deployments, flags.dryRun) } @@ -129,6 +134,18 @@ func extractAwsDeployments(uniqueID string, details interface{}) ([]ConfigDeploy return nil, nil // Not an AWS deployment, skip } + // If this is a deployment without a VPC ID, it won't have stack details + if _, hasVpcID := awsDetails["vpc_id"]; hasVpcID { + deployments = append(deployments, ConfigDeployment{ + Name: uniqueID, + Type: models.DeploymentTypeAWS, + UniqueID: uniqueID, + FullViperKey: fmt.Sprintf("deployments.%s", uniqueID), + }) + return deployments, nil + } + + // Handle deployments with stack details for stackName, stackDetails := range awsDetails { stackMap, ok := stackDetails.(map[string]interface{}) if !ok { @@ -220,6 +237,10 @@ func selectDeploymentByIndex(deployments []ConfigDeployment, index int) (ConfigD } func selectDeploymentInteractively(deployments []ConfigDeployment) (ConfigDeployment, error) { + if len(deployments) == 0 { + return ConfigDeployment{}, fmt.Errorf("no deployments available to destroy") + } + fmt.Println("Available deployments:") for i, dep := range deployments { fmt.Printf("%d. %s (%s) - %s\n", i+1, dep.Name, dep.Type, dep.ID) @@ -256,7 +277,7 @@ func destroyDeployment(ctx context.Context, dep ConfigDeployment, dryRun bool) e if dryRun { fmt.Printf(" -- Dry run: Would destroy AWS resources for VPC %s\n", dep.ID) } else { - err = awsProvider.DestroyResources(ctx, dep.ID) + err = awsProvider.Destroy(ctx, dep.ID) if err != nil { return fmt.Errorf("failed to destroy AWS deployment %s: %w", dep.Name, err) } @@ -271,10 +292,9 @@ func destroyDeployment(ctx context.Context, dep ConfigDeployment, dryRun bool) e return nil } -func createAwsProvider() (*awsprovider.AWSProvider, error) { +func createAwsProvider() (*aws_provider.AWSProvider, error) { accountID := viper.GetString("aws.account_id") - region := viper.GetString("aws.region") - provider, err := awsprovider.NewAWSProvider(accountID, region) + provider, err := aws_provider.NewAWSProviderFunc(accountID) if err != nil { return nil, fmt.Errorf("failed to create AWS provider: %w", err) } diff --git a/cmd/beta/aws/list_deployment.go b/cmd/beta/aws/list_deployment.go index f0a1088a..88e61bad 100644 --- a/cmd/beta/aws/list_deployment.go +++ b/cmd/beta/aws/list_deployment.go @@ -3,7 +3,9 @@ package aws import ( "fmt" - awsprovider "github.com/bacalhau-project/andaime/pkg/providers/aws" + awsconfig "github.com/aws/aws-sdk-go-v2/config" + "github.com/aws/aws-sdk-go-v2/service/sts" + aws_provider "github.com/bacalhau-project/andaime/pkg/providers/aws" "github.com/spf13/cobra" "github.com/spf13/viper" ) @@ -15,11 +17,29 @@ func GetAwsListDeploymentsCmd() *cobra.Command { var listDeploymentsCmd = &cobra.Command{ Use: "deployments", Short: "List deployments in AWS", - Long: `List all deployments in AWS using the configuration specified in the config file.`, + Long: `List all deployments in AWS across all regions using the configuration specified in the config file.`, RunE: func(cmd *cobra.Command, args []string) error { + // Try to load AWS configuration from environment or config file accountID := viper.GetString("aws.account_id") - region := viper.GetString("aws.region") - awsProvider, err := awsprovider.NewAWSProvider(accountID, region) + + // If account ID is not set, try to get it from STS + if accountID == "" { + cfg, err := awsconfig.LoadDefaultConfig(cmd.Context()) + if err != nil { + return fmt.Errorf("failed to load AWS configuration: %w", err) + } + stsClient := sts.NewFromConfig(cfg) + callerIdentity, err := stsClient.GetCallerIdentity( + cmd.Context(), + &sts.GetCallerIdentityInput{}, + ) + if err != nil { + return fmt.Errorf("failed to get AWS account ID: %w", err) + } + accountID = *callerIdentity.Account + } + + awsProvider, err := aws_provider.NewAWSProviderFunc(accountID) if err != nil { return fmt.Errorf("failed to initialize AWS provider: %w", err) } @@ -30,6 +50,11 @@ var listDeploymentsCmd = &cobra.Command{ } // Print deployments + if len(deployments) == 0 { + cmd.Println("No deployments found") + return nil + } + for _, deployment := range deployments { cmd.Println(deployment) } diff --git a/cmd/beta/aws/root.go b/cmd/beta/aws/root.go index 2a0af375..ec62b0dc 100644 --- a/cmd/beta/aws/root.go +++ b/cmd/beta/aws/root.go @@ -3,7 +3,7 @@ package aws import ( "sync" - awsprovider "github.com/bacalhau-project/andaime/pkg/providers/aws" + aws_provider "github.com/bacalhau-project/andaime/pkg/providers/aws" "github.com/spf13/cobra" "github.com/spf13/viper" ) @@ -23,8 +23,7 @@ func GetAwsDiagnosticsCmd() *cobra.Command { Long: `Prints detailed information about AWS configuration, credentials, and permissions.`, RunE: func(cmd *cobra.Command, args []string) error { accountID := viper.GetString("aws.account_id") - region := viper.GetString("aws.region") - awsProvider, err := awsprovider.NewAWSProvider(accountID, region) + awsProvider, err := aws_provider.NewAWSProviderFunc(accountID) if err != nil { return err } diff --git a/cmd/beta/provision/provisioner.go b/cmd/beta/provision/provisioner.go index 21e25928..1332107c 100644 --- a/cmd/beta/provision/provisioner.go +++ b/cmd/beta/provision/provisioner.go @@ -11,6 +11,7 @@ import ( "github.com/bacalhau-project/andaime/pkg/logger" "github.com/bacalhau-project/andaime/pkg/models" common_interface "github.com/bacalhau-project/andaime/pkg/models/interfaces/common" + sshutils_interfaces "github.com/bacalhau-project/andaime/pkg/models/interfaces/sshutils" "github.com/bacalhau-project/andaime/pkg/providers/common" "github.com/bacalhau-project/andaime/pkg/sshutils" "github.com/spf13/cobra" @@ -23,11 +24,12 @@ const ( MaxRetries = 5 RetryDelay = 10 * time.Second marginSpaces = " " + SSHRetryCount = 10 // Number of SSH connection retries ) // Provisioner handles the node provisioning process type Provisioner struct { - SSHConfig sshutils.SSHConfiger + SSHConfig sshutils_interfaces.SSHConfiger Config *NodeConfig Machine models.Machiner SettingsParser *SettingsParser @@ -48,7 +50,7 @@ func NewProvisioner(config *NodeConfig) (*Provisioner, error) { config.IPAddress, DefaultSSHPort, config.Username, - config.PrivateKey, + config.PrivateKeyPath, ) if err != nil { return nil, fmt.Errorf("failed to create SSH config: %w", err) @@ -75,7 +77,7 @@ func validateNodeConfig(config *NodeConfig) error { if config.Username == "" { return fmt.Errorf("username is required") } - if config.PrivateKey == "" { + if config.PrivateKeyPath == "" { return fmt.Errorf("private key is required") } return nil @@ -85,7 +87,7 @@ func validateNodeConfig(config *NodeConfig) error { func createMachineInstance(config *NodeConfig) (models.Machiner, error) { machine := models.Machine{} machine.SetSSHUser(config.Username) - machine.SetSSHPrivateKeyPath(config.PrivateKey) + machine.SetSSHPrivateKeyPath(config.PrivateKeyPath) machine.SetSSHPort(DefaultSSHPort) machine.SetPublicIP(config.IPAddress) machine.SetOrchestratorIP("") @@ -136,7 +138,7 @@ func (p *Provisioner) ProvisionWithCallback( StatusMessage: stepRegistry.GetStep(common_interface.SSHConnection).RenderStartMessage(), }) - if err := p.SSHConfig.WaitForSSH(ctx, 3, SSHTimeOut); err != nil { //nolint:mnd + if err := p.SSHConfig.WaitForSSH(ctx, SSHRetryCount, SSHTimeOut); err != nil { //nolint:mnd progress.CurrentStep.Status = "Failed" progress.CurrentStep.Error = err errMsg := fmt.Sprintf("❌ SSH connection failed: %v", err) @@ -207,8 +209,13 @@ func (p *Provisioner) ProvisionWithCallback( // handleProvisionError processes and formats provisioning errors func handleProvisionError(err error, config *NodeConfig, l *logger.Logger) error { var cmdOutput string - if sshErr, ok := err.(*sshutils.SSHError); ok { - cmdOutput = sshErr.Output + + type outputError interface { + Output() string + } + + if outputErr, ok := err.(outputError); ok { + cmdOutput = outputErr.Output() } l.Errorf("Provisioning failed with error: %v", err) @@ -219,7 +226,7 @@ func handleProvisionError(err error, config *NodeConfig, l *logger.Logger) error l.Debugf("Full error context:\nIP: %s\nUser: %s\nPrivate Key Path: %s\nError: %v", config.IPAddress, config.Username, - config.PrivateKey, + config.PrivateKeyPath, err) if cmdOutput != "" { @@ -227,11 +234,10 @@ func handleProvisionError(err error, config *NodeConfig, l *logger.Logger) error "failed to provision Bacalhau node:\nIP: %s\nCommand Output: %s\nError Details: %w", config.IPAddress, cmdOutput, - err, - ) + err) } - return fmt.Errorf("failed to provision Bacalhau node:\nIP: %s\nError Details: %w", - config.IPAddress, err) + + return err } // GetMachine returns the configured machine instance @@ -240,7 +246,7 @@ func (p *Provisioner) GetMachine() models.Machiner { } // GetSSHConfig returns the configured SSH configuration -func (p *Provisioner) GetSSHConfig() sshutils.SSHConfiger { +func (p *Provisioner) GetSSHConfig() sshutils_interfaces.SSHConfiger { return p.SSHConfig } @@ -267,17 +273,26 @@ func (p *Provisioner) ParseSettings(filePath string) ([]models.BacalhauSettings, // testMode is used to run the provisioner in test mode var testMode bool -// ProvisionCmd represents the provision command -var ProvisionCmd = &cobra.Command{ - Use: "provision", - Short: "Provision a new node", - RunE: runProvision, -} - func runProvision(cmd *cobra.Command, args []string) error { + // Get configuration from flags + config := &NodeConfig{ + IPAddress: cmd.Flag("ip").Value.String(), + Username: cmd.Flag("user").Value.String(), + PrivateKeyPath: cmd.Flag("key").Value.String(), + OrchestratorIP: cmd.Flag("orchestrator").Value.String(), + BacalhauSettingsPath: cmd.Flag("bacalhau-settings").Value.String(), + } + + cmd.Flags().BoolVar(&testMode, "test", false, + "Run in test mode (simulation only)") + // Validate configuration - if err := config.Validate(); err != nil { - return fmt.Errorf("invalid configuration: %w", err) + if allErrs := config.Validate(); len(allErrs) > 0 { + fmt.Println("Invalid configuration:") + for _, err := range allErrs { + fmt.Println(err) + } + return fmt.Errorf("invalid configuration") } // Create new provisioner @@ -301,7 +316,7 @@ func runProvision(cmd *cobra.Command, args []string) error { `, config.IPAddress, config.Username, - config.PrivateKey, + config.PrivateKeyPath, ) // Create a channel for progress updates diff --git a/cmd/beta/provision/provisioner_test.go b/cmd/beta/provision/provisioner_test.go index b13cd3cc..56796a51 100644 --- a/cmd/beta/provision/provisioner_test.go +++ b/cmd/beta/provision/provisioner_test.go @@ -6,13 +6,14 @@ import ( "os" "path/filepath" "testing" - "time" "github.com/bacalhau-project/andaime/cmd/beta/provision" "github.com/bacalhau-project/andaime/internal/testutil" common_mock "github.com/bacalhau-project/andaime/mocks/common" + ssh_mock "github.com/bacalhau-project/andaime/mocks/sshutils" "github.com/bacalhau-project/andaime/pkg/logger" "github.com/bacalhau-project/andaime/pkg/models" + sshutils_interfaces "github.com/bacalhau-project/andaime/pkg/models/interfaces/sshutils" "github.com/bacalhau-project/andaime/pkg/sshutils" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" @@ -25,9 +26,9 @@ type CmdBetaProvisionTestSuite struct { cleanupPublicKey func() cleanupPrivateKey func() tmpDir string - mockSSHConfig *sshutils.MockSSHConfig + mockSSHConfig *ssh_mock.MockSSHConfiger mockClusterDeployer *common_mock.MockClusterDeployerer - origNewSSHConfigFunc func(string, int, string, string) (sshutils.SSHConfiger, error) + origNewSSHConfigFunc func(string, int, string, string) (sshutils_interfaces.SSHConfiger, error) testLogger *logger.TestLogger // Add testLogger field } @@ -52,22 +53,37 @@ func (cbpts *CmdBetaProvisionTestSuite) SetupTest() { logger.SetGlobalLogger(cbpts.testLogger) // Create new mocks for each test - cbpts.mockSSHConfig = new(sshutils.MockSSHConfig) + cbpts.mockSSHConfig = new(ssh_mock.MockSSHConfiger) cbpts.mockClusterDeployer = new(common_mock.MockClusterDeployerer) + // Create mock SSH client + mockSSHClient := new(ssh_mock.MockSSHClienter) + mockSSHClient.On("Close").Return(nil).Maybe() + mockSSHClient.On("NewSession").Return(&ssh_mock.MockSSHSessioner{}, nil).Maybe() + mockSSHClient.On("GetClient").Return(nil).Maybe() + // Set up the mock SSH config function - sshutils.NewSSHConfigFunc = func(host string, port int, user string, sshPrivateKeyPath string) (sshutils.SSHConfiger, error) { + sshutils.NewSSHConfigFunc = func(host string, + port int, + user string, + sshPrivateKeyPath string) (sshutils_interfaces.SSHConfiger, error) { return cbpts.mockSSHConfig, nil } + // Set up Connect and Close expectations + cbpts.mockSSHConfig.On("Connect").Return(mockSSHClient, nil).Maybe() + cbpts.mockSSHConfig.On("Close").Return(nil).Maybe() + // Set up default expectations with .Maybe() to make them optional cbpts.mockSSHConfig.On("WaitForSSH", mock.Anything, mock.Anything, mock.Anything). Return(nil). Maybe() - cbpts.mockSSHConfig.On("ExecuteCommand", mock.Anything, mock.Anything).Return("", nil).Maybe() cbpts.mockSSHConfig.On("PushFile", mock.Anything, mock.Anything, mock.Anything, mock.Anything). Return(nil). Maybe() + cbpts.mockSSHConfig.On("ExecuteCommand", mock.Anything, mock.Anything). + Return("", nil). + Maybe() cbpts.mockSSHConfig.On("InstallSystemdService", mock.Anything, mock.Anything, @@ -78,8 +94,9 @@ func (cbpts *CmdBetaProvisionTestSuite) SetupTest() { cbpts.mockSSHConfig.On("RestartService", mock.Anything, mock.Anything, + mock.Anything, ). - Return(nil). + Return("", nil). Maybe() cbpts.mockSSHConfig.On("InstallBacalhau", mock.Anything, @@ -120,9 +137,9 @@ func (cbpts *CmdBetaProvisionTestSuite) TestNewProvisioner() { { name: "valid config", config: &provision.NodeConfig{ - IPAddress: "192.168.1.1", - Username: "testuser", - PrivateKey: cbpts.testSSHPrivateKeyPath, + IPAddress: "192.168.1.1", + Username: "testuser", + PrivateKeyPath: cbpts.testSSHPrivateKeyPath, }, expectError: false, }, @@ -135,8 +152,8 @@ func (cbpts *CmdBetaProvisionTestSuite) TestNewProvisioner() { { name: "missing IP", config: &provision.NodeConfig{ - Username: "testuser", - PrivateKey: cbpts.testSSHPrivateKeyPath, + Username: "testuser", + PrivateKeyPath: cbpts.testSSHPrivateKeyPath, }, expectError: true, errorMsg: "IP address is required", @@ -144,8 +161,8 @@ func (cbpts *CmdBetaProvisionTestSuite) TestNewProvisioner() { { name: "missing username", config: &provision.NodeConfig{ - IPAddress: "192.168.1.1", - PrivateKey: cbpts.testSSHPrivateKeyPath, + IPAddress: "192.168.1.1", + PrivateKeyPath: cbpts.testSSHPrivateKeyPath, }, expectError: true, errorMsg: "username is required", @@ -177,9 +194,9 @@ func (cbpts *CmdBetaProvisionTestSuite) TestNewProvisioner() { func (cbpts *CmdBetaProvisionTestSuite) TestProvision() { config := &provision.NodeConfig{ - IPAddress: "192.168.1.1", - Username: "testuser", - PrivateKey: cbpts.testSSHPrivateKeyPath, + IPAddress: "192.168.1.1", + Username: "testuser", + PrivateKeyPath: cbpts.testSSHPrivateKeyPath, } originalCalls := cbpts.mockSSHConfig.ExpectedCalls @@ -190,7 +207,7 @@ func (cbpts *CmdBetaProvisionTestSuite) TestProvision() { cbpts.mockSSHConfig.On("ExecuteCommand", mock.Anything, "sudo docker run hello-world", - ).Return("Hello from Docker!", nil).Once() + ).Return(models.ExpectedDockerOutput, nil).Once() cbpts.mockSSHConfig.On("ExecuteCommand", mock.Anything, "bacalhau node list --output json --api-host 0.0.0.0", @@ -223,7 +240,7 @@ setting.two: "value2" config := &provision.NodeConfig{ IPAddress: "192.168.1.1", Username: "testuser", - PrivateKey: cbpts.testSSHPrivateKeyPath, + PrivateKeyPath: cbpts.testSSHPrivateKeyPath, BacalhauSettingsPath: settingsFile, } @@ -235,7 +252,7 @@ setting.two: "value2" cbpts.mockSSHConfig.On("ExecuteCommand", mock.Anything, "sudo docker run hello-world", - ).Return("Hello from Docker!", nil).Once() + ).Return(models.ExpectedDockerOutput, nil).Once() cbpts.mockSSHConfig.On("ExecuteCommand", mock.Anything, "bacalhau node list --output json --api-host 0.0.0.0", @@ -267,7 +284,7 @@ invalid-setting config := &provision.NodeConfig{ IPAddress: "192.168.1.1", Username: "testuser", - PrivateKey: cbpts.testSSHPrivateKeyPath, + PrivateKeyPath: cbpts.testSSHPrivateKeyPath, BacalhauSettingsPath: settingsFile, } @@ -281,53 +298,60 @@ invalid-setting } func (cbpts *CmdBetaProvisionTestSuite) TestProvisionWithDockerCheck() { - config := &provision.NodeConfig{ - IPAddress: "192.168.1.1", - Username: "testuser", - PrivateKey: cbpts.testSSHPrivateKeyPath, + // Create mock SSH client + mockSSHClient := new(ssh_mock.MockSSHClienter) + + // Define expected behavior + behavior := sshutils.ExpectedSSHBehavior{ + ConnectExpectation: &sshutils.ConnectExpectation{ + Client: mockSSHClient, + Error: nil, + Times: 2, + }, + ExecuteCommandExpectations: []sshutils.ExecuteCommandExpectation{ + { + Cmd: "sudo docker run hello-world", + Times: 1, + Output: models.ExpectedDockerOutput, + Error: nil, + }, + { + Cmd: "bacalhau node list --output json --api-host 0.0.0.0", + Times: 1, + Output: `[{"id": "12D"}]`, + Error: nil, + }, + }, + WaitForSSHCount: 1, + WaitForSSHError: nil, } - originalCalls := cbpts.mockSSHConfig.ExpectedCalls - // Clear existing ExecuteCommand expectations - cbpts.mockSSHConfig.ExpectedCalls = nil + // Create mock SSH config with behavior + mockSSH := sshutils.NewMockSSHConfigWithBehavior(behavior) - // Add our specific expectation first - cbpts.mockSSHConfig.On("ExecuteCommand", - mock.Anything, - "sudo docker run hello-world", - ).Return("Hello from Docker!", nil).Once() - cbpts.mockSSHConfig.On("ExecuteCommand", - mock.Anything, - "bacalhau node list --output json --api-host 0.0.0.0", - ).Return(`[{"id":"1234567890"}]`, nil).Once() - cbpts.mockSSHConfig.On("ExecuteCommand", - mock.Anything, - "sudo bacalhau config list --output json", - ).Return(`[]`, nil).Once() + // Set up the mock SSH config function + origNewSSHConfigFunc := sshutils.NewSSHConfigFunc + sshutils.NewSSHConfigFunc = func(host string, + port int, + user string, + sshPrivateKeyPath string) (sshutils_interfaces.SSHConfiger, error) { + return mockSSH, nil + } + defer func() { sshutils.NewSSHConfigFunc = origNewSSHConfigFunc }() - cbpts.mockSSHConfig.ExpectedCalls = append(cbpts.mockSSHConfig.ExpectedCalls, - originalCalls...) + config := &provision.NodeConfig{ + IPAddress: "192.168.1.1", + Username: "testuser", + PrivateKeyPath: cbpts.testSSHPrivateKeyPath, + } p, err := provision.NewProvisioner(config) cbpts.Require().NoError(err) - p.SetClusterDeployer(cbpts.mockClusterDeployer) err = p.Provision(context.Background()) cbpts.NoError(err) -} -type MockSSHConfig struct { - mock.Mock -} - -func (m *MockSSHConfig) WaitForSSH(ctx context.Context, retries int, timeout time.Duration) error { - args := m.Called(ctx, retries, timeout) - return args.Error(0) -} - -func (m *MockSSHConfig) ExecuteCommand(cmd string) (string, error) { - args := m.Called(cmd) - return args.String(0), args.Error(1) + mockSSH.(*ssh_mock.MockSSHConfiger).AssertExpectations(cbpts.T()) } func (cbpts *CmdBetaProvisionTestSuite) TestProvisionerLowLevelFailure() { @@ -335,10 +359,18 @@ func (cbpts *CmdBetaProvisionTestSuite) TestProvisionerLowLevelFailure() { logCapture := logger.NewTestLogger(cbpts.T()) logger.SetGlobalLogger(logCapture) + // Create mock SSH client + mockSSHClient := new(ssh_mock.MockSSHClienter) + mockSSHClient.On("Close").Return(nil).Maybe() + mockSSHClient.On("NewSession").Return(&ssh_mock.MockSSHSessioner{}, nil).Maybe() + mockSSHClient.On("GetClient").Return(nil).Maybe() + // Create a mock SSH config - mockSSH := new(sshutils.MockSSHConfig) + mockSSH := new(ssh_mock.MockSSHConfiger) // Setup the mock to pass SSH wait but fail command execution + mockSSH.On("Connect").Return(mockSSHClient, nil).Maybe() + mockSSH.On("Close").Return(nil).Maybe() mockSSH.On("WaitForSSH", mock.Anything, mock.Anything, mock.Anything).Return(nil) @@ -358,9 +390,9 @@ func (cbpts *CmdBetaProvisionTestSuite) TestProvisionerLowLevelFailure() { // Create a provisioner with test configuration config := &provision.NodeConfig{ - IPAddress: "192.168.1.100", - Username: "testuser", - PrivateKey: "/path/to/key", + IPAddress: "192.168.1.100", + Username: "testuser", + PrivateKeyPath: "/path/to/key", } testMachine, err := models.NewMachine( @@ -380,7 +412,10 @@ func (cbpts *CmdBetaProvisionTestSuite) TestProvisionerLowLevelFailure() { Machine: testMachine, } - sshutils.NewSSHConfigFunc = func(host string, port int, user string, sshPrivateKeyPath string) (sshutils.SSHConfiger, error) { + sshutils.NewSSHConfigFunc = func(host string, + port int, + user string, + sshPrivateKeyPath string) (sshutils_interfaces.SSHConfiger, error) { return mockSSH, nil } diff --git a/cmd/beta/provision/root.go b/cmd/beta/provision/root.go index d48c4b07..7ebbadd2 100644 --- a/cmd/beta/provision/root.go +++ b/cmd/beta/provision/root.go @@ -2,8 +2,6 @@ package provision import ( "fmt" - "net" - "os" "github.com/spf13/cobra" ) @@ -26,33 +24,13 @@ For compute nodes, an orchestrator IP must be provided.`, "IP address of the target node (IPv4 or IPv6 format)") cmd.Flags().StringVar(&config.Username, "user", "", "SSH username for authentication") - cmd.Flags().StringVar(&config.PrivateKey, "key", "", + cmd.Flags().StringVar(&config.PrivateKeyPath, "key", "", "Path to SSH private key file (PEM format)") cmd.Flags().StringVar(&config.OrchestratorIP, "orchestrator", "", "IP address of the orchestrator node (required for compute nodes)") cmd.Flags().StringVar(&config.BacalhauSettingsPath, "bacalhau-settings", "", "Path to JSON file containing Bacalhau settings") - // Validate IP address - if net.ParseIP(config.IPAddress) == nil { - fmt.Printf("Invalid IP address: %s", config.IPAddress) - return cmd - } - - // Validate orchestrator IP if provided - if config.OrchestratorIP != "" && net.ParseIP(config.OrchestratorIP) == nil { - fmt.Printf("Invalid orchestrator IP address: %s", config.OrchestratorIP) - return cmd - } - - // Validate private key file path - if _, err := os.Stat(config.PrivateKey); os.IsNotExist(err) { - fmt.Printf("Private key file does not exist: %s", config.PrivateKey) - return cmd - } - cmd.Flags().BoolVar(&testMode, "test", false, - "Run in test mode (simulation only)") - // Mark required flags err := cmd.MarkFlagRequired("ip") if err != nil { diff --git a/cmd/beta/provision/types.go b/cmd/beta/provision/types.go index aca9b667..b0db1c2b 100644 --- a/cmd/beta/provision/types.go +++ b/cmd/beta/provision/types.go @@ -16,53 +16,58 @@ const ( // NodeConfig holds the configuration for a node to be provisioned type NodeConfig struct { - Name string `json:"name" yaml:"name"` - IPAddress string `json:"ip_address" yaml:"ip_address"` - Username string `json:"username" yaml:"username"` - PrivateKey string `json:"private_key" yaml:"private_key"` - OrchestratorIP string `json:"orchestrator_ip,omitempty" yaml:"orchestrator_ip,omitempty"` + Name string `json:"name" yaml:"name"` + IPAddress string `json:"ip_address" yaml:"ip_address"` + Username string `json:"username" yaml:"username"` + PrivateKeyPath string `json:"private_key_path" yaml:"private_key_path"` + OrchestratorIP string `json:"orchestrator_ip,omitempty" yaml:"orchestrator_ip,omitempty"` BacalhauSettingsPath string `json:"bacalhau_settings_path,omitempty" yaml:"bacalhau_settings_path,omitempty"` - CustomScriptPath string `json:"custom_script_path,omitempty" yaml:"custom_script_path,omitempty"` + CustomScriptPath string `json:"custom_script_path,omitempty" yaml:"custom_script_path,omitempty"` } // Validate checks if the configuration is valid -func (c *NodeConfig) Validate() error { +func (c *NodeConfig) Validate() []error { + var errors []error + if c.IPAddress == "" { - return fmt.Errorf("IP address is required") + errors = append(errors, fmt.Errorf("IP address is required")) } // Validate IP address format if net.ParseIP(c.IPAddress) == nil { - return fmt.Errorf("invalid IP address format: %s", c.IPAddress) + errors = append(errors, fmt.Errorf("invalid IP address format: %s", c.IPAddress)) } if c.Username == "" { - return fmt.Errorf("username is required") + errors = append(errors, fmt.Errorf("username is required")) } - if c.PrivateKey == "" { - return fmt.Errorf("private key is required") + if c.PrivateKeyPath == "" { + errors = append(errors, fmt.Errorf("private key path is required")) } // Verify private key exists and is readable - if _, err := os.Stat(c.PrivateKey); err != nil { - return fmt.Errorf("private key file error: %w", err) + if _, err := os.Stat(c.PrivateKeyPath); err != nil { + errors = append(errors, fmt.Errorf("private key file error: %w", err)) } // Validate optional file paths if provided if c.BacalhauSettingsPath != "" { if _, err := os.Stat(c.BacalhauSettingsPath); err != nil { - return fmt.Errorf("bacalhau settings file error: %w", err) + errors = append(errors, fmt.Errorf("bacalhau settings file error: %w", err)) } } if c.CustomScriptPath != "" { if _, err := os.Stat(c.CustomScriptPath); err != nil { - return fmt.Errorf("custom script file error: %w", err) + errors = append(errors, fmt.Errorf("custom script file error: %w", err)) } } // Validate compute node requirements if c.OrchestratorIP != "" && net.ParseIP(c.OrchestratorIP) == nil { - return fmt.Errorf("invalid orchestrator IP address format: %s", c.OrchestratorIP) + errors = append( + errors, + fmt.Errorf("invalid orchestrator IP address format: %s", c.OrchestratorIP), + ) } - return nil + return errors } diff --git a/cspell.config.yaml b/cspell.config.yaml index 79dff784..574eb17b 100644 --- a/cspell.config.yaml +++ b/cspell.config.yaml @@ -1,8 +1,10 @@ version: "0.2" ignorePaths: - - ".git/**" - - ".github/**" - - ".vscode/**" + - "**" + - "!/Users/daaronch/code/andaime/**" + - .git/** + - .github/** + - .vscode/** - "**/node_modules/**" - "**/dist/**" - "**/build/**" @@ -14,11 +16,15 @@ ignorePaths: - "**/tests/**" - "**/__tests__/**" - "**/__mocks__/**" + - "**/vendor/**" - "!cmd/**" - "!internal/**" - "!pkg/**" - "!**/*.md" + - /Users/daaronch/Library/** dictionaryDefinitions: [] -dictionaries: ["./.cspell/project-dictionary.txt"] +dictionaries: + - ./.cspell/project-dictionary.txt ignoreWords: [] import: [] +words: [] diff --git a/delete-vpcs.sh b/delete-vpcs.sh new file mode 100755 index 00000000..4572f2cb --- /dev/null +++ b/delete-vpcs.sh @@ -0,0 +1,128 @@ +#!/bin/bash + +# Parse command line arguments +DRY_RUN=false + +print_usage() { + echo "Usage: $0 [-d|--dry-run]" + echo " -d, --dry-run Run in dry-run mode (no actual deletions)" + exit 1 +} + +while [[ "$#" -gt 0 ]]; do + case $1 in + -d|--dry-run) DRY_RUN=true ;; + -h|--help) print_usage ;; + *) echo "Unknown parameter: $1"; print_usage ;; + esac + shift +done + +if $DRY_RUN; then + echo "Running in DRY-RUN mode - no resources will be deleted" +fi + +# Function to execute AWS commands with dry-run support +execute_aws_command() { + local cmd="$1" + if $DRY_RUN; then + echo "[DRY-RUN] Would execute: $cmd" + else + eval "$cmd" + fi +} + +# Get list of all AWS regions +regions=$(aws ec2 describe-regions --query 'Regions[*].RegionName' --output text) + +# Loop through each region +for region in $regions; do + echo "Checking region: $region" + + # Get VPC IDs for VPCs named "andaime-vpc" + vpc_ids=$(aws ec2 describe-vpcs \ + --region $region \ + --filters "Name=tag:Name,Values=andaime-vpc" \ + --query 'Vpcs[*].VpcId' \ + --output text) + + # If no VPCs found, continue to next region + if [ -z "$vpc_ids" ]; then + echo "No matching VPCs found in $region" + continue + fi + + # Process each VPC + for vpc_id in $vpc_ids; do + echo "Processing VPC: $vpc_id in region $region" + + # Delete all dependent resources first + + # 1. Delete NAT Gateways + nat_gateway_ids=$(aws ec2 describe-nat-gateways \ + --region $region \ + --filter "Name=vpc-id,Values=$vpc_id" \ + --query 'NatGateways[*].NatGatewayId' \ + --output text) + + for nat_id in $nat_gateway_ids; do + echo "Deleting NAT Gateway: $nat_id" + execute_aws_command "aws ec2 delete-nat-gateway --region $region --nat-gateway-id $nat_id" + done + + # 2. Delete Internet Gateways + igw_ids=$(aws ec2 describe-internet-gateways \ + --region $region \ + --filters "Name=attachment.vpc-id,Values=$vpc_id" \ + --query 'InternetGateways[*].InternetGatewayId' \ + --output text) + + for igw_id in $igw_ids; do + echo "Detaching and deleting Internet Gateway: $igw_id" + execute_aws_command "aws ec2 detach-internet-gateway --region $region --internet-gateway-id $igw_id --vpc-id $vpc_id" + execute_aws_command "aws ec2 delete-internet-gateway --region $region --internet-gateway-id $igw_id" + done + + # 3. Delete Subnets + subnet_ids=$(aws ec2 describe-subnets \ + --region $region \ + --filters "Name=vpc-id,Values=$vpc_id" \ + --query 'Subnets[*].SubnetId' \ + --output text) + + for subnet_id in $subnet_ids; do + echo "Deleting Subnet: $subnet_id" + execute_aws_command "aws ec2 delete-subnet --region $region --subnet-id $subnet_id" + done + + # 4. Delete Route Tables (except main) + rt_ids=$(aws ec2 describe-route-tables \ + --region $region \ + --filters "Name=vpc-id,Values=$vpc_id" \ + --query 'RouteTables[?Associations[0].Main != `true`].RouteTableId' \ + --output text) + + for rt_id in $rt_ids; do + echo "Deleting Route Table: $rt_id" + execute_aws_command "aws ec2 delete-route-table --region $region --route-table-id $rt_id" + done + + # 5. Delete Security Groups (except default) + sg_ids=$(aws ec2 describe-security-groups \ + --region $region \ + --filters "Name=vpc-id,Values=$vpc_id" \ + --query 'SecurityGroups[?GroupName != `default`].GroupId' \ + --output text) + + for sg_id in $sg_ids; do + echo "Deleting Security Group: $sg_id" + execute_aws_command "aws ec2 delete-security-group --region $region --group-id $sg_id" + done + + # Finally, delete the VPC + echo "Deleting VPC: $vpc_id" + execute_aws_command "aws ec2 delete-vpc --region $region --vpc-id $vpc_id" + done +done + +echo "VPC deletion process completed" diff --git a/docs/aws/api.md b/docs/aws/api.md new file mode 100644 index 00000000..e044952e --- /dev/null +++ b/docs/aws/api.md @@ -0,0 +1,75 @@ +# AWS Provider API Documentation + +## Overview +The AWS Provider implements direct AWS SDK resource provisioning for EC2 instances, networking, and associated resources. This document details the public interfaces and configuration options. + +## Core Interfaces + +### AWSProvider +The main provider struct that handles AWS resource provisioning: + +```go +type AWSProvider struct { + AccountID string + Config *aws.Config + Region string + ClusterDeployer common_interface.ClusterDeployerer + UpdateQueue chan display.UpdateAction + VPCID string + EC2Client aws_interface.EC2Clienter +} +``` + +### Key Methods + +#### NewAWSProvider +```go +func NewAWSProvider(accountID, region string) (*AWSProvider, error) +``` +Creates a new AWS provider instance with the specified account ID and region. + +#### CreateInfrastructure +```go +func (p *AWSProvider) CreateInfrastructure(ctx context.Context) error +``` +Creates the core AWS infrastructure including VPC, subnets, internet gateway, and routing tables. + +#### CreateVPC +```go +func (p *AWSProvider) CreateVPC(ctx context.Context) error +``` +Creates a VPC with the following components: +- VPC with CIDR block 10.0.0.0/16 +- Public and private subnets +- Internet gateway +- Route tables for internet access + +#### StartResourcePolling +```go +func (p *AWSProvider) StartResourcePolling(ctx context.Context) error +``` +Begins polling AWS resources to monitor their state and update the deployment status. + +## Error Handling +The provider implements comprehensive error handling with detailed error types and recovery mechanisms: + +- Network errors include retries with exponential backoff +- Resource creation failures trigger automatic cleanup +- API throttling is handled with rate limiting +- Detailed error messages are logged for debugging + +## Logging +Structured logging is implemented using zap logger with the following levels: +- DEBUG: Detailed debugging information +- INFO: General operational information +- WARN: Warning messages for potential issues +- ERROR: Error conditions that need attention + +## Resource Management +Resources are tagged with: +- Name +- Project ID +- Deployment ID +- Creation timestamp + +This enables easy resource tracking and cleanup. diff --git a/docs/aws/configuration.md b/docs/aws/configuration.md new file mode 100644 index 00000000..0fa98c1d --- /dev/null +++ b/docs/aws/configuration.md @@ -0,0 +1,86 @@ +# AWS Provider Configuration Guide + +## Configuration Options + +### Required Settings +```yaml +aws: + account_id: "123456789012" # Your AWS account ID + region: "us-west-2" # AWS region for deployment +``` + +### Optional Settings +```yaml +aws: + default_machine_type: "t3.micro" # Default EC2 instance type + default_disk_size_gb: 30 # Default EBS volume size + default_count_per_zone: 1 # Instances per availability zone + tags: # Custom resource tags + Environment: "production" + Project: "andaime" +``` + +### Machine Configuration +```yaml +aws: + machines: + - location: "us-west-2" + parameters: + count: 2 + machine_type: "t3.micro" + orchestrator: true +``` + +## Network Configuration + +### VPC Settings +- CIDR Block: 10.0.0.0/16 +- Public Subnet: 10.0.1.0/24 +- Private Subnet: 10.0.2.0/24 + +### Security +- Default security group with SSH access +- Internet gateway for public subnet +- NAT gateway for private subnet (optional) + +## Resource Limits + +### Default Quotas +- EC2 instances per region: 20 +- VPCs per region: 5 +- EBS volumes per instance: 40 + +### Performance +- Resource creation timeout: 30 minutes +- Polling interval: 10 seconds +- Maximum concurrent operations: 10 + +## Environment Variables +```bash +AWS_ACCESS_KEY_ID=your_access_key +AWS_SECRET_ACCESS_KEY=your_secret_key +AWS_DEFAULT_REGION=us-west-2 +``` + +## Example Configuration +```yaml +aws: + account_id: "123456789012" + region: "us-west-2" + default_machine_type: "t3.micro" + default_disk_size_gb: 30 + machines: + - location: "us-west-2" + parameters: + count: 2 + machine_type: "t3.large" + orchestrator: true + - location: "us-east-1" + parameters: + count: 3 + machine_type: "t3.medium" + tags: + Environment: "production" + Project: "andaime" + Team: "infrastructure" +``` diff --git a/docs/aws/migration.md b/docs/aws/migration.md new file mode 100644 index 00000000..1b89f17d --- /dev/null +++ b/docs/aws/migration.md @@ -0,0 +1,65 @@ +# Migration Guide: CDK to Direct AWS SDK + +This guide helps you migrate from the AWS CDK-based deployment to the new direct AWS SDK implementation. + +## Key Changes + +### 1. Configuration Updates +Previous CDK configuration: +```yaml +aws: + cdk_stack_name: "MyStack" + cdk_app: "app.ts" +``` + +New SDK configuration: +```yaml +aws: + account_id: "123456789012" + region: "us-west-2" + default_machine_type: "t3.micro" + default_disk_size_gb: 30 +``` + +### 2. Resource Creation +- VPC and networking components are now created directly via AWS SDK +- EC2 instances are provisioned without CDK constructs +- Resource polling replaces CloudFormation stack events + +### 3. Error Handling +- More granular error handling with specific error types +- Improved recovery mechanisms +- Detailed logging of operations + +## Migration Steps + +1. Update Configuration + - Remove CDK-specific configuration + - Add new SDK configuration parameters + - Update machine specifications + +2. Code Changes + - Remove CDK imports and dependencies + - Update resource creation calls + - Update error handling + +3. Testing + - Run integration tests + - Verify resource creation + - Check cleanup processes + +## Rollback Procedure + +If issues occur during migration: + +1. Stop the deployment +2. Run cleanup to remove resources +3. Revert to CDK version +4. Restore original configuration + +## Support + +For migration assistance: +- File issues on GitHub +- Contact the development team +- Check documentation updates diff --git a/go.mod b/go.mod index 6425f48c..5e86d95a 100644 --- a/go.mod +++ b/go.mod @@ -18,16 +18,12 @@ require ( github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resourcegraph/armresourcegraph v0.9.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/subscription/armsubscription v1.2.0 - github.com/aws/aws-cdk-go/awscdk/v2 v2.171.1 github.com/aws/aws-sdk-go v1.55.5 github.com/aws/aws-sdk-go-v2 v1.32.5 github.com/aws/aws-sdk-go-v2/config v1.28.5 - github.com/aws/aws-sdk-go-v2/service/cloudformation v1.56.0 github.com/aws/aws-sdk-go-v2/service/ec2 v1.194.0 github.com/aws/aws-sdk-go-v2/service/s3 v1.69.0 github.com/aws/aws-sdk-go-v2/service/ssm v1.56.0 - github.com/aws/constructs-go/constructs/v10 v10.4.2 - github.com/aws/jsii-runtime-go v1.105.0 github.com/briandowns/spinner v1.23.1 github.com/cenkalti/backoff/v4 v4.3.0 github.com/charmbracelet/bubbles v0.20.0 @@ -68,16 +64,11 @@ require ( github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.25.0 // indirect github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.49.0 // indirect github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.49.0 // indirect - github.com/Masterminds/semver/v3 v3.3.1 // indirect github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.7 // indirect github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.24 // indirect github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.4.5 // indirect github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.5 // indirect github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect - github.com/cdklabs/awscdk-asset-awscli-go/awscliv1/v2 v2.2.213 // indirect - github.com/cdklabs/awscdk-asset-kubectl-go/kubectlv20/v2 v2.1.3 // indirect - github.com/cdklabs/awscdk-asset-node-proxy-agent-go/nodeproxyagentv6/v2 v2.1.0 // indirect - github.com/cdklabs/cloud-assembly-schema-go/awscdkcloudassemblyschema/v38 v38.0.1 // indirect github.com/census-instrumentation/opencensus-proto v0.4.1 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/charmbracelet/x/ansi v0.5.2 // indirect @@ -108,7 +99,6 @@ require ( github.com/sagikazarmark/locafero v0.6.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/sourcegraph/conc v0.3.0 // indirect - github.com/yuin/goldmark v1.7.8 // indirect go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/contrib/detectors/gcp v1.32.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.57.0 // indirect @@ -119,8 +109,6 @@ require ( go.opentelemetry.io/otel/sdk/metric v1.32.0 // indirect go.opentelemetry.io/otel/trace v1.32.0 // indirect golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect - golang.org/x/lint v0.0.0-20241112194109-818c5a804067 // indirect - golang.org/x/mod v0.22.0 // indirect golang.org/x/term v0.26.0 // indirect golang.org/x/time v0.8.0 // indirect golang.org/x/tools v0.27.0 // indirect diff --git a/go.sum b/go.sum index 3898e95e..696205dc 100644 --- a/go.sum +++ b/go.sum @@ -1,76 +1,48 @@ cel.dev/expr v0.18.0 h1:CJ6drgk+Hf96lkLikr4rFf19WrU0BOWEihyZnI2TAzo= cel.dev/expr v0.18.0/go.mod h1:MrpN08Q+lEBs+bGYdLxxHkZoUSsCp0nSKTs0nTymJgw= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.115.1 h1:Jo0SM9cQnSkYfp44+v+NQXHpcHqlnRJk2qxh6yvxxxQ= -cloud.google.com/go v0.115.1/go.mod h1:DuujITeaufu3gL68/lOFIirVNJwQeyf5UXyi+Wbgknc= cloud.google.com/go v0.116.0 h1:B3fRrSDkLRt5qSHWe40ERJvhvnQwdZiHu0bJOpldweE= cloud.google.com/go v0.116.0/go.mod h1:cEPSRWPzZEswwdr9BxE6ChEn01dWlTaF05LiC2Xs70U= -cloud.google.com/go/accesscontextmanager v1.9.0 h1:K0zCbd23A64sdJmOZDaW39dEMB6JVnGz2uycwd8PTu0= -cloud.google.com/go/accesscontextmanager v1.9.0/go.mod h1:EmdQRGq5FHLrjGjGTp2X2tlRBvU3LDCUqfnysFYooxQ= cloud.google.com/go/accesscontextmanager v1.9.2 h1:P0uVixQft8aacbZ7VDZStNZdrftF24Hk8JkA3kfvfqI= cloud.google.com/go/accesscontextmanager v1.9.2/go.mod h1:T0Sw/PQPyzctnkw1pdmGAKb7XBA84BqQzH0fSU7wzJU= -cloud.google.com/go/asset v1.20.0 h1:2kHJKyVUEbuisDjvOK9+XQrvoosEBqsb6yaEzq5gaWY= -cloud.google.com/go/asset v1.20.0/go.mod h1:CT3ME6xNZKsPSvi0lMBPgW3azvRhiurJTFSnNl6ahw8= cloud.google.com/go/asset v1.20.3 h1:/jQBAkZVUbsIczRepDkwaf/K5NcRYvQ6MBiWg5i20fU= cloud.google.com/go/asset v1.20.3/go.mod h1:797WxTDwdnFAJzbjZ5zc+P5iwqXc13yO9DHhmS6wl+o= -cloud.google.com/go/auth v0.9.1 h1:+pMtLEV2k0AXKvs/tGZojuj6QaioxfUjOpMsG5Gtx+w= -cloud.google.com/go/auth v0.9.1/go.mod h1:Sw8ocT5mhhXxFklyhT12Eiy0ed6tTrPMCJjSI8KhYLk= cloud.google.com/go/auth v0.11.0 h1:Ic5SZz2lsvbYcWT5dfjNWgw6tTlGi2Wc8hyQSC9BstA= cloud.google.com/go/auth v0.11.0/go.mod h1:xxA5AqpDrvS+Gkmo9RqrGGRh6WSNKKOXhY3zNOr38tI= -cloud.google.com/go/auth/oauth2adapt v0.2.4 h1:0GWE/FUsXhf6C+jAkWgYm7X9tK8cuEIfy19DBn6B6bY= -cloud.google.com/go/auth/oauth2adapt v0.2.4/go.mod h1:jC/jOpwFP6JBxhB3P5Rr0a9HLMC/Pe3eaL4NmdvqPtc= cloud.google.com/go/auth/oauth2adapt v0.2.6 h1:V6a6XDu2lTwPZWOawrAa9HUK+DB2zfJyTuciBG5hFkU= cloud.google.com/go/auth/oauth2adapt v0.2.6/go.mod h1:AlmsELtlEBnaNTL7jCj8VQFLy6mbZv0s4Q7NGBeQ5E8= -cloud.google.com/go/billing v1.19.0 h1:hnFBA+u/O7mP9a1z5Um4oZ5dONrKV9XSCrlpMGP73wk= -cloud.google.com/go/billing v1.19.0/go.mod h1:bGvChbZguyaWRGmu5pQHfFN1VxTDPFmabnCVA/dNdRM= cloud.google.com/go/billing v1.19.2 h1:shcyz1UkrUxbPsqHL6L84ZdtBZ7yocaFFCxMInTsrNo= cloud.google.com/go/billing v1.19.2/go.mod h1:AAtih/X2nka5mug6jTAq8jfh1nPye0OjkHbZEZgU59c= -cloud.google.com/go/compute v1.28.0 h1:OPtBxMcheSS+DWfci803qvPly3d4w7Eu5ztKBcFfzwk= -cloud.google.com/go/compute v1.28.0/go.mod h1:DEqZBtYrDnD5PvjsKwb3onnhX+qjdCVM7eshj1XdjV4= cloud.google.com/go/compute v1.29.0 h1:Lph6d8oPi38NHkOr6S55Nus/Pbbcp37m/J0ohgKAefs= cloud.google.com/go/compute v1.29.0/go.mod h1:HFlsDurE5DpQZClAGf/cYh+gxssMhBxBovZDYkEn/Og= -cloud.google.com/go/compute/metadata v0.5.0 h1:Zr0eK8JbFv6+Wi4ilXAR8FJ3wyNdpxHKJNPos6LTZOY= -cloud.google.com/go/compute/metadata v0.5.0/go.mod h1:aHnloV2TPI38yx4s9+wAZhHykWvVCfu7hQbF+9CWoiY= cloud.google.com/go/compute/metadata v0.5.2 h1:UxK4uu/Tn+I3p2dYWTfiX4wva7aYlKixAHn3fyqngqo= cloud.google.com/go/compute/metadata v0.5.2/go.mod h1:C66sj2AluDcIqakBq/M8lw8/ybHgOZqin2obFxa/E5k= -cloud.google.com/go/iam v1.2.0 h1:kZKMKVNk/IsSSc/udOb83K0hL/Yh/Gcqpz+oAkoIFN8= -cloud.google.com/go/iam v1.2.0/go.mod h1:zITGuWgsLZxd8OwAlX+eMFgZDXzBm7icj1PVTYG766Q= cloud.google.com/go/iam v1.2.2 h1:ozUSofHUGf/F4tCNy/mu9tHLTaxZFLOUiKzjcgWHGIA= cloud.google.com/go/iam v1.2.2/go.mod h1:0Ys8ccaZHdI1dEUilwzqng/6ps2YB6vRsjIe00/+6JY= -cloud.google.com/go/longrunning v0.6.0 h1:mM1ZmaNsQsnb+5n1DNPeL0KwQd9jQRqSqSDEkBZr+aI= -cloud.google.com/go/longrunning v0.6.0/go.mod h1:uHzSZqW89h7/pasCWNYdUpwGz3PcVWhrWupreVPYLts= +cloud.google.com/go/logging v1.12.0 h1:ex1igYcGFd4S/RZWOCU51StlIEuey5bjqwH9ZYjHibk= +cloud.google.com/go/logging v1.12.0/go.mod h1:wwYBt5HlYP1InnrtYI0wtwttpVU1rifnMT7RejksUAM= cloud.google.com/go/longrunning v0.6.3 h1:A2q2vuyXysRcwzqDpMMLSI6mb6o39miS52UEG/Rd2ng= cloud.google.com/go/longrunning v0.6.3/go.mod h1:k/vIs83RN4bE3YCswdXC5PFfWVILjm3hpEUlSko4PiI= cloud.google.com/go/monitoring v1.21.2 h1:FChwVtClH19E7pJ+e0xUhJPGksctZNVOk2UhMmblmdU= cloud.google.com/go/monitoring v1.21.2/go.mod h1:hS3pXvaG8KgWTSz+dAdyzPrGUYmi2Q+WFX8g2hqVEZU= -cloud.google.com/go/orgpolicy v1.13.0 h1:WaabiSAxtyi4JNFATvsPmQS2IWRjr1+pwU3/Bihj7eA= -cloud.google.com/go/orgpolicy v1.13.0/go.mod h1:oKtT56zEFSsYORUunkN2mWVQBc9WGP7yBAPOZW1XCXc= cloud.google.com/go/orgpolicy v1.14.1 h1:c1QLoM5v8/aDKgYVCUaC039lD3GPvqAhTVOwsGhIoZQ= cloud.google.com/go/orgpolicy v1.14.1/go.mod h1:1z08Hsu1mkoH839X7C8JmnrqOkp2IZRSxiDw7W/Xpg4= -cloud.google.com/go/osconfig v1.14.0 h1:7XGKH/O0PGIoPIIYc+Ja5WD5Sc1nK0y5DT7jvSfyJVc= -cloud.google.com/go/osconfig v1.14.0/go.mod h1:GhZzWYVrnQ42r+K5pA/hJCsnWVW2lB6bmVg+GnZ6JkM= cloud.google.com/go/osconfig v1.14.2 h1:iBN87PQc+EGh5QqijM3CuxcibvDWmF+9k0eOJT27FO4= cloud.google.com/go/osconfig v1.14.2/go.mod h1:kHtsm0/j8ubyuzGciBsRxFlbWVjc4c7KdrwJw0+g+pQ= -cloud.google.com/go/resourcemanager v1.10.0 h1:oqO6UInOJ1ZBBEYTKPJms2+FKdGmZEYAYBKyt0oqpEI= -cloud.google.com/go/resourcemanager v1.10.0/go.mod h1:kIx3TWDCjLnUQUdjQ/e8EXsS9GJEzvcY+YMOHpADxrk= cloud.google.com/go/resourcemanager v1.10.2 h1:LpqZZGM0uJiu1YWM878AA8zZ/qOQ/Ngno60Q8RAraAI= cloud.google.com/go/resourcemanager v1.10.2/go.mod h1:5f+4zTM/ZOTDm6MmPOp6BQAhR0fi8qFPnvVGSoWszcc= -cloud.google.com/go/serviceusage v1.9.0 h1:PzMnS5OLfmWiqg8u66AdcrebJMe/ddHFr6ZtF6Bn4B4= -cloud.google.com/go/serviceusage v1.9.0/go.mod h1:jMosZe6y8efGSDURsCxjXE8CemI5NWIRsqX4Vd6s5Ec= cloud.google.com/go/serviceusage v1.9.2 h1:ZFpN+dMFb3jGnjDhrNmIG+huQQm2AeA7rPwFfVhjLjw= cloud.google.com/go/serviceusage v1.9.2/go.mod h1:QdzhyAHZ+IJQBfPNuRnQwlv+Ll4TxYIiUC4zie82myo= -cloud.google.com/go/storage v1.43.0 h1:CcxnSohZwizt4LCzQHWvBf1/kvtHUn7gk9QERXPyXFs= -cloud.google.com/go/storage v1.43.0/go.mod h1:ajvxEa7WmZS1PxvKRq4bq0tFT3vMd502JwstCcYv0Q0= cloud.google.com/go/storage v1.47.0 h1:ajqgt30fnOMmLfWfu1PWcb+V9Dxz6n+9WKjdNg5R4HM= cloud.google.com/go/storage v1.47.0/go.mod h1:Ks0vP374w0PW6jOUameJbapbQKXqkjGd/OJRp2fb9IQ= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0 h1:nyQWyZvwGTvunIMxi1Y9uXkcyr+I7TeNrr/foo4Kpk8= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0/go.mod h1:l38EPgmsp71HHLq9j7De57JcKOWPyhrsW1Awm1JS6K0= +cloud.google.com/go/trace v1.11.2 h1:4ZmaBdL8Ng/ajrgKqY5jfvzqMXbrDcBsUGXOT9aqTtI= +cloud.google.com/go/trace v1.11.2/go.mod h1:bn7OwXd4pd5rFuAnTrzBuoZ4ax2XQeG3qNgYmfCy0Io= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.16.0 h1:JZg6HRh6W6U4OLl6lk7BZ7BLisIzM9dG1R50zUk9C/M= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.16.0/go.mod h1:YL1xnZ6QejvQHWJrX/AvhFl4WW4rqHVoKspWNVwFk0M= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 h1:tfLQ34V6F7tVSwoTf/4lH5sE0o6eCJuNDTmH09nDpbc= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0/go.mod h1:9kIvujWAA58nmPmWB1m23fyWic1kYZMxD9CxaWn4Qpg= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0 h1:B/dfvscEQtew9dVuoxqxrUKKv8Ih2f55PydknDamU+g= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0/go.mod h1:fiPSssYvltE08HJchL04dOy+RD4hgrjph0cwGGMntdI= +github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.0 h1:+m0M/LFxN43KvULkDNfdXOgrjtg6UYJPFBJyuEcRCAw= +github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.0/go.mod h1:PwOyop78lveYMRs6oCxjiVyBdyCgIYH6XHIVZO9/SFQ= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute v1.0.0 h1:/Di3vB4sNeQ+7A8efjUVENvyB945Wruvstucqp7ZArg= @@ -89,8 +61,8 @@ github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1. github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0/go.mod h1:5kakwfW5CjC9KK+Q4wjXAg+ShuIm2mBMua0ZFj2C8PE= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/subscription/armsubscription v1.2.0 h1:UrGzkHueDwAWDdjQxC+QaXHd4tVCkISYE9j7fSSXF8k= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/subscription/armsubscription v1.2.0/go.mod h1:qskvSQeW+cxEE2bcKYyKimB1/KiQ9xpJ99bcHY0BX6c= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 h1:XHOnouVk1mxXfQidrMEnLlPk9UMeRtyBTnEFtxkV0kU= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= +github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1 h1:WJTmL004Abzc5wDB5VtZG2PJk5ndYDgVacGqfirKxjM= +github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1/go.mod h1:tCcJZ0uHAmvjsVYzEFivsRTN00oz5BEsRgQHu5JZ9WE= github.com/AzureAD/microsoft-authentication-library-for-go v1.3.2 h1:kYRSnvJju5gYVyhkij+RTJ/VR6QIUaCfWeaFm2ycsjQ= github.com/AzureAD/microsoft-authentication-library-for-go v1.3.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= @@ -98,104 +70,50 @@ github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.25.0 github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.25.0/go.mod h1:obipzmGjfSjam60XLwGfqUkJsfiheAl+TUjG+4yzyPM= github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.49.0 h1:o90wcURuxekmXrtxmYWTyNla0+ZEHhud6DI1ZTxd1vI= github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.49.0/go.mod h1:6fTWu4m3jocfUZLYF5KsZC1TUfRvEjs7lM4crme/irw= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/cloudmock v0.49.0 h1:jJKWl98inONJAr/IZrdFQUWcwUO95DLY1XMD1ZIut+g= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/cloudmock v0.49.0/go.mod h1:l2fIqmwB+FKSfvn3bAD/0i+AXAxhIZjTK2svT/mgUXs= github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.49.0 h1:GYUJLfvd++4DMuMhCFLgLXvFwofIxh/qOwoGuS/LTew= github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.49.0/go.mod h1:wRbFgBQUVm1YXrvWKofAEmq9HNJTDphbAaJSSX01KUI= -github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0rYXWg0= -github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= -github.com/Masterminds/semver/v3 v3.3.1 h1:QtNSWtVZ3nBfk8mAOu/B6v7FMJ+NHTIgUPi7rj+4nv4= -github.com/Masterminds/semver/v3 v3.3.1/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= -github.com/aws/aws-cdk-go/awscdk/v2 v2.164.0 h1:K/gQyQbnJ026K8ItWLmztIrxOL7FPzitnq/63h6/MDc= -github.com/aws/aws-cdk-go/awscdk/v2 v2.164.0/go.mod h1:yYaymWYxyViLcsF3+rX8gq8MBkViop4q392HsOuAi9M= -github.com/aws/aws-cdk-go/awscdk/v2 v2.171.1 h1:tPZDN08YMdSFb2N0cwSUDzBJjareqCvPMx7XyDhewjc= -github.com/aws/aws-cdk-go/awscdk/v2 v2.171.1/go.mod h1:rBXrKmhrluYikJ2BNzOc9Ngs2F3W5gZYiiVsKiIoBZk= github.com/aws/aws-sdk-go v1.55.5 h1:KKUZBfBoyqy5d3swXyiC7Q76ic40rYcbqH7qjh59kzU= github.com/aws/aws-sdk-go v1.55.5/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU= -github.com/aws/aws-sdk-go-v2 v1.32.2 h1:AkNLZEyYMLnx/Q/mSKkcMqwNFXMAvFto9bNsHqcTduI= -github.com/aws/aws-sdk-go-v2 v1.32.2/go.mod h1:2SK5n0a2karNTv5tbP1SjsX0uhttou00v/HpXKM1ZUo= github.com/aws/aws-sdk-go-v2 v1.32.5 h1:U8vdWJuY7ruAkzaOdD7guwJjD06YSKmnKCJs7s3IkIo= github.com/aws/aws-sdk-go-v2 v1.32.5/go.mod h1:P5WJBrYqqbWVaOxgH0X/FYYD47/nooaPOZPlQdmiN2U= -github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.6 h1:pT3hpW0cOHRJx8Y0DfJUEQuqPild8jRGmSFmBgvydr0= -github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.6/go.mod h1:j/I2++U0xX+cr44QjHay4Cvxj6FUbnxrgmqN3H1jTZA= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.7 h1:lL7IfaFzngfx0ZwUGOZdsFFnQ5uLvR0hWqqhyE7Q9M8= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.7/go.mod h1:QraP0UcVlQJsmHfioCrveWOC1nbiWUl3ej08h4mXWoc= -github.com/aws/aws-sdk-go-v2/config v1.27.31 h1:kxBoRsjhT3pq0cKthgj6RU6bXTm/2SgdoUMyrVw0rAI= -github.com/aws/aws-sdk-go-v2/config v1.27.31/go.mod h1:z04nZdSWFPaDwK3DdJOG2r+scLQzMYuJeW0CujEm9FM= github.com/aws/aws-sdk-go-v2/config v1.28.5 h1:Za41twdCXbuyyWv9LndXxZZv3QhTG1DinqlFsSuvtI0= github.com/aws/aws-sdk-go-v2/config v1.28.5/go.mod h1:4VsPbHP8JdcdUDmbTVgNL/8w9SqOkM5jyY8ljIxLO3o= -github.com/aws/aws-sdk-go-v2/credentials v1.17.30 h1:aau/oYFtibVovr2rDt8FHlU17BTicFEMAi29V1U+L5Q= -github.com/aws/aws-sdk-go-v2/credentials v1.17.30/go.mod h1:BPJ/yXV92ZVq6G8uYvbU0gSl8q94UB63nMT5ctNO38g= github.com/aws/aws-sdk-go-v2/credentials v1.17.46 h1:AU7RcriIo2lXjUfHFnFKYsLCwgbz1E7Mm95ieIRDNUg= github.com/aws/aws-sdk-go-v2/credentials v1.17.46/go.mod h1:1FmYyLGL08KQXQ6mcTlifyFXfJVCNJTVGuQP4m0d/UA= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.12 h1:yjwoSyDZF8Jth+mUk5lSPJCkMC0lMy6FaCD51jm6ayE= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.12/go.mod h1:fuR57fAgMk7ot3WcNQfb6rSEn+SUffl7ri+aa8uKysI= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.20 h1:sDSXIrlsFSFJtWKLQS4PUWRvrT580rrnuLydJrCQ/yA= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.20/go.mod h1:WZ/c+w0ofps+/OUqMwWgnfrgzZH1DZO1RIkktICsqnY= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.21 h1:UAsR3xA31QGf79WzpG/ixT9FZvQlh5HY1NRqSHBNOCk= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.21/go.mod h1:JNr43NFf5L9YaG3eKTm7HQzls9J+A9YYcGI5Quh1r2Y= github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.24 h1:4usbeaes3yJnCFC7kfeyhkdkPtoRYPa/hTmCqMpKpLI= github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.24/go.mod h1:5CI1JemjVwde8m2WG3cz23qHKPOxbpkq0HaoreEgLIY= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.21 h1:6jZVETqmYCadGFvrYEQfC5fAQmlo80CeL5psbno6r0s= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.21/go.mod h1:1SR0GbLlnN3QUmYaflZNiH1ql+1qrSiB2vwcJ+4UM60= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.24 h1:N1zsICrQglfzaBnrfM0Ys00860C+QFwu6u/5+LomP+o= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.24/go.mod h1:dCn9HbJ8+K31i8IQ8EWmWj0EiIk0+vKiHNMxTTYveAg= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 h1:VaRN3TlFdd6KxX1x3ILT5ynH6HvKgqdiXoTxAF4HQcQ= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1/go.mod h1:FbtygfRFze9usAadmnGJNc8KsP346kEe+y2/oyhGAGc= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.21 h1:7edmS3VOBDhK00b/MwGtGglCm7hhwNYnjJs/PgFdMQE= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.21/go.mod h1:Q9o5h4HoIWG8XfzxqiuK/CGUbepCJ8uTlaE3bAbxytQ= github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.24 h1:JX70yGKLj25+lMC5Yyh8wBtvB01GDilyRuJvXJ4piD0= github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.24/go.mod h1:+Ln60j9SUTD0LEwnhEB0Xhg61DHqplBrbZpLgyjoEHg= -github.com/aws/aws-sdk-go-v2/service/cloudformation v1.55.3 h1:b7i7TR+aETt1NDTDVOmrlz2dPArKJsqDzMB2WuxAfK8= -github.com/aws/aws-sdk-go-v2/service/cloudformation v1.55.3/go.mod h1:C5vVI6+Bu1ZRLiKeO+dQPKYTg5kxD8IdmixnN1W/srI= -github.com/aws/aws-sdk-go-v2/service/cloudformation v1.56.0 h1:zmXJiEm/fQYtFDLIUsZrcPIjTrL3R/noFICGlYBj3Ww= -github.com/aws/aws-sdk-go-v2/service/cloudformation v1.56.0/go.mod h1:9nOjXCDKE+QMK4JaCrLl36PU+VEfJmI7WVehYmojO8s= -github.com/aws/aws-sdk-go-v2/service/ec2 v1.177.0 h1:LAdDRIj5BEZM9fLDTUWUyPzWvv5A++nCEps/RGmZNOo= -github.com/aws/aws-sdk-go-v2/service/ec2 v1.177.0/go.mod h1:ISODge3zgdwOEa4Ou6WM9PKbxJWJ15DYKnr2bfmCAIA= github.com/aws/aws-sdk-go-v2/service/ec2 v1.194.0 h1:56YXcRmryw9wiTrvdVeJEUwBCoN/+o33R52PA7CCi08= github.com/aws/aws-sdk-go-v2/service/ec2 v1.194.0/go.mod h1:mzj8EEjIHSN2oZRXiw1Dd+uB4HZTl7hC8nBzX9IZMWw= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.0 h1:TToQNkvGguu209puTojY/ozlqy2d/SFNcoLIqTFi42g= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.0/go.mod h1:0jp+ltwkf+SwG2fm/PKo8t4y8pJSgOCO4D8Lz3k0aHQ= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.1 h1:iXtILhvDxB6kPvEXgsDhGaZCSC6LQET5ZHSdJozeI0Y= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.1/go.mod h1:9nu0fVANtYiAePIBh2/pFUSwtJ402hLnp854CNoDOeE= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.4.2 h1:4FMHqLfk0efmTqhXVRL5xYRqlEBNBiRI7N6w4jsEdd4= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.4.2/go.mod h1:LWoqeWlK9OZeJxsROW2RqrSPvQHKTpp69r/iDjwsSaw= github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.4.5 h1:gvZOjQKPxFXy1ft3QnEyXmT+IqneM9QAUWlM3r0mfqw= github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.4.5/go.mod h1:DLWnfvIcm9IET/mmjdxeXbBKmTCm0ZB8p1za9BVteM8= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.2 h1:s7NA1SOw8q/5c0wr8477yOPp0z+uBaXBnLE0XYb0POA= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.2/go.mod h1:fnjjWyAW/Pj5HYOxl9LJqWtEwS7W2qgcRLWP+uWbss0= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.5 h1:wtpJ4zcwrSbwhECWQoI/g6WM9zqCcSpHDJIWSbMLOu4= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.5/go.mod h1:qu/W9HXQbbQ4+1+JcZp0ZNPV31ym537ZJN+fiS7Ti8E= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.2 h1:t7iUP9+4wdc5lt3E41huP+GvQZJD38WLsgVp4iOtAjg= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.2/go.mod h1:/niFCtmuQNxqx9v8WAPq5qh7EH25U4BF6tjoyq9bObM= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.5 h1:P1doBzv5VEg1ONxnJss1Kh5ZG/ewoIE4MQtKKc6Crgg= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.5/go.mod h1:NOP+euMW7W3Ukt28tAxPuoWao4rhhqJD3QEBk7oCg7w= -github.com/aws/aws-sdk-go-v2/service/s3 v1.66.0 h1:xA6XhTF7PE89BCNHJbQi8VvPzcgMtmGC5dr8S8N7lHk= -github.com/aws/aws-sdk-go-v2/service/s3 v1.66.0/go.mod h1:cB6oAuus7YXRZhWCc1wIwPywwZ1XwweNp2TVAEGYeB8= github.com/aws/aws-sdk-go-v2/service/s3 v1.69.0 h1:Q2ax8S21clKOnHhhr933xm3JxdJebql+R7aNo7p7GBQ= github.com/aws/aws-sdk-go-v2/service/s3 v1.69.0/go.mod h1:ralv4XawHjEMaHOWnTFushl0WRqim/gQWesAMF6hTow= -github.com/aws/aws-sdk-go-v2/service/ssm v1.55.2 h1:z6Pq4+jtKlhK4wWJGHRGwMLGjC1HZwAO3KJr/Na0tSU= -github.com/aws/aws-sdk-go-v2/service/ssm v1.55.2/go.mod h1:DSmu/VZzpQlAubWBbAvNpt+S4k/XweglJi4XaDGyvQk= github.com/aws/aws-sdk-go-v2/service/ssm v1.56.0 h1:mADKqoZaodipGgiZfuAjtlcr4IVBtXPZKVjkzUZCCYM= github.com/aws/aws-sdk-go-v2/service/ssm v1.56.0/go.mod h1:l9qF25TzH95FhcIak6e4vt79KE4I7M2Nf59eMUVjj6c= -github.com/aws/aws-sdk-go-v2/service/sso v1.22.5 h1:zCsFCKvbj25i7p1u94imVoO447I/sFv8qq+lGJhRN0c= -github.com/aws/aws-sdk-go-v2/service/sso v1.22.5/go.mod h1:ZeDX1SnKsVlejeuz41GiajjZpRSWR7/42q/EyA/QEiM= github.com/aws/aws-sdk-go-v2/service/sso v1.24.6 h1:3zu537oLmsPfDMyjnUS2g+F2vITgy5pB74tHI+JBNoM= github.com/aws/aws-sdk-go-v2/service/sso v1.24.6/go.mod h1:WJSZH2ZvepM6t6jwu4w/Z45Eoi75lPN7DcydSRtJg6Y= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.5 h1:SKvPgvdvmiTWoi0GAJ7AsJfOz3ngVkD/ERbs5pUnHNI= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.5/go.mod h1:20sz31hv/WsPa3HhU3hfrIet2kxM4Pe0r20eBZ20Tac= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.5 h1:K0OQAsDywb0ltlFrZm0JHPY3yZp/S9OaoLU33S7vPS8= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.5/go.mod h1:ORITg+fyuMoeiQFiVGoqB3OydVTLkClw/ljbblMq6Cc= -github.com/aws/aws-sdk-go-v2/service/sts v1.30.5 h1:OMsEmCyz2i89XwRwPouAJvhj81wINh+4UK+k/0Yo/q8= -github.com/aws/aws-sdk-go-v2/service/sts v1.30.5/go.mod h1:vmSqFK+BVIwVpDAGZB3CoCXHzurt4qBE8lf+I/kRTh0= github.com/aws/aws-sdk-go-v2/service/sts v1.33.1 h1:6SZUVRQNvExYlMLbHdlKB48x0fLbc2iVROyaNEwBHbU= github.com/aws/aws-sdk-go-v2/service/sts v1.33.1/go.mod h1:GqWyYCwLXnlUB1lOAXQyNSPqPLQJvmo8J0DWBzp9mtg= -github.com/aws/constructs-go/constructs/v10 v10.4.2 h1:+hDLTsFGLJmKIn0Dg20vWpKBrVnFrEWYgTEY5UiTEG8= -github.com/aws/constructs-go/constructs/v10 v10.4.2/go.mod h1:cXsNCKDV+9eR9zYYfwy6QuE4uPFp6jsq6TtH1MwBx9w= -github.com/aws/jsii-runtime-go v1.103.1 h1:7CwjdpiSrylOeuYP1LzHu2AJKV2K65P89nuOC/8Do7g= -github.com/aws/jsii-runtime-go v1.103.1/go.mod h1:PPR8BRc8cv9lDs5gDPe2SGG4+crOahE4SRrNHR1SvhA= -github.com/aws/jsii-runtime-go v1.105.0 h1:VZS3ZDL6byYkdjliGdGPC9zHpj+ExFac5fYxaJB0wf0= -github.com/aws/jsii-runtime-go v1.105.0/go.mod h1:IKYYzQN1pmtjpOmvY//htYGLs7x0F4Cqi0x93vix6sg= -github.com/aws/smithy-go v1.22.0 h1:uunKnWlcoL3zO7q+gG2Pk53joueEOsnNB28QdMsmiMM= -github.com/aws/smithy-go v1.22.0/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= github.com/aws/smithy-go v1.22.1 h1:/HPHZQ0g7f4eUeK6HKglFz8uwVfZKgoI25rb/J+dnro= github.com/aws/smithy-go v1.22.1/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= @@ -204,18 +122,6 @@ github.com/aymanbagabas/go-udiff v0.2.0 h1:TK0fH4MteXUDspT88n8CKzvK0X9O2xu9yQjWp github.com/aymanbagabas/go-udiff v0.2.0/go.mod h1:RE4Ex0qsGkTAJoQdQQCA0uG+nAzJO/pI/QwceO5fgrA= github.com/briandowns/spinner v1.23.1 h1:t5fDPmScwUjozhDj4FA46p5acZWIPXYE30qW2Ptu650= github.com/briandowns/spinner v1.23.1/go.mod h1:LaZeM4wm2Ywy6vO571mvhQNRcWfRUnXOs0RcKV0wYKM= -github.com/cdklabs/awscdk-asset-awscli-go/awscliv1/v2 v2.2.202 h1:VixXB9DnHN8oP7pXipq8GVFPjWCOdeNxIaS/ZyUwTkI= -github.com/cdklabs/awscdk-asset-awscli-go/awscliv1/v2 v2.2.202/go.mod h1:iPUti/SWjA3XAS3CpnLciFjS8TN9Y+8mdZgDfSgcyus= -github.com/cdklabs/awscdk-asset-awscli-go/awscliv1/v2 v2.2.213 h1:AhtxvgJPV5vSdps8SzD2KdWFob3IF2KTqQg4Xthsp/c= -github.com/cdklabs/awscdk-asset-awscli-go/awscliv1/v2 v2.2.213/go.mod h1:vA/XAXwlZjenRmyWSRYhtYz3DlTm/UoiZpedWC/LRMU= -github.com/cdklabs/awscdk-asset-kubectl-go/kubectlv20/v2 v2.1.2 h1:k+WD+6cERd59Mao84v0QtRrcdZuuSMfzlEmuIypKnVs= -github.com/cdklabs/awscdk-asset-kubectl-go/kubectlv20/v2 v2.1.2/go.mod h1:CvFHBo0qcg8LUkJqIxQtP1rD/sNGv9bX3L2vHT2FUAo= -github.com/cdklabs/awscdk-asset-kubectl-go/kubectlv20/v2 v2.1.3 h1:u63i5K09xASBNGEM0hpD2z0JwO+iNLVzG74VG85OjDo= -github.com/cdklabs/awscdk-asset-kubectl-go/kubectlv20/v2 v2.1.3/go.mod h1:0xP6iiSIKPKsShb6T2kadnTq61wL+kwmHTHnEjkFZFI= -github.com/cdklabs/awscdk-asset-node-proxy-agent-go/nodeproxyagentv6/v2 v2.1.0 h1:kElXjprC8wkpJu58vp+WFH6z0AJw4zitg5iSKJPKe3c= -github.com/cdklabs/awscdk-asset-node-proxy-agent-go/nodeproxyagentv6/v2 v2.1.0/go.mod h1:JY4UnvNa1YDGQ4H5wohXTHl6YVY3uCDUWl4JYUrQfb8= -github.com/cdklabs/cloud-assembly-schema-go/awscdkcloudassemblyschema/v38 v38.0.1 h1:EJ0N5jiEm1bet7Mu8IU5ccERvOpki10wI0zOhIQCO1U= -github.com/cdklabs/cloud-assembly-schema-go/awscdkcloudassemblyschema/v38 v38.0.1/go.mod h1:WMWAzkRBUPWJ5Ord1ZL2KOTdqByf01PoL5EV9K9PYKQ= github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= @@ -223,26 +129,16 @@ github.com/census-instrumentation/opencensus-proto v0.4.1 h1:iKLQ0xPNFxR/2hzXZMr github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/charmbracelet/bubbles v0.19.0 h1:gKZkKXPP6GlDk6EcfujDK19PCQqRjaJZQ7QRERx1UF0= -github.com/charmbracelet/bubbles v0.19.0/go.mod h1:WILteEqZ+krG5c3ntGEMeG99nCupcuIk7V0/zOP0tOA= github.com/charmbracelet/bubbles v0.20.0 h1:jSZu6qD8cRQ6k9OMfR1WlM+ruM8fkPWkHvQWD9LIutE= github.com/charmbracelet/bubbles v0.20.0/go.mod h1:39slydyswPy+uVOHZ5x/GjwVAFkCsV8IIVy+4MhzwwU= -github.com/charmbracelet/bubbletea v1.0.0 h1:BlNvkVed3DADQlV+W79eioNUOrnMUY25EEVdFUoDoGA= -github.com/charmbracelet/bubbletea v1.0.0/go.mod h1:xc4gm5yv+7tbniEvQ0naiG9P3fzYhk16cTgDZQQW6YE= github.com/charmbracelet/bubbletea v1.2.4 h1:KN8aCViA0eps9SCOThb2/XPIlea3ANJLUkv3KnQRNCE= github.com/charmbracelet/bubbletea v1.2.4/go.mod h1:Qr6fVQw+wX7JkWWkVyXYk/ZUQ92a6XNekLXa3rR18MM= -github.com/charmbracelet/lipgloss v0.13.0 h1:4X3PPeoWEDCMvzDvGmTajSyYPcZM4+y8sCA/SsA3cjw= -github.com/charmbracelet/lipgloss v0.13.0/go.mod h1:nw4zy0SBX/F/eAO1cWdcvy6qnkDUxr8Lw7dvFrAIbbY= github.com/charmbracelet/lipgloss v1.0.0 h1:O7VkGDvqEdGi93X+DeqsQ7PKHDgtQfF8j8/O2qFMQNg= github.com/charmbracelet/lipgloss v1.0.0/go.mod h1:U5fy9Z+C38obMs+T+tJqst9VGzlOYGj4ri9reL3qUlo= -github.com/charmbracelet/x/ansi v0.2.3 h1:VfFN0NUpcjBRd4DnKfRaIRo53KRgey/nhOoEqosGDEY= -github.com/charmbracelet/x/ansi v0.2.3/go.mod h1:dk73KoMTT5AX5BsX0KrqhsTqAnhZZoCBjs7dGWp4Ktw= github.com/charmbracelet/x/ansi v0.5.2 h1:dEa1x2qdOZXD/6439s+wF7xjV+kZLu/iN00GuXXrU9E= github.com/charmbracelet/x/ansi v0.5.2/go.mod h1:KBUFw1la39nl0dLl10l5ORDAqGXaeurTQmwyyVKse/Q= github.com/charmbracelet/x/exp/golden v0.0.0-20240815200342-61de596daa2b h1:MnAMdlwSltxJyULnrYbkZpp4k58Co7Tah3ciKhSNo0Q= github.com/charmbracelet/x/exp/golden v0.0.0-20240815200342-61de596daa2b/go.mod h1:wDlXFlCrmJ8J+swcL/MnGUuYnqgQdW9rhSD61oNMb6U= -github.com/charmbracelet/x/term v0.2.0 h1:cNB9Ot9q8I711MyZ7myUR5HFWL/lc3OpU8jZ4hwm0x0= -github.com/charmbracelet/x/term v0.2.0/go.mod h1:GVxgxAbjUrmpvIINHIQnJJKpMlHiZ4cktEQCN6GWyF0= github.com/charmbracelet/x/term v0.2.1 h1:AQeHeLZ1OqSXhrAWpYUtZyX1T3zVxfpZuEQMIQaGIAQ= github.com/charmbracelet/x/term v0.2.1/go.mod h1:oQ4enTYFV7QN4m0i9mzHrViD7TQKvNEEkHUMCmsxdUg= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= @@ -254,6 +150,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= +github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -264,16 +162,12 @@ github.com/envoyproxy/protoc-gen-validate v1.1.0 h1:tntQDh69XqOCOZsDz0lVJQez/2L6 github.com/envoyproxy/protoc-gen-validate v1.1.0/go.mod h1:sXRDRVmzEbkM7CVcM06s9shE/m23dg3wzjl0UWqJ2q4= github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f h1:Y/CXytFA4m6baUTXGLOoWe4PQhGxaX0KpnayAqC48p4= github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f/go.mod h1:vw97MGsxSvLiUE2X8qFplwetxpGLQrlU1Q9AUEIzCaM= -github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4= -github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI= github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= -github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= -github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= @@ -319,12 +213,8 @@ github.com/google/s2a-go v0.1.8/go.mod h1:6iNWHTpQ+nfNRN5E00MSdfDwVesa8hhS32PhPO github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/enterprise-certificate-proxy v0.3.3 h1:QRje2j5GZimBzlbhGA2V2QlGNgL8G6e+wGo/+/2bWI0= -github.com/googleapis/enterprise-certificate-proxy v0.3.3/go.mod h1:YKe7cfqYXjKGpGvmSg28/fFvhNzinZQm8DGnaburhGA= github.com/googleapis/enterprise-certificate-proxy v0.3.4 h1:XYIDZApgAnrN1c855gTgghdIA6Stxb52D5RnLI1SLyw= github.com/googleapis/enterprise-certificate-proxy v0.3.4/go.mod h1:YKe7cfqYXjKGpGvmSg28/fFvhNzinZQm8DGnaburhGA= -github.com/googleapis/gax-go/v2 v2.13.0 h1:yitjD5f7jQHhyDsnhKEBU52NdvvdSeGzlAnDPT0hH1s= -github.com/googleapis/gax-go/v2 v2.13.0/go.mod h1:Z/fvTZXF8/uw7Xu5GuslPw+bplx6SS338j1Is2S+B7A= github.com/googleapis/gax-go/v2 v2.14.0 h1:f+jMrjBPl+DL9nI4IQzLUxMq7XrAqFYB7hBPqMNIe8o= github.com/googleapis/gax-go/v2 v2.14.0/go.mod h1:lhBCnjdLrWRaPvLWhmc8IS24m9mr07qSYnHncrgo+zk= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= @@ -337,6 +227,8 @@ github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGw github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= +github.com/keybase/go-keychain v0.0.0-20231219164618-57a3676c3af6 h1:IsMZxCuZqKuao2vNdfD82fjjgPLfyHLpR41Z88viRWs= +github.com/keybase/go-keychain v0.0.0-20231219164618-57a3676c3af6/go.mod h1:3VeWNIJaW+O5xpRQbPp0Ybqu1vJd/pm7s2F473HRrkw= github.com/kr/fs v0.1.0 h1:Jskdu9ieNAYnjxsi0LbQp1ulIKZV1LAFgK1tWhpZgl8= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= @@ -387,6 +279,8 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/redis/go-redis/v9 v9.6.1 h1:HHDteefn6ZkTtY5fGUE8tj8uy85AHk6zP7CpzIAM0y4= +github.com/redis/go-redis/v9 v9.6.1/go.mod h1:0C0c6ycQsdpVNQpxb1njEQIqkx5UcsM8FJCQLgE9+RA= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= @@ -417,44 +311,29 @@ github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= -github.com/yuin/goldmark v1.4.13 h1:fVcFKWvrslecOb/tg+Cc05dkeYx540o0FuFt3nUVDoE= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/yuin/goldmark v1.7.8 h1:iERMLn0/QJeHFhxSt3p6PeN9mGnvIKSpG9YYorDMnic= -github.com/yuin/goldmark v1.7.8/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.opentelemetry.io/contrib/detectors/gcp v1.32.0 h1:P78qWqkLSShicHmAzfECaTgvslqHxblNE9j62Ws1NK8= go.opentelemetry.io/contrib/detectors/gcp v1.32.0/go.mod h1:TVqo0Sda4Cv8gCIixd7LuLwW4EylumVWfhjZJjDD4DU= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.52.0 h1:vS1Ao/R55RNV4O7TA2Qopok8yN+X0LIP6RVWLFkprck= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.52.0/go.mod h1:BMsdeOxN04K0L5FNUBfjFdvwWGNe/rkmSwH4Aelu/X0= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.57.0 h1:qtFISDHKolvIxzSs0gIaiPUPR0Cucb0F2coHC7ZLdps= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.57.0/go.mod h1:Y+Pop1Q6hCOnETWTW4NROK/q1hv50hM7yDaUTjG8lp8= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 h1:TT4fX+nBOA/+LUkobKGW1ydGcn+G3vRw9+g5HwCphpk= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0/go.mod h1:L7UH0GbB0p47T4Rri3uHjbpCFYrVrwc1I25QhNPiGK8= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.57.0 h1:DheMAlT6POBP+gh8RUH19EOTnQIor5QE0uSRPtzCpSw= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.57.0/go.mod h1:wZcGmeVO9nzP67aYSLDqXNWK87EZWhi7JWj1v7ZXf94= -go.opentelemetry.io/otel v1.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw= -go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8= go.opentelemetry.io/otel v1.32.0 h1:WnBN+Xjcteh0zdk01SVqV55d/m62NJLJdIyb4y/WO5U= go.opentelemetry.io/otel v1.32.0/go.mod h1:00DCVSB0RQcnzlwyTfqtxSm+DRr9hpYrHjNGiBHVQIg= -go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc= -go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.29.0 h1:WDdP9acbMYjbKIyJUhTvtzj601sVJOqgWdUxSdR/Ysc= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.29.0/go.mod h1:BLbf7zbNIONBLPwvFnwNHGj4zge8uTCM/UPIVW1Mq2I= go.opentelemetry.io/otel/metric v1.32.0 h1:xV2umtmNcThh2/a/aCP+h64Xx5wsj8qqnkYZktzNa0M= go.opentelemetry.io/otel/metric v1.32.0/go.mod h1:jH7CIbbK6SH2V2wE16W05BHCtIDzauciCRLoc/SyMv8= -go.opentelemetry.io/otel/sdk v1.28.0 h1:b9d7hIry8yZsgtbmM0DKyPWMMUMlK9NEKuIG4aBqWyE= -go.opentelemetry.io/otel/sdk v1.28.0/go.mod h1:oYj7ClPUA7Iw3m+r7GeEjz0qckQRJK2B8zjcZEfu7Pg= go.opentelemetry.io/otel/sdk v1.32.0 h1:RNxepc9vK59A8XsgZQouW8ue8Gkb4jpWtJm9ge5lEG4= go.opentelemetry.io/otel/sdk v1.32.0/go.mod h1:LqgegDBjKMmb2GC6/PrTnteJG39I8/vJCAP9LlJXEjU= go.opentelemetry.io/otel/sdk/metric v1.32.0 h1:rZvFnvmvawYb0alrYkjraqJq0Z4ZUJAiyYCU9snn1CU= go.opentelemetry.io/otel/sdk/metric v1.32.0/go.mod h1:PWeZlq0zt9YkYAp3gjKZ0eicRYvOh1Gd+X99x6GHpCQ= -go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4= -go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= go.opentelemetry.io/otel/trace v1.32.0 h1:WIC9mYrXf8TmY/EXuULKc8hR17vE+Hjv2cssQDe03fM= go.opentelemetry.io/otel/trace v1.32.0/go.mod h1:+i4rkvCraA+tG6AzwloGaCtkx53Fa+L+V8e9a7YvhT8= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= @@ -464,33 +343,19 @@ go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN8 go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= -golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= -golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ= golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 h1:kx6Ds3MlpiUHKj7syVnbp57++8WpuKPcR5yjLBjvLEA= -golang.org/x/exp v0.0.0-20240823005443-9b4947da3948/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ= golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20241112194109-818c5a804067 h1:adDmSQyFTCiv19j015EGKJBoaa7ElV0Q1Wovb/4G7NA= -golang.org/x/lint v0.0.0-20241112194109-818c5a804067/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= -golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4= -golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -502,13 +367,9 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= -golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.22.0 h1:BzDx2FehcG7jJwgWLELCdmLuxk2i+x9UDpSiss2u0ZA= -golang.org/x/oauth2 v0.22.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/oauth2 v0.24.0 h1:KTBBxWqUa0ykRPLtV69rRto9TLXcqYkeswu48x/gvNE= golang.org/x/oauth2 v0.24.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -516,8 +377,6 @@ golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= -golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ= golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -535,8 +394,6 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -544,8 +401,6 @@ golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuX golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= -golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU= -golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= golang.org/x/term v0.26.0 h1:WEQa6V3Gja/BhNxg540hBip/kkaYtRg3cxg4oXSw4AU= golang.org/x/term v0.26.0/go.mod h1:Si5m1o57C5nBNQo5z1iq+XDijt21BDBDp2bK0QI8e3E= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -554,12 +409,8 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= -golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= -golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U= -golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/time v0.8.0 h1:9i3RxcPv3PZnitoVGMPDKZSq1xW1gK1Xy3ArNOGZfEg= golang.org/x/time v0.8.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -568,18 +419,12 @@ golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3 golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= -golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= golang.org/x/tools v0.27.0 h1:qEKojBykQkQ4EynWy4S8Weg69NumxKdn40Fce3uc/8o= golang.org/x/tools v0.27.0/go.mod h1:sUi0ZgbwW9ZPAq26Ekut+weQPR5eIM6GQLQ1Yjm1H0Q= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.195.0 h1:Ude4N8FvTKnnQJHU48RFI40jOBgIrL8Zqr3/QeST6yU= -google.golang.org/api v0.195.0/go.mod h1:DOGRWuv3P8TU8Lnz7uQc4hyNqrBpMtD9ppW3wBJurgc= google.golang.org/api v0.209.0 h1:Ja2OXNlyRlWCWu8o+GgI4yUn/wz9h/5ZfFbKz+dQX+w= google.golang.org/api v0.209.0/go.mod h1:I53S168Yr/PNDNMi5yPnDc0/LGRZO6o7PoEbl/HY3CM= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= @@ -587,16 +432,10 @@ google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20240827150818-7e3bb234dfed h1:4C4dbrVFtfIp3GXJdMX1Sj25mahfn5DywOo65/2ISQ8= -google.golang.org/genproto v0.0.0-20240827150818-7e3bb234dfed/go.mod h1:ICjniACoWvcDz8c8bOsHVKuuSGDJy1z5M4G0DM3HzTc= google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 h1:ToEetK57OidYuqD4Q5w+vfEnPvPpuTwedCNVohYJfNk= google.golang.org/genproto v0.0.0-20241118233622-e639e219e697/go.mod h1:JJrvXBWRZaFMxBufik1a4RpFw4HhgVtBBWQeQgUj2cc= -google.golang.org/genproto/googleapis/api v0.0.0-20240823204242-4ba0660f739c h1:e0zB268kOca6FbuJkYUGxfwG4DKFZG/8DLyv9Zv66cE= -google.golang.org/genproto/googleapis/api v0.0.0-20240823204242-4ba0660f739c/go.mod h1:fO8wJzT2zbQbAjbIoos1285VfEIYKDDY+Dt+WpTkh6g= google.golang.org/genproto/googleapis/api v0.0.0-20241118233622-e639e219e697 h1:pgr/4QbFyktUv9CtQ/Fq4gzEE6/Xs7iCXbktaGzLHbQ= google.golang.org/genproto/googleapis/api v0.0.0-20241118233622-e639e219e697/go.mod h1:+D9ySVjN8nY8YCVjc5O7PZDIdZporIDY3KaGfJunh88= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240827150818-7e3bb234dfed h1:J6izYgfBXAI3xTKLgxzTmUltdYaLsuBxFCgDHWJ/eXg= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240827150818-7e3bb234dfed/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= google.golang.org/genproto/googleapis/rpc v0.0.0-20241118233622-e639e219e697 h1:LWZqQOEjDyONlF1H6afSWpAL/znlREo2tHfLoe+8LMA= google.golang.org/genproto/googleapis/rpc v0.0.0-20241118233622-e639e219e697/go.mod h1:5uTbfoYQed2U9p3KIj2/Zzm02PYhndfdmML0qC3q3FU= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= @@ -604,8 +443,6 @@ google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= -google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= google.golang.org/grpc v1.68.0 h1:aHQeeJbo8zAkAa3pRzrVjZlbz6uSfeOXlJNQM0RAbz0= google.golang.org/grpc v1.68.0/go.mod h1:fmSPC5AsjSBCK54MyHRx48kpOti1/jRfOlwEWywNjWA= google.golang.org/grpc/stats/opentelemetry v0.0.0-20241028142157-ada6787961b3 h1:hUfOButuEtpc0UvYiaYRbNwxVYr0mQQOWq6X8beJ9Gc= @@ -619,8 +456,6 @@ google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= -google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= google.golang.org/protobuf v1.35.2 h1:8Ar7bF+apOIoThw1EdZl0p1oWvMqTHmpA2fRTyZO8io= google.golang.org/protobuf v1.35.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/internal/clouds/aws/aws_data.yaml b/internal/clouds/aws/aws_data.yaml index 33408643..c538f3fb 100644 --- a/internal/clouds/aws/aws_data.yaml +++ b/internal/clouds/aws/aws_data.yaml @@ -1,10266 +1,10248 @@ locations: ap-northeast-1: - - u-9tb1.112xlarge - - u-12tb1.112xlarge - - u-6tb1.112xlarge - - u-6tb1.56xlarge - - u-3tb1.56xlarge - - c6a.48xlarge - - m6a.48xlarge - - r7a.metal-48xl - - m7a.48xlarge - - m6a.metal - - c7i.metal-48xl - - c7a.48xlarge - - g5.48xlarge - - c6a.metal - - r7i.metal-48xl - - m7i.metal-48xl - - c7a.metal-48xl - - m7i.48xlarge - - inf2.48xlarge - - g6.48xlarge - - r7i.48xlarge - - r7a.48xlarge - - c7i.48xlarge - - r6a.48xlarge - - m7a.metal-48xl - - r6a.metal - - i4i.metal - - r6in.metal - - r6id.metal - - r6in.32xlarge - - c6i.metal - - c6in.32xlarge - - x2idn.32xlarge - - m7a.32xlarge - - m6in.32xlarge - - r7iz.32xlarge - - x1e.32xlarge - - c6in.metal - - r6idn.metal - - r6i.32xlarge - - m6i.metal - - m6a.32xlarge - - r7iz.metal-32xl - - r6id.32xlarge - - x1.32xlarge - - c6i.32xlarge - - m6id.32xlarge - - c6id.metal - - x2idn.metal - - i4i.32xlarge - - m6in.metal - - c7a.32xlarge - - c6a.32xlarge - - m6idn.metal - - m6idn.32xlarge - - m6i.32xlarge - - r6idn.32xlarge - - r6i.metal - - x2iedn.metal - - m6id.metal - - r7a.32xlarge - - x2iedn.32xlarge - - c6id.32xlarge - - r6a.32xlarge - - g6.24xlarge - - r6idn.24xlarge - - r5dn.24xlarge - - m5d.24xlarge - - p3dn.24xlarge - - g5.24xlarge - - i3en.24xlarge - - r5b.metal - - r6i.24xlarge - - r6in.24xlarge - - m5a.24xlarge - - r5n.24xlarge - - inf2.24xlarge - - r6id.24xlarge - - m6id.24xlarge - - r7i.24xlarge - - m5.metal - - m5d.metal - - x2iedn.24xlarge - - m5dn.metal - - r5n.metal - - r5b.24xlarge - - c7a.24xlarge - - vt1.24xlarge - - r5.metal - - m5n.metal - - c6in.24xlarge - - c5d.metal - - m5ad.24xlarge - - c5d.24xlarge - - i3en.metal - - m5n.24xlarge - - inf1.24xlarge - - r5dn.metal - - r5.24xlarge - - m7i.metal-24xl - - g4dn.metal - - c6a.24xlarge - - c7i.metal-24xl - - p4d.24xlarge - - c5.metal - - m7a.24xlarge - - m5.24xlarge - - r5d.24xlarge - - c6i.24xlarge - - c5.24xlarge - - m6idn.24xlarge - - i4i.24xlarge - - m5dn.24xlarge - - r6a.24xlarge - - m7i.24xlarge - - r5a.24xlarge - - c5a.24xlarge - - x2idn.24xlarge - - r7a.24xlarge - - r5d.metal - - m6in.24xlarge - - r7i.metal-24xl - - m6a.24xlarge - - m6i.24xlarge - - c7i.24xlarge - - r5ad.24xlarge - - c6id.24xlarge - - c5d.18xlarge - - c5n.18xlarge - - c5n.metal - - i3.metal - - c5.18xlarge - - m6a.16xlarge - - m6gd.16xlarge - - c7g.16xlarge - - c6gd.16xlarge - - c6g.metal - - p3.16xlarge - - x1.16xlarge - - m6g.metal - - i3.16xlarge - - m4.16xlarge - - r7iz.16xlarge - - c7gd.16xlarge - - r5b.16xlarge - - c7gn.metal - - r6in.16xlarge - - r6g.16xlarge - - x1e.16xlarge - - c7gn.16xlarge - - c6id.16xlarge - - m7gd.16xlarge - - m6id.16xlarge - - m7g.16xlarge - - r7gd.metal - - r7i.16xlarge - - r5dn.16xlarge - - im4gn.16xlarge - - c7gd.metal - - c6g.16xlarge - - m6in.16xlarge - - m5dn.16xlarge - - hpc7g.16xlarge - - m5d.16xlarge - - g4ad.16xlarge - - x2iedn.16xlarge - - r7g.metal - - m5.16xlarge - - m7a.16xlarge - - r5a.16xlarge - - g5g.metal - - r6a.16xlarge - - g6.16xlarge - - r5.16xlarge - - g5.16xlarge - - g4dn.16xlarge - - r6i.16xlarge - - i4i.16xlarge - - m5n.16xlarge - - m7i.16xlarge - - g3.16xlarge - - r7a.16xlarge - - c7i.16xlarge - - c6gn.16xlarge - - p2.16xlarge - - r6id.16xlarge - - r5d.16xlarge - - r6gd.16xlarge - - r4.16xlarge - - m5a.16xlarge - - m7g.metal - - r7gd.16xlarge - - r5ad.16xlarge - - m5ad.16xlarge - - m6g.16xlarge - - c7g.metal - - g5g.16xlarge - - m6idn.16xlarge - - r5n.16xlarge - - r7g.16xlarge - - m6gd.metal - - c6i.16xlarge - - c6gd.metal - - x2idn.16xlarge - - c7a.16xlarge - - c6in.16xlarge - - r6idn.16xlarge - - c5a.16xlarge - - r7iz.metal-16xl - - r6g.metal - - c6a.16xlarge - - m6i.16xlarge - - m7gd.metal - - r6gd.metal - - r5ad.12xlarge - - m5a.12xlarge - - c6g.12xlarge - - m5dn.12xlarge - - r5.12xlarge - - r7a.12xlarge - - c5a.12xlarge - - c7gn.12xlarge - - c7gd.12xlarge - - m6g.12xlarge - - m7i.12xlarge - - r5dn.12xlarge - - z1d.metal - - m7g.12xlarge - - c7g.12xlarge - - m6gd.12xlarge - - r5n.12xlarge - - r5b.12xlarge - - r6i.12xlarge - - r6g.12xlarge - - r7iz.12xlarge - - c6id.12xlarge - - g6.12xlarge - - m5zn.metal - - c7a.12xlarge - - g4dn.12xlarge - - c5.12xlarge - - r6gd.12xlarge - - m7a.12xlarge - - r7g.12xlarge - - z1d.12xlarge - - m5ad.12xlarge - - r6id.12xlarge - - i3en.12xlarge - - m5n.12xlarge - - c6i.12xlarge - - m6idn.12xlarge - - r7i.12xlarge - - m6in.12xlarge - - r6idn.12xlarge - - c5d.12xlarge - - r5d.12xlarge - - m7gd.12xlarge - - c6in.12xlarge - - i4i.12xlarge - - x2iezn.metal - - m5.12xlarge - - m6id.12xlarge - - r6in.12xlarge - - r7gd.12xlarge - - c6gd.12xlarge - - r5a.12xlarge - - c6a.12xlarge - - x2iezn.12xlarge - - g5.12xlarge - - r6a.12xlarge - - m5d.12xlarge - - m6i.12xlarge - - c7i.12xlarge - - m5zn.12xlarge - - m6a.12xlarge - - c6gn.12xlarge - - d3en.12xlarge - - m4.10xlarge - - d2.8xlarge - - c5n.9xlarge - - c4.8xlarge - - c5.9xlarge - - c5d.9xlarge - - r5ad.8xlarge - - inf2.8xlarge - - is4gen.8xlarge - - r5d.8xlarge - - m7a.8xlarge - - m5d.8xlarge - - c7gd.8xlarge - - r7i.8xlarge - - m5a.8xlarge - - r6gd.8xlarge - - c6in.8xlarge - - m5n.8xlarge - - r7g.8xlarge - - r5dn.8xlarge - - c6gd.8xlarge - - i4i.8xlarge - - r7gd.8xlarge - - c7a.8xlarge - - r3.8xlarge - - g4dn.8xlarge - - m7i.8xlarge - - im4gn.8xlarge - - r6g.8xlarge - - r6in.8xlarge - - hpc7g.8xlarge - - x1e.8xlarge - - r6i.8xlarge - - g5g.8xlarge - - i3.8xlarge - - d3en.8xlarge - - m6id.8xlarge - - c7i-flex.8xlarge - - m5.8xlarge - - m7i-flex.8xlarge - - r6a.8xlarge - - c6a.8xlarge - - p2.8xlarge - - r7a.8xlarge - - c7i.8xlarge - - x2iezn.8xlarge - - c7gn.8xlarge - - c5a.8xlarge - - c6g.8xlarge - - r5.8xlarge - - r6idn.8xlarge - - g6.8xlarge - - m7gd.8xlarge - - c7g.8xlarge - - m5ad.8xlarge - - r5b.8xlarge - - g4ad.8xlarge - - c6i.8xlarge - - m7g.8xlarge - - gr6.8xlarge - - r4.8xlarge - - m6a.8xlarge - - x2iedn.8xlarge - - c3.8xlarge - - m6g.8xlarge - - p3.8xlarge - - m5dn.8xlarge - - g5.8xlarge - - m6in.8xlarge - - c6gn.8xlarge - - r5a.8xlarge - - c6id.8xlarge - - r7iz.8xlarge - - m6idn.8xlarge - - r6id.8xlarge - - i2.8xlarge - - m6gd.8xlarge - - d3.8xlarge - - m6i.8xlarge - - g3.8xlarge - - r5n.8xlarge - - z1d.6xlarge - - i3en.6xlarge - - m5zn.6xlarge - - d3en.6xlarge - - vt1.6xlarge - - x2iezn.6xlarge - - inf1.6xlarge - - c7g.4xlarge - - r5dn.4xlarge - - r6i.4xlarge - - c4.4xlarge - - i3.4xlarge - - m7g.4xlarge - - r5.4xlarge - - gr6.4xlarge - - m6a.4xlarge - - c5d.4xlarge - - im4gn.4xlarge - - c7gn.4xlarge - - m7i.4xlarge - - c3.4xlarge - - m5n.4xlarge - - x1e.4xlarge - - m6in.4xlarge - - c7i.4xlarge - - m5a.4xlarge - - r6g.4xlarge - - r6gd.4xlarge - - m6g.4xlarge - - c7i-flex.4xlarge - - r7gd.4xlarge - - g3.4xlarge - - g5.4xlarge - - d2.4xlarge - - m6idn.4xlarge - - r6idn.4xlarge - - r5b.4xlarge - - c5n.4xlarge - - r3.4xlarge - - r5n.4xlarge - - c6in.4xlarge - - c7a.4xlarge - - m5dn.4xlarge - - g4ad.4xlarge - - c7gd.4xlarge - - g4dn.4xlarge - - c5.4xlarge - - d3.4xlarge - - i4i.4xlarge - - g6.4xlarge - - m4.4xlarge - - c6id.4xlarge - - m5.4xlarge - - d3en.4xlarge - - r4.4xlarge - - m6i.4xlarge - - m5ad.4xlarge - - m7gd.4xlarge - - is4gen.4xlarge - - m6gd.4xlarge - - r5ad.4xlarge - - c6a.4xlarge - - m5d.4xlarge - - a1.4xlarge - - hpc7g.4xlarge - - m6id.4xlarge - - r6id.4xlarge - - x2iedn.4xlarge - - r7a.4xlarge - - c6g.4xlarge - - c6gd.4xlarge - - r5a.4xlarge - - g5g.4xlarge - - a1.metal - - r6a.4xlarge - - c6i.4xlarge - - r7i.4xlarge - - x2iezn.4xlarge - - r7iz.4xlarge - - r5d.4xlarge - - r7g.4xlarge - - i2.4xlarge - - m7i-flex.4xlarge - - r6in.4xlarge - - c6gn.4xlarge - - m7a.4xlarge - - c5a.4xlarge - - i3en.3xlarge - - z1d.3xlarge - - vt1.3xlarge - - mac1.metal - - m5zn.3xlarge - - c6a.2xlarge - - c6gd.2xlarge - - r6in.2xlarge - - a1.2xlarge - - x1e.2xlarge - - m5dn.2xlarge - - g6.2xlarge - - m6idn.2xlarge - - t2.2xlarge - - m6a.2xlarge - - t4g.2xlarge - - z1d.2xlarge - - m6g.2xlarge - - r5ad.2xlarge - - c7a.2xlarge - - g5.2xlarge - - g4dn.2xlarge - - m6i.2xlarge - - r6g.2xlarge - - m6in.2xlarge - - m7gd.2xlarge - - i4i.2xlarge - - m5a.2xlarge - - im4gn.2xlarge - - d2.2xlarge - - m3.2xlarge - - c6id.2xlarge - - c7gn.2xlarge - - c6g.2xlarge - - r5d.2xlarge - - m4.2xlarge - - m6id.2xlarge - - c5a.2xlarge - - c6i.2xlarge - - c1.xlarge - - g4ad.2xlarge - - c7i-flex.2xlarge - - inf1.2xlarge - - r6a.2xlarge - - t3a.2xlarge - - r7i.2xlarge - - r4.2xlarge - - m5zn.2xlarge - - c4.2xlarge - - r3.2xlarge - - r5b.2xlarge - - r7a.2xlarge - - is4gen.2xlarge - - m7i.2xlarge - - c7gd.2xlarge - - c7i.2xlarge - - i2.2xlarge - - p3.2xlarge - - m6gd.2xlarge - - r6i.2xlarge - - d3.2xlarge - - x2iedn.2xlarge - - m5d.2xlarge - - t3.2xlarge - - d3en.2xlarge - - i3.2xlarge - - r6gd.2xlarge - - c5.2xlarge - - r6id.2xlarge - - g5g.2xlarge - - r5a.2xlarge - - r5n.2xlarge - - m7i-flex.2xlarge - - r6idn.2xlarge - - x2iezn.2xlarge - - m7g.2xlarge - - c7g.2xlarge - - r5.2xlarge - - c3.2xlarge - - i3en.2xlarge - - c6gn.2xlarge - - m7a.2xlarge - - c5n.2xlarge - - r5dn.2xlarge - - r7gd.2xlarge - - m5n.2xlarge - - m2.4xlarge - - m5.2xlarge - - r7iz.2xlarge - - r7g.2xlarge - - c6in.2xlarge - - m5ad.2xlarge - - c5d.2xlarge - - m5.xlarge - - d2.xlarge - - c7g.xlarge - - x1e.xlarge - - r6i.xlarge - - t3a.xlarge - - m2.2xlarge - - c7gn.xlarge - - x2iedn.xlarge - - t4g.xlarge - - r7g.xlarge - - g4ad.xlarge - - d3en.xlarge - - inf1.xlarge - - im4gn.xlarge - - c6gn.xlarge - - a1.xlarge - - z1d.xlarge - - m3.xlarge - - g5g.xlarge - - i3.xlarge - - m6g.xlarge - - c6i.xlarge - - m6i.xlarge - - t2.xlarge - - r6gd.xlarge - - c4.xlarge - - is4gen.xlarge - - r5ad.xlarge - - c5.xlarge - - r5b.xlarge - - m7g.xlarge - - m5d.xlarge - - m6idn.xlarge - - m6gd.xlarge - - r6g.xlarge - - m6a.xlarge - - c6gd.xlarge - - r4.xlarge - - c7i.xlarge - - m5zn.xlarge - - m5ad.xlarge - - m7a.xlarge - - r6id.xlarge - - m7i.xlarge - - m7i-flex.xlarge - - inf2.xlarge - - c7gd.xlarge - - m6id.xlarge - - c6in.xlarge - - r5d.xlarge - - r3.xlarge - - c6g.xlarge - - c5d.xlarge - - m4.xlarge - - c7i-flex.xlarge - - r5n.xlarge - - m5dn.xlarge - - m1.xlarge - - r5dn.xlarge - - r5.xlarge - - r6a.xlarge - - i4i.xlarge - - c5a.xlarge - - g5.xlarge - - g3s.xlarge - - r7gd.xlarge - - t3.xlarge - - i3en.xlarge - - r6idn.xlarge - - r7a.xlarge - - g6.xlarge - - m5n.xlarge - - p2.xlarge - - c3.xlarge - - m6in.xlarge - - r6in.xlarge - - d3.xlarge - - r7iz.xlarge - - c5n.xlarge - - c6a.xlarge - - r7i.xlarge - - m7gd.xlarge - - i2.xlarge - - g4dn.xlarge - - c7a.xlarge - - c6id.xlarge - - m5a.xlarge - - r5a.xlarge - - t3a.nano - - r6gd.large - - m5a.large - - i3.large - - c4.large - - t4g.micro - - c6gd.large - - m4.large - - t3a.small - - m7g.large - - m1.large - - r6in.large - - t3.nano - - m7a.large - - m6id.large - - i3en.large - - t4g.large - - m2.xlarge - - c5.large - - r7g.large - - c6gn.large - - t3.small - - t4g.small - - m3.large - - m6gd.large - - im4gn.large - - m5ad.large - - c5n.large - - c7a.large - - r6g.large - - t4g.nano - - c7g.large - - m6in.large - - c7gd.large - - r7iz.large - - r5a.large - - r5dn.large - - r4.large - - a1.large - - m5.large - - c6g.large - - t3.medium - - m7i.large - - c7i-flex.large - - r7a.large - - c7gn.large - - r7i.large - - r6id.large - - r5.large - - i4i.large - - c3.large - - m5dn.large - - r6a.large - - t3.micro - - r5ad.large - - m6g.large - - m7gd.large - - c6i.large - - r6idn.large - - c6in.large - - c5d.large - - t4g.medium - - is4gen.large - - t2.medium - - r7gd.large - - m5n.large - - t2.large - - t3a.micro - - z1d.large - - c7i.large - - t3a.medium - - m7i-flex.large - - r5d.large - - r5n.large - - c5a.large - - r5b.large - - m5d.large - - m6a.large - - c6a.large - - c6id.large - - m6idn.large - - r3.large - - t3.large - - m5zn.large - - m6i.large - - r6i.large - - c1.medium - - t3a.large - - r7gd.medium - - m7a.medium - - t2.small - - c6g.medium - - r7a.medium - - c7a.medium - - r7g.medium - - m7gd.medium - - c7gd.medium - - c6gd.medium - - m6g.medium - - r6gd.medium - - m6gd.medium - - m1.small - - m7g.medium - - t1.micro - - t2.nano - - a1.medium - - is4gen.medium - - r6g.medium - - c6gn.medium - - c7gn.medium - - m3.medium - - t2.micro - - m1.medium - - c7g.medium + - u-9tb1.112xlarge + - u-12tb1.112xlarge + - u-6tb1.112xlarge + - u-6tb1.56xlarge + - u-3tb1.56xlarge + - c6a.48xlarge + - m6a.48xlarge + - r7a.metal-48xl + - m7a.48xlarge + - m6a.metal + - c7i.metal-48xl + - c7a.48xlarge + - g5.48xlarge + - c6a.metal + - r7i.metal-48xl + - m7i.metal-48xl + - c7a.metal-48xl + - m7i.48xlarge + - inf2.48xlarge + - g6.48xlarge + - r7i.48xlarge + - r7a.48xlarge + - c7i.48xlarge + - r6a.48xlarge + - m7a.metal-48xl + - r6a.metal + - i4i.metal + - r6in.metal + - r6id.metal + - r6in.32xlarge + - c6i.metal + - c6in.32xlarge + - x2idn.32xlarge + - m7a.32xlarge + - m6in.32xlarge + - r7iz.32xlarge + - x1e.32xlarge + - c6in.metal + - r6idn.metal + - r6i.32xlarge + - m6i.metal + - m6a.32xlarge + - r7iz.metal-32xl + - r6id.32xlarge + - x1.32xlarge + - c6i.32xlarge + - m6id.32xlarge + - c6id.metal + - x2idn.metal + - i4i.32xlarge + - m6in.metal + - c7a.32xlarge + - c6a.32xlarge + - m6idn.metal + - m6idn.32xlarge + - m6i.32xlarge + - r6idn.32xlarge + - r6i.metal + - x2iedn.metal + - m6id.metal + - r7a.32xlarge + - x2iedn.32xlarge + - c6id.32xlarge + - r6a.32xlarge + - g6.24xlarge + - r6idn.24xlarge + - r5dn.24xlarge + - m5d.24xlarge + - p3dn.24xlarge + - g5.24xlarge + - i3en.24xlarge + - r5b.metal + - r6i.24xlarge + - r6in.24xlarge + - m5a.24xlarge + - r5n.24xlarge + - inf2.24xlarge + - r6id.24xlarge + - m6id.24xlarge + - r7i.24xlarge + - m5.metal + - m5d.metal + - x2iedn.24xlarge + - m5dn.metal + - r5n.metal + - r5b.24xlarge + - c7a.24xlarge + - vt1.24xlarge + - r5.metal + - m5n.metal + - c6in.24xlarge + - c5d.metal + - m5ad.24xlarge + - c5d.24xlarge + - i3en.metal + - m5n.24xlarge + - inf1.24xlarge + - r5dn.metal + - r5.24xlarge + - m7i.metal-24xl + - g4dn.metal + - c6a.24xlarge + - c7i.metal-24xl + - p4d.24xlarge + - c5.metal + - m7a.24xlarge + - m5.24xlarge + - r5d.24xlarge + - c6i.24xlarge + - c5.24xlarge + - m6idn.24xlarge + - i4i.24xlarge + - m5dn.24xlarge + - r6a.24xlarge + - m7i.24xlarge + - r5a.24xlarge + - c5a.24xlarge + - x2idn.24xlarge + - r7a.24xlarge + - r5d.metal + - m6in.24xlarge + - r7i.metal-24xl + - m6a.24xlarge + - m6i.24xlarge + - c7i.24xlarge + - r5ad.24xlarge + - c6id.24xlarge + - c5d.18xlarge + - c5n.18xlarge + - c5n.metal + - i3.metal + - c5.18xlarge + - m6a.16xlarge + - m6gd.16xlarge + - c7g.16xlarge + - c6gd.16xlarge + - c6g.metal + - p3.16xlarge + - x1.16xlarge + - m6g.metal + - i3.16xlarge + - m4.16xlarge + - r7iz.16xlarge + - c7gd.16xlarge + - r5b.16xlarge + - c7gn.metal + - r6in.16xlarge + - r6g.16xlarge + - x1e.16xlarge + - c7gn.16xlarge + - c6id.16xlarge + - m7gd.16xlarge + - m6id.16xlarge + - m7g.16xlarge + - r7gd.metal + - r7i.16xlarge + - r5dn.16xlarge + - im4gn.16xlarge + - c7gd.metal + - c6g.16xlarge + - m6in.16xlarge + - m5dn.16xlarge + - hpc7g.16xlarge + - m5d.16xlarge + - g4ad.16xlarge + - x2iedn.16xlarge + - r7g.metal + - m5.16xlarge + - m7a.16xlarge + - r5a.16xlarge + - g5g.metal + - r6a.16xlarge + - g6.16xlarge + - r5.16xlarge + - g5.16xlarge + - g4dn.16xlarge + - r6i.16xlarge + - i4i.16xlarge + - m5n.16xlarge + - m7i.16xlarge + - g3.16xlarge + - r7a.16xlarge + - c7i.16xlarge + - c6gn.16xlarge + - p2.16xlarge + - r6id.16xlarge + - r5d.16xlarge + - r6gd.16xlarge + - r4.16xlarge + - m5a.16xlarge + - m7g.metal + - r7gd.16xlarge + - r5ad.16xlarge + - m5ad.16xlarge + - m6g.16xlarge + - c7g.metal + - g5g.16xlarge + - m6idn.16xlarge + - r5n.16xlarge + - r7g.16xlarge + - m6gd.metal + - c6i.16xlarge + - c6gd.metal + - x2idn.16xlarge + - c7a.16xlarge + - c6in.16xlarge + - r6idn.16xlarge + - c5a.16xlarge + - r7iz.metal-16xl + - r6g.metal + - c6a.16xlarge + - m6i.16xlarge + - m7gd.metal + - r6gd.metal + - r5ad.12xlarge + - m5a.12xlarge + - c6g.12xlarge + - m5dn.12xlarge + - r5.12xlarge + - r7a.12xlarge + - c5a.12xlarge + - c7gn.12xlarge + - c7gd.12xlarge + - m6g.12xlarge + - m7i.12xlarge + - r5dn.12xlarge + - z1d.metal + - m7g.12xlarge + - c7g.12xlarge + - m6gd.12xlarge + - r5n.12xlarge + - r5b.12xlarge + - r6i.12xlarge + - r6g.12xlarge + - r7iz.12xlarge + - c6id.12xlarge + - g6.12xlarge + - m5zn.metal + - c7a.12xlarge + - g4dn.12xlarge + - c5.12xlarge + - r6gd.12xlarge + - m7a.12xlarge + - r7g.12xlarge + - z1d.12xlarge + - m5ad.12xlarge + - r6id.12xlarge + - i3en.12xlarge + - m5n.12xlarge + - c6i.12xlarge + - m6idn.12xlarge + - r7i.12xlarge + - m6in.12xlarge + - r6idn.12xlarge + - c5d.12xlarge + - r5d.12xlarge + - m7gd.12xlarge + - c6in.12xlarge + - i4i.12xlarge + - x2iezn.metal + - m5.12xlarge + - m6id.12xlarge + - r6in.12xlarge + - r7gd.12xlarge + - c6gd.12xlarge + - r5a.12xlarge + - c6a.12xlarge + - x2iezn.12xlarge + - g5.12xlarge + - r6a.12xlarge + - m5d.12xlarge + - m6i.12xlarge + - c7i.12xlarge + - m5zn.12xlarge + - m6a.12xlarge + - c6gn.12xlarge + - d3en.12xlarge + - m4.10xlarge + - d2.8xlarge + - c5n.9xlarge + - c4.8xlarge + - c5.9xlarge + - c5d.9xlarge + - r5ad.8xlarge + - inf2.8xlarge + - is4gen.8xlarge + - r5d.8xlarge + - m7a.8xlarge + - m5d.8xlarge + - c7gd.8xlarge + - r7i.8xlarge + - m5a.8xlarge + - r6gd.8xlarge + - c6in.8xlarge + - m5n.8xlarge + - r7g.8xlarge + - r5dn.8xlarge + - c6gd.8xlarge + - i4i.8xlarge + - r7gd.8xlarge + - c7a.8xlarge + - r3.8xlarge + - g4dn.8xlarge + - m7i.8xlarge + - im4gn.8xlarge + - r6g.8xlarge + - r6in.8xlarge + - hpc7g.8xlarge + - x1e.8xlarge + - r6i.8xlarge + - g5g.8xlarge + - i3.8xlarge + - d3en.8xlarge + - m6id.8xlarge + - c7i-flex.8xlarge + - m5.8xlarge + - m7i-flex.8xlarge + - r6a.8xlarge + - c6a.8xlarge + - p2.8xlarge + - r7a.8xlarge + - c7i.8xlarge + - x2iezn.8xlarge + - c7gn.8xlarge + - c5a.8xlarge + - c6g.8xlarge + - r5.8xlarge + - r6idn.8xlarge + - g6.8xlarge + - m7gd.8xlarge + - c7g.8xlarge + - m5ad.8xlarge + - r5b.8xlarge + - g4ad.8xlarge + - c6i.8xlarge + - m7g.8xlarge + - gr6.8xlarge + - r4.8xlarge + - m6a.8xlarge + - x2iedn.8xlarge + - c3.8xlarge + - m6g.8xlarge + - p3.8xlarge + - m5dn.8xlarge + - g5.8xlarge + - m6in.8xlarge + - c6gn.8xlarge + - r5a.8xlarge + - c6id.8xlarge + - r7iz.8xlarge + - m6idn.8xlarge + - r6id.8xlarge + - i2.8xlarge + - m6gd.8xlarge + - d3.8xlarge + - m6i.8xlarge + - g3.8xlarge + - r5n.8xlarge + - z1d.6xlarge + - i3en.6xlarge + - m5zn.6xlarge + - d3en.6xlarge + - vt1.6xlarge + - x2iezn.6xlarge + - inf1.6xlarge + - c7g.4xlarge + - r5dn.4xlarge + - r6i.4xlarge + - c4.4xlarge + - i3.4xlarge + - m7g.4xlarge + - r5.4xlarge + - gr6.4xlarge + - m6a.4xlarge + - c5d.4xlarge + - im4gn.4xlarge + - c7gn.4xlarge + - m7i.4xlarge + - c3.4xlarge + - m5n.4xlarge + - x1e.4xlarge + - m6in.4xlarge + - c7i.4xlarge + - m5a.4xlarge + - r6g.4xlarge + - r6gd.4xlarge + - m6g.4xlarge + - c7i-flex.4xlarge + - r7gd.4xlarge + - g3.4xlarge + - g5.4xlarge + - d2.4xlarge + - m6idn.4xlarge + - r6idn.4xlarge + - r5b.4xlarge + - c5n.4xlarge + - r3.4xlarge + - r5n.4xlarge + - c6in.4xlarge + - c7a.4xlarge + - m5dn.4xlarge + - g4ad.4xlarge + - c7gd.4xlarge + - g4dn.4xlarge + - c5.4xlarge + - d3.4xlarge + - i4i.4xlarge + - g6.4xlarge + - m4.4xlarge + - c6id.4xlarge + - m5.4xlarge + - d3en.4xlarge + - r4.4xlarge + - m6i.4xlarge + - m5ad.4xlarge + - m7gd.4xlarge + - is4gen.4xlarge + - m6gd.4xlarge + - r5ad.4xlarge + - c6a.4xlarge + - m5d.4xlarge + - a1.4xlarge + - hpc7g.4xlarge + - m6id.4xlarge + - r6id.4xlarge + - x2iedn.4xlarge + - r7a.4xlarge + - c6g.4xlarge + - c6gd.4xlarge + - r5a.4xlarge + - g5g.4xlarge + - a1.metal + - r6a.4xlarge + - c6i.4xlarge + - r7i.4xlarge + - x2iezn.4xlarge + - r7iz.4xlarge + - r5d.4xlarge + - r7g.4xlarge + - i2.4xlarge + - m7i-flex.4xlarge + - r6in.4xlarge + - c6gn.4xlarge + - m7a.4xlarge + - c5a.4xlarge + - i3en.3xlarge + - z1d.3xlarge + - vt1.3xlarge + - mac1.metal + - m5zn.3xlarge + - c6a.2xlarge + - c6gd.2xlarge + - r6in.2xlarge + - a1.2xlarge + - x1e.2xlarge + - m5dn.2xlarge + - g6.2xlarge + - m6idn.2xlarge + - t2.2xlarge + - m6a.2xlarge + - t4g.2xlarge + - z1d.2xlarge + - m6g.2xlarge + - r5ad.2xlarge + - c7a.2xlarge + - g5.2xlarge + - g4dn.2xlarge + - m6i.2xlarge + - r6g.2xlarge + - m6in.2xlarge + - m7gd.2xlarge + - i4i.2xlarge + - m5a.2xlarge + - im4gn.2xlarge + - d2.2xlarge + - m3.2xlarge + - c6id.2xlarge + - c7gn.2xlarge + - c6g.2xlarge + - r5d.2xlarge + - m4.2xlarge + - m6id.2xlarge + - c5a.2xlarge + - c6i.2xlarge + - c1.xlarge + - g4ad.2xlarge + - c7i-flex.2xlarge + - inf1.2xlarge + - r6a.2xlarge + - t3a.2xlarge + - r7i.2xlarge + - r4.2xlarge + - m5zn.2xlarge + - c4.2xlarge + - r3.2xlarge + - r5b.2xlarge + - r7a.2xlarge + - is4gen.2xlarge + - m7i.2xlarge + - c7gd.2xlarge + - c7i.2xlarge + - i2.2xlarge + - p3.2xlarge + - m6gd.2xlarge + - r6i.2xlarge + - d3.2xlarge + - x2iedn.2xlarge + - m5d.2xlarge + - t3.2xlarge + - d3en.2xlarge + - i3.2xlarge + - r6gd.2xlarge + - c5.2xlarge + - r6id.2xlarge + - g5g.2xlarge + - r5a.2xlarge + - r5n.2xlarge + - m7i-flex.2xlarge + - r6idn.2xlarge + - x2iezn.2xlarge + - m7g.2xlarge + - c7g.2xlarge + - r5.2xlarge + - c3.2xlarge + - i3en.2xlarge + - c6gn.2xlarge + - m7a.2xlarge + - c5n.2xlarge + - r5dn.2xlarge + - r7gd.2xlarge + - m5n.2xlarge + - m2.4xlarge + - m5.2xlarge + - r7iz.2xlarge + - r7g.2xlarge + - c6in.2xlarge + - m5ad.2xlarge + - c5d.2xlarge + - m5.xlarge + - d2.xlarge + - c7g.xlarge + - x1e.xlarge + - r6i.xlarge + - t3a.xlarge + - m2.2xlarge + - c7gn.xlarge + - x2iedn.xlarge + - t4g.xlarge + - r7g.xlarge + - g4ad.xlarge + - d3en.xlarge + - inf1.xlarge + - im4gn.xlarge + - c6gn.xlarge + - a1.xlarge + - z1d.xlarge + - m3.xlarge + - g5g.xlarge + - i3.xlarge + - m6g.xlarge + - c6i.xlarge + - m6i.xlarge + - t2.xlarge + - r6gd.xlarge + - c4.xlarge + - is4gen.xlarge + - r5ad.xlarge + - c5.xlarge + - r5b.xlarge + - m7g.xlarge + - m5d.xlarge + - m6idn.xlarge + - m6gd.xlarge + - r6g.xlarge + - m6a.xlarge + - c6gd.xlarge + - r4.xlarge + - c7i.xlarge + - m5zn.xlarge + - m5ad.xlarge + - m7a.xlarge + - r6id.xlarge + - m7i.xlarge + - m7i-flex.xlarge + - inf2.xlarge + - c7gd.xlarge + - m6id.xlarge + - c6in.xlarge + - r5d.xlarge + - r3.xlarge + - c6g.xlarge + - c5d.xlarge + - m4.xlarge + - c7i-flex.xlarge + - r5n.xlarge + - m5dn.xlarge + - m1.xlarge + - r5dn.xlarge + - r5.xlarge + - r6a.xlarge + - i4i.xlarge + - c5a.xlarge + - g5.xlarge + - g3s.xlarge + - r7gd.xlarge + - t3.xlarge + - i3en.xlarge + - r6idn.xlarge + - r7a.xlarge + - g6.xlarge + - m5n.xlarge + - p2.xlarge + - c3.xlarge + - m6in.xlarge + - r6in.xlarge + - d3.xlarge + - r7iz.xlarge + - c5n.xlarge + - c6a.xlarge + - r7i.xlarge + - m7gd.xlarge + - i2.xlarge + - g4dn.xlarge + - c7a.xlarge + - c6id.xlarge + - m5a.xlarge + - r5a.xlarge + - t3a.nano + - r6gd.large + - m5a.large + - i3.large + - c4.large + - t4g.micro + - c6gd.large + - m4.large + - t3a.small + - m7g.large + - m1.large + - r6in.large + - t3.nano + - m7a.large + - m6id.large + - i3en.large + - t4g.large + - m2.xlarge + - c5.large + - r7g.large + - c6gn.large + - t3.small + - t4g.small + - m3.large + - m6gd.large + - im4gn.large + - m5ad.large + - c5n.large + - c7a.large + - r6g.large + - t4g.nano + - c7g.large + - m6in.large + - c7gd.large + - r7iz.large + - r5a.large + - r5dn.large + - r4.large + - a1.large + - m5.large + - c6g.large + - t3.medium + - m7i.large + - c7i-flex.large + - r7a.large + - c7gn.large + - r7i.large + - r6id.large + - r5.large + - i4i.large + - c3.large + - m5dn.large + - r6a.large + - t3.micro + - r5ad.large + - m6g.large + - m7gd.large + - c6i.large + - r6idn.large + - c6in.large + - c5d.large + - t4g.medium + - is4gen.large + - t2.medium + - r7gd.large + - m5n.large + - t2.large + - t3a.micro + - z1d.large + - c7i.large + - t3a.medium + - m7i-flex.large + - r5d.large + - r5n.large + - c5a.large + - r5b.large + - m5d.large + - m6a.large + - c6a.large + - c6id.large + - m6idn.large + - r3.large + - t3.large + - m5zn.large + - m6i.large + - r6i.large + - c1.medium + - t3a.large + - r7gd.medium + - m7a.medium + - t2.small + - c6g.medium + - r7a.medium + - c7a.medium + - r7g.medium + - m7gd.medium + - c7gd.medium + - c6gd.medium + - m6g.medium + - r6gd.medium + - m6gd.medium + - m1.small + - m7g.medium + - t1.micro + - t2.nano + - a1.medium + - is4gen.medium + - r6g.medium + - c6gn.medium + - c7gn.medium + - m3.medium + - t2.micro + - m1.medium + - c7g.medium ap-northeast-2: - - u7in-16tb.224xlarge - - u-6tb1.112xlarge - - u-24tb1.112xlarge - - u-9tb1.112xlarge - - u-12tb1.112xlarge - - u-6tb1.56xlarge - - g5.48xlarge - - m7i.metal-48xl - - c7i.metal-48xl - - r7i.48xlarge - - c7i.48xlarge - - m7i.48xlarge - - r7i.metal-48xl - - c6id.32xlarge - - c6in.32xlarge - - c6i.32xlarge - - x1e.32xlarge - - i4i.metal - - r6i.metal - - c6in.metal - - r6id.32xlarge - - r6i.32xlarge - - c6i.metal - - m6i.32xlarge - - x1.32xlarge - - r6id.metal - - x2idn.32xlarge - - m6i.metal - - x2idn.metal - - m6id.32xlarge - - x2iedn.32xlarge - - x2iedn.metal - - m6id.metal - - c6id.metal - - i4i.32xlarge - - c7i.24xlarge - - m5d.metal - - r7i.metal-24xl - - g4dn.metal - - c5a.24xlarge - - r5d.metal - - m5ad.24xlarge - - i3en.metal - - g5.24xlarge - - r5b.metal - - i3en.24xlarge - - c6id.24xlarge - - r5ad.24xlarge - - r7i.24xlarge - - r5dn.24xlarge - - c7i.metal-24xl - - x2iedn.24xlarge - - m6i.24xlarge - - r6id.24xlarge - - r5b.24xlarge - - m5d.24xlarge - - r5d.24xlarge - - c5.metal - - r5dn.metal - - c5.24xlarge - - m5.24xlarge - - c6in.24xlarge - - r5a.24xlarge - - m5a.24xlarge - - r5n.24xlarge - - i4i.24xlarge - - m7i.24xlarge - - r6i.24xlarge - - c5d.metal - - m7i.metal-24xl - - m5.metal - - r5.metal - - p4d.24xlarge - - m6id.24xlarge - - r5.24xlarge - - r5n.metal - - x2idn.24xlarge - - c5d.24xlarge - - c6i.24xlarge - - inf1.24xlarge - - c5.18xlarge - - c5n.metal - - c5n.18xlarge - - i3.metal - - c5d.18xlarge - - r6g.metal - - g5g.metal - - c6g.metal - - r6i.16xlarge - - m7g.16xlarge - - p2.16xlarge - - m5.16xlarge - - x2idn.16xlarge - - c6gd.metal - - r6id.16xlarge - - c6i.16xlarge - - g3.16xlarge - - i3.16xlarge - - i4i.16xlarge - - m6gd.16xlarge - - r6gd.16xlarge - - r6gd.metal - - r5n.16xlarge - - c6gd.16xlarge - - g5.16xlarge - - r5ad.16xlarge - - m5a.16xlarge - - x2iedn.16xlarge - - r7g.metal - - m6g.16xlarge - - x1.16xlarge - - c6gn.16xlarge - - g4dn.16xlarge - - c6in.16xlarge - - r4.16xlarge - - c6id.16xlarge - - r7i.16xlarge - - c7g.16xlarge - - c7g.metal - - m6g.metal - - m7g.metal - - m6id.16xlarge - - r6g.16xlarge - - m6i.16xlarge - - r5d.16xlarge - - r7g.16xlarge - - m5ad.16xlarge - - r5.16xlarge - - m6gd.metal - - c7i.16xlarge - - r5a.16xlarge - - m5d.16xlarge - - c6g.16xlarge - - r5b.16xlarge - - m7i.16xlarge - - m4.16xlarge - - g5g.16xlarge - - r5dn.16xlarge - - c5a.16xlarge - - x1e.16xlarge - - p3.16xlarge - - c6i.12xlarge - - r6gd.12xlarge - - i4i.12xlarge - - c7i.12xlarge - - r5n.12xlarge - - c6in.12xlarge - - r5a.12xlarge - - r6i.12xlarge - - m7i.12xlarge - - r7i.12xlarge - - m6gd.12xlarge - - c6gd.12xlarge - - r5.12xlarge - - r5dn.12xlarge - - m6id.12xlarge - - m5d.12xlarge - - z1d.metal - - c5a.12xlarge - - r5ad.12xlarge - - c6id.12xlarge - - r6g.12xlarge - - r6id.12xlarge - - c7g.12xlarge - - m6g.12xlarge - - c5d.12xlarge - - g4dn.12xlarge - - z1d.12xlarge - - r5b.12xlarge - - m6i.12xlarge - - m5ad.12xlarge - - g5.12xlarge - - m5zn.12xlarge - - i3en.12xlarge - - m5a.12xlarge - - c5.12xlarge - - m5.12xlarge - - m7g.12xlarge - - r5d.12xlarge - - r7g.12xlarge - - c6gn.12xlarge - - c6g.12xlarge - - m5zn.metal - - m4.10xlarge - - c5.9xlarge - - c5n.9xlarge - - c4.8xlarge - - d2.8xlarge - - c5d.9xlarge - - c7g.8xlarge - - r5dn.8xlarge - - m7i.8xlarge - - m7i-flex.8xlarge - - r4.8xlarge - - m6i.8xlarge - - c6i.8xlarge - - m5a.8xlarge - - m6id.8xlarge - - m5.8xlarge - - c6id.8xlarge - - r7i.8xlarge - - r5a.8xlarge - - x1e.8xlarge - - m5ad.8xlarge - - x2iedn.8xlarge - - c6gd.8xlarge - - r7g.8xlarge - - c5a.8xlarge - - r5b.8xlarge - - g4dn.8xlarge - - c7i-flex.8xlarge - - c6in.8xlarge - - p2.8xlarge - - m5d.8xlarge - - m7g.8xlarge - - g5.8xlarge - - m6gd.8xlarge - - i3.8xlarge - - m6g.8xlarge - - r6gd.8xlarge - - r5d.8xlarge - - r3.8xlarge - - i2.8xlarge - - i4i.8xlarge - - c6gn.8xlarge - - r5ad.8xlarge - - g5g.8xlarge - - c7i.8xlarge - - p3.8xlarge - - r6g.8xlarge - - r5.8xlarge - - r6i.8xlarge - - r6id.8xlarge - - g3.8xlarge - - r5n.8xlarge - - c6g.8xlarge - - i3en.6xlarge - - inf1.6xlarge - - m5zn.6xlarge - - z1d.6xlarge - - m5.4xlarge - - m6i.4xlarge - - r4.4xlarge - - r3.4xlarge - - c5d.4xlarge - - m7g.4xlarge - - x2iedn.4xlarge - - m5ad.4xlarge - - c6i.4xlarge - - r7i.4xlarge - - m4.4xlarge - - r5dn.4xlarge - - m6id.4xlarge - - c7i.4xlarge - - m6g.4xlarge - - c4.4xlarge - - g3.4xlarge - - g5g.4xlarge - - r5b.4xlarge - - m5a.4xlarge - - g5.4xlarge - - m6gd.4xlarge - - r5.4xlarge - - i2.4xlarge - - r7g.4xlarge - - c5.4xlarge - - g4dn.4xlarge - - c6gn.4xlarge - - c6id.4xlarge - - i3.4xlarge - - r6id.4xlarge - - x1e.4xlarge - - r5n.4xlarge - - r5ad.4xlarge - - d2.4xlarge - - m7i-flex.4xlarge - - c6g.4xlarge - - c6gd.4xlarge - - r5d.4xlarge - - c5n.4xlarge - - r6gd.4xlarge - - c5a.4xlarge - - i4i.4xlarge - - m5d.4xlarge - - c7i-flex.4xlarge - - c6in.4xlarge - - r6g.4xlarge - - m7i.4xlarge - - c7g.4xlarge - - r5a.4xlarge - - r6i.4xlarge - - mac1.metal - - z1d.3xlarge - - m5zn.3xlarge - - i3en.3xlarge - - r5.2xlarge - - c5n.2xlarge - - c4.2xlarge - - r3.2xlarge - - c6g.2xlarge - - t3.2xlarge - - m5ad.2xlarge - - i3.2xlarge - - c6in.2xlarge - - m4.2xlarge - - c5d.2xlarge - - t4g.2xlarge - - p3.2xlarge - - t2.2xlarge - - g5.2xlarge - - r6i.2xlarge - - c7i-flex.2xlarge - - r5b.2xlarge - - m7i.2xlarge - - g5g.2xlarge - - m5a.2xlarge - - c6gd.2xlarge - - c6gn.2xlarge - - z1d.2xlarge - - x1e.2xlarge - - r6gd.2xlarge - - g4dn.2xlarge - - c7i.2xlarge - - m7i-flex.2xlarge - - m5d.2xlarge - - x2iedn.2xlarge - - m6i.2xlarge - - r7g.2xlarge - - inf1.2xlarge - - d2.2xlarge - - m6gd.2xlarge - - c6i.2xlarge - - r5ad.2xlarge - - m5.2xlarge - - m7g.2xlarge - - m6g.2xlarge - - r6g.2xlarge - - t3a.2xlarge - - c5.2xlarge - - r5a.2xlarge - - r6id.2xlarge - - m5zn.2xlarge - - r4.2xlarge - - c5a.2xlarge - - m6id.2xlarge - - c6id.2xlarge - - i3en.2xlarge - - r5d.2xlarge - - r5dn.2xlarge - - c7g.2xlarge - - i2.2xlarge - - r5n.2xlarge - - r7i.2xlarge - - i4i.2xlarge - - r3.xlarge - - m7i-flex.xlarge - - r5n.xlarge - - r5ad.xlarge - - m7i.xlarge - - i3en.xlarge - - m6id.xlarge - - m5ad.xlarge - - g5g.xlarge - - x1e.xlarge - - r5.xlarge - - c5d.xlarge - - c6in.xlarge - - g4dn.xlarge - - c6id.xlarge - - m5zn.xlarge - - t4g.xlarge - - m5d.xlarge - - c5n.xlarge - - m6gd.xlarge - - c6i.xlarge - - r6i.xlarge - - d2.xlarge - - x2iedn.xlarge - - i2.xlarge - - r6gd.xlarge - - r4.xlarge - - r7i.xlarge - - m5a.xlarge - - r5a.xlarge - - m6i.xlarge - - c6gn.xlarge - - r6id.xlarge - - r7g.xlarge - - r6g.xlarge - - c7g.xlarge - - g5.xlarge - - p2.xlarge - - c7i-flex.xlarge - - t3a.xlarge - - t2.xlarge - - m6g.xlarge - - c5a.xlarge - - z1d.xlarge - - m5.xlarge - - i3.xlarge - - c6gd.xlarge - - i4i.xlarge - - c5.xlarge - - m4.xlarge - - m7g.xlarge - - r5d.xlarge - - c7i.xlarge - - c6g.xlarge - - r5dn.xlarge - - c4.xlarge - - r5b.xlarge - - g3s.xlarge - - t3.xlarge - - inf1.xlarge - - m6g.large - - c6g.large - - m7g.large - - m5d.large - - t4g.small - - m4.large - - r6gd.large - - t3.medium - - t3.large - - t2.large - - r5b.large - - t3a.small - - c7i-flex.large - - c7i.large - - t3.micro - - r5.large - - t3a.medium - - r6i.large - - c4.large - - t3a.micro - - r7g.large - - t4g.medium - - i4i.large - - c6in.large - - t4g.large - - m7i-flex.large - - t3a.large - - t2.medium - - r7i.large - - c5n.large - - c5.large - - r5a.large - - c6gn.large - - c6id.large - - m6i.large - - c6gd.large - - m6id.large - - t3.small - - c5a.large - - r4.large - - t3a.nano - - r5dn.large - - r5n.large - - c7g.large - - r5d.large - - c6i.large - - m7i.large - - m5ad.large - - r6id.large - - i3en.large - - z1d.large - - m6gd.large - - t3.nano - - r6g.large - - t4g.nano - - r5ad.large - - r3.large - - t4g.micro - - i3.large - - m5zn.large - - m5a.large - - c5d.large - - m5.large - - t2.nano - - c6g.medium - - m6gd.medium - - r6gd.medium - - r6g.medium - - c6gd.medium - - m7g.medium - - r7g.medium - - c6gn.medium - - t2.small - - t2.micro - - m6g.medium - - c7g.medium + - u7in-16tb.224xlarge + - u-6tb1.112xlarge + - u-24tb1.112xlarge + - u-9tb1.112xlarge + - u-12tb1.112xlarge + - u-6tb1.56xlarge + - g5.48xlarge + - m7i.metal-48xl + - c7i.metal-48xl + - r7i.48xlarge + - c7i.48xlarge + - m7i.48xlarge + - r7i.metal-48xl + - c6id.32xlarge + - c6in.32xlarge + - c6i.32xlarge + - x1e.32xlarge + - i4i.metal + - r6i.metal + - c6in.metal + - r6id.32xlarge + - r6i.32xlarge + - c6i.metal + - m6i.32xlarge + - x1.32xlarge + - r6id.metal + - x2idn.32xlarge + - m6i.metal + - x2idn.metal + - m6id.32xlarge + - x2iedn.32xlarge + - x2iedn.metal + - m6id.metal + - c6id.metal + - i4i.32xlarge + - c7i.24xlarge + - m5d.metal + - r7i.metal-24xl + - g4dn.metal + - c5a.24xlarge + - r5d.metal + - m5ad.24xlarge + - i3en.metal + - g5.24xlarge + - r5b.metal + - i3en.24xlarge + - c6id.24xlarge + - r5ad.24xlarge + - r7i.24xlarge + - r5dn.24xlarge + - c7i.metal-24xl + - x2iedn.24xlarge + - m6i.24xlarge + - r6id.24xlarge + - r5b.24xlarge + - m5d.24xlarge + - r5d.24xlarge + - c5.metal + - r5dn.metal + - c5.24xlarge + - m5.24xlarge + - c6in.24xlarge + - r5a.24xlarge + - m5a.24xlarge + - r5n.24xlarge + - i4i.24xlarge + - m7i.24xlarge + - r6i.24xlarge + - c5d.metal + - m7i.metal-24xl + - m5.metal + - r5.metal + - p4d.24xlarge + - m6id.24xlarge + - r5.24xlarge + - r5n.metal + - x2idn.24xlarge + - c5d.24xlarge + - c6i.24xlarge + - inf1.24xlarge + - c5.18xlarge + - c5n.metal + - c5n.18xlarge + - i3.metal + - c5d.18xlarge + - r6g.metal + - g5g.metal + - c6g.metal + - r6i.16xlarge + - m7g.16xlarge + - p2.16xlarge + - m5.16xlarge + - x2idn.16xlarge + - c6gd.metal + - r6id.16xlarge + - c6i.16xlarge + - g3.16xlarge + - i3.16xlarge + - i4i.16xlarge + - m6gd.16xlarge + - r6gd.16xlarge + - r6gd.metal + - r5n.16xlarge + - c6gd.16xlarge + - g5.16xlarge + - r5ad.16xlarge + - m5a.16xlarge + - x2iedn.16xlarge + - r7g.metal + - m6g.16xlarge + - x1.16xlarge + - c6gn.16xlarge + - g4dn.16xlarge + - c6in.16xlarge + - r4.16xlarge + - c6id.16xlarge + - r7i.16xlarge + - c7g.16xlarge + - c7g.metal + - m6g.metal + - m7g.metal + - m6id.16xlarge + - r6g.16xlarge + - m6i.16xlarge + - r5d.16xlarge + - r7g.16xlarge + - m5ad.16xlarge + - r5.16xlarge + - m6gd.metal + - c7i.16xlarge + - r5a.16xlarge + - m5d.16xlarge + - c6g.16xlarge + - r5b.16xlarge + - m7i.16xlarge + - m4.16xlarge + - g5g.16xlarge + - r5dn.16xlarge + - c5a.16xlarge + - x1e.16xlarge + - p3.16xlarge + - c6i.12xlarge + - r6gd.12xlarge + - i4i.12xlarge + - c7i.12xlarge + - r5n.12xlarge + - c6in.12xlarge + - r5a.12xlarge + - r6i.12xlarge + - m7i.12xlarge + - r7i.12xlarge + - m6gd.12xlarge + - c6gd.12xlarge + - r5.12xlarge + - r5dn.12xlarge + - m6id.12xlarge + - m5d.12xlarge + - z1d.metal + - c5a.12xlarge + - r5ad.12xlarge + - c6id.12xlarge + - r6g.12xlarge + - r6id.12xlarge + - c7g.12xlarge + - m6g.12xlarge + - c5d.12xlarge + - g4dn.12xlarge + - z1d.12xlarge + - r5b.12xlarge + - m6i.12xlarge + - m5ad.12xlarge + - g5.12xlarge + - m5zn.12xlarge + - i3en.12xlarge + - m5a.12xlarge + - c5.12xlarge + - m5.12xlarge + - m7g.12xlarge + - r5d.12xlarge + - r7g.12xlarge + - c6gn.12xlarge + - c6g.12xlarge + - m5zn.metal + - m4.10xlarge + - c5.9xlarge + - c5n.9xlarge + - c4.8xlarge + - d2.8xlarge + - c5d.9xlarge + - c7g.8xlarge + - r5dn.8xlarge + - m7i.8xlarge + - m7i-flex.8xlarge + - r4.8xlarge + - m6i.8xlarge + - c6i.8xlarge + - m5a.8xlarge + - m6id.8xlarge + - m5.8xlarge + - c6id.8xlarge + - r7i.8xlarge + - r5a.8xlarge + - x1e.8xlarge + - m5ad.8xlarge + - x2iedn.8xlarge + - c6gd.8xlarge + - r7g.8xlarge + - c5a.8xlarge + - r5b.8xlarge + - g4dn.8xlarge + - c7i-flex.8xlarge + - c6in.8xlarge + - p2.8xlarge + - m5d.8xlarge + - m7g.8xlarge + - g5.8xlarge + - m6gd.8xlarge + - i3.8xlarge + - m6g.8xlarge + - r6gd.8xlarge + - r5d.8xlarge + - r3.8xlarge + - i2.8xlarge + - i4i.8xlarge + - c6gn.8xlarge + - r5ad.8xlarge + - g5g.8xlarge + - c7i.8xlarge + - p3.8xlarge + - r6g.8xlarge + - r5.8xlarge + - r6i.8xlarge + - r6id.8xlarge + - g3.8xlarge + - r5n.8xlarge + - c6g.8xlarge + - i3en.6xlarge + - inf1.6xlarge + - m5zn.6xlarge + - z1d.6xlarge + - m5.4xlarge + - m6i.4xlarge + - r4.4xlarge + - r3.4xlarge + - c5d.4xlarge + - m7g.4xlarge + - x2iedn.4xlarge + - m5ad.4xlarge + - c6i.4xlarge + - r7i.4xlarge + - m4.4xlarge + - r5dn.4xlarge + - m6id.4xlarge + - c7i.4xlarge + - m6g.4xlarge + - c4.4xlarge + - g3.4xlarge + - g5g.4xlarge + - r5b.4xlarge + - m5a.4xlarge + - g5.4xlarge + - m6gd.4xlarge + - r5.4xlarge + - i2.4xlarge + - r7g.4xlarge + - c5.4xlarge + - g4dn.4xlarge + - c6gn.4xlarge + - c6id.4xlarge + - i3.4xlarge + - r6id.4xlarge + - x1e.4xlarge + - r5n.4xlarge + - r5ad.4xlarge + - d2.4xlarge + - m7i-flex.4xlarge + - c6g.4xlarge + - c6gd.4xlarge + - r5d.4xlarge + - c5n.4xlarge + - r6gd.4xlarge + - c5a.4xlarge + - i4i.4xlarge + - m5d.4xlarge + - c7i-flex.4xlarge + - c6in.4xlarge + - r6g.4xlarge + - m7i.4xlarge + - c7g.4xlarge + - r5a.4xlarge + - r6i.4xlarge + - mac1.metal + - z1d.3xlarge + - m5zn.3xlarge + - i3en.3xlarge + - r5.2xlarge + - c5n.2xlarge + - c4.2xlarge + - r3.2xlarge + - c6g.2xlarge + - t3.2xlarge + - m5ad.2xlarge + - i3.2xlarge + - c6in.2xlarge + - m4.2xlarge + - c5d.2xlarge + - t4g.2xlarge + - p3.2xlarge + - t2.2xlarge + - g5.2xlarge + - r6i.2xlarge + - c7i-flex.2xlarge + - r5b.2xlarge + - m7i.2xlarge + - g5g.2xlarge + - m5a.2xlarge + - c6gd.2xlarge + - c6gn.2xlarge + - z1d.2xlarge + - x1e.2xlarge + - r6gd.2xlarge + - g4dn.2xlarge + - c7i.2xlarge + - m7i-flex.2xlarge + - m5d.2xlarge + - x2iedn.2xlarge + - m6i.2xlarge + - r7g.2xlarge + - inf1.2xlarge + - d2.2xlarge + - m6gd.2xlarge + - c6i.2xlarge + - r5ad.2xlarge + - m5.2xlarge + - m7g.2xlarge + - m6g.2xlarge + - r6g.2xlarge + - t3a.2xlarge + - c5.2xlarge + - r5a.2xlarge + - r6id.2xlarge + - m5zn.2xlarge + - r4.2xlarge + - c5a.2xlarge + - m6id.2xlarge + - c6id.2xlarge + - i3en.2xlarge + - r5d.2xlarge + - r5dn.2xlarge + - c7g.2xlarge + - i2.2xlarge + - r5n.2xlarge + - r7i.2xlarge + - i4i.2xlarge + - r3.xlarge + - m7i-flex.xlarge + - r5n.xlarge + - r5ad.xlarge + - m7i.xlarge + - i3en.xlarge + - m6id.xlarge + - m5ad.xlarge + - g5g.xlarge + - x1e.xlarge + - r5.xlarge + - c5d.xlarge + - c6in.xlarge + - g4dn.xlarge + - c6id.xlarge + - m5zn.xlarge + - t4g.xlarge + - m5d.xlarge + - c5n.xlarge + - m6gd.xlarge + - c6i.xlarge + - r6i.xlarge + - d2.xlarge + - x2iedn.xlarge + - i2.xlarge + - r6gd.xlarge + - r4.xlarge + - r7i.xlarge + - m5a.xlarge + - r5a.xlarge + - m6i.xlarge + - c6gn.xlarge + - r6id.xlarge + - r7g.xlarge + - r6g.xlarge + - c7g.xlarge + - g5.xlarge + - p2.xlarge + - c7i-flex.xlarge + - t3a.xlarge + - t2.xlarge + - m6g.xlarge + - c5a.xlarge + - z1d.xlarge + - m5.xlarge + - i3.xlarge + - c6gd.xlarge + - i4i.xlarge + - c5.xlarge + - m4.xlarge + - m7g.xlarge + - r5d.xlarge + - c7i.xlarge + - c6g.xlarge + - r5dn.xlarge + - c4.xlarge + - r5b.xlarge + - g3s.xlarge + - t3.xlarge + - inf1.xlarge + - m6g.large + - c6g.large + - m7g.large + - m5d.large + - t4g.small + - m4.large + - r6gd.large + - t3.medium + - t3.large + - t2.large + - r5b.large + - t3a.small + - c7i-flex.large + - c7i.large + - t3.micro + - r5.large + - t3a.medium + - r6i.large + - c4.large + - t3a.micro + - r7g.large + - t4g.medium + - i4i.large + - c6in.large + - t4g.large + - m7i-flex.large + - t3a.large + - t2.medium + - r7i.large + - c5n.large + - c5.large + - r5a.large + - c6gn.large + - c6id.large + - m6i.large + - c6gd.large + - m6id.large + - t3.small + - c5a.large + - r4.large + - t3a.nano + - r5dn.large + - r5n.large + - c7g.large + - r5d.large + - c6i.large + - m7i.large + - m5ad.large + - r6id.large + - i3en.large + - z1d.large + - m6gd.large + - t3.nano + - r6g.large + - t4g.nano + - r5ad.large + - r3.large + - t4g.micro + - i3.large + - m5zn.large + - m5a.large + - c5d.large + - m5.large + - t2.nano + - c6g.medium + - m6gd.medium + - r6gd.medium + - r6g.medium + - c6gd.medium + - m7g.medium + - r7g.medium + - c6gn.medium + - t2.small + - t2.micro + - m6g.medium + - c7g.medium ap-northeast-3: - - i4i.metal - - r6i.32xlarge - - x2iedn.32xlarge - - x1e.32xlarge - - x2iedn.metal - - c6i.32xlarge - - x1.32xlarge - - i4i.32xlarge - - r6i.metal - - c6i.metal - - x2idn.metal - - m6i.32xlarge - - x2idn.32xlarge - - m6i.metal - - c5d.24xlarge - - m6i.24xlarge - - r5.metal - - r5d.metal - - i3en.metal - - m5d.24xlarge - - c5.24xlarge - - x2idn.24xlarge - - i3en.24xlarge - - x2iedn.24xlarge - - r6i.24xlarge - - c5d.metal - - r5d.24xlarge - - m5d.metal - - c6i.24xlarge - - m5.metal - - i4i.24xlarge - - r5.24xlarge - - g4dn.metal - - c5.metal - - m5.24xlarge - - c5.18xlarge - - c5d.18xlarge - - c5n.metal - - i3.metal - - c5n.18xlarge - - c6gd.16xlarge - - c6gd.metal - - m6gd.16xlarge - - x2idn.16xlarge - - m6i.16xlarge - - m6g.metal - - r6i.16xlarge - - r6g.16xlarge - - i4i.16xlarge - - m4.16xlarge - - r4.16xlarge - - m6gd.metal - - m5d.16xlarge - - x2iedn.16xlarge - - c6i.16xlarge - - r6gd.16xlarge - - c6g.16xlarge - - c6g.metal - - r6g.metal - - r5d.16xlarge - - r5.16xlarge - - g4dn.16xlarge - - m6g.16xlarge - - i3.16xlarge - - x1.16xlarge - - x1e.16xlarge - - m5.16xlarge - - c6gn.16xlarge - - r6gd.metal - - i3en.12xlarge - - c5.12xlarge - - m5d.12xlarge - - r5d.12xlarge - - m6gd.12xlarge - - g4dn.12xlarge - - c6i.12xlarge - - r6i.12xlarge - - r5.12xlarge - - m6i.12xlarge - - r6gd.12xlarge - - c6g.12xlarge - - m5.12xlarge - - i4i.12xlarge - - c6gn.12xlarge - - c5d.12xlarge - - c6gd.12xlarge - - m6g.12xlarge - - r6g.12xlarge - - c5n.9xlarge - - d2.8xlarge - - c4.8xlarge - - c5d.9xlarge - - c5.9xlarge - - g4dn.8xlarge - - c6g.8xlarge - - i3.8xlarge - - c6i.8xlarge - - x2iedn.8xlarge - - r5.8xlarge - - m6gd.8xlarge - - i4i.8xlarge - - c6gd.8xlarge - - m6i.8xlarge - - m6g.8xlarge - - r6gd.8xlarge - - r5d.8xlarge - - x1e.8xlarge - - r6g.8xlarge - - r6i.8xlarge - - m5d.8xlarge - - c6gn.8xlarge - - r4.8xlarge - - m5.8xlarge - - i3en.6xlarge - - r6i.4xlarge - - c4.4xlarge - - r5d.4xlarge - - m6gd.4xlarge - - m5.4xlarge - - c6i.4xlarge - - m6g.4xlarge - - g4dn.4xlarge - - r6gd.4xlarge - - d2.4xlarge - - m5d.4xlarge - - i4i.4xlarge - - c6gn.4xlarge - - c6g.4xlarge - - x2iedn.4xlarge - - c6gd.4xlarge - - r4.4xlarge - - c5d.4xlarge - - m4.4xlarge - - c5.4xlarge - - i3.4xlarge - - r5.4xlarge - - r6g.4xlarge - - m6i.4xlarge - - x1e.4xlarge - - c5n.4xlarge - - i3en.3xlarge - - r5d.2xlarge - - x2iedn.2xlarge - - c5.2xlarge - - r6i.2xlarge - - i4i.2xlarge - - m4.2xlarge - - c6i.2xlarge - - r6g.2xlarge - - m6i.2xlarge - - c5d.2xlarge - - r4.2xlarge - - c6gd.2xlarge - - i3en.2xlarge - - m6g.2xlarge - - c5n.2xlarge - - m5d.2xlarge - - g4dn.2xlarge - - c4.2xlarge - - c6gn.2xlarge - - i3.2xlarge - - r6gd.2xlarge - - x1e.2xlarge - - m5.2xlarge - - t3.2xlarge - - d2.2xlarge - - r5.2xlarge - - m6gd.2xlarge - - t4g.2xlarge - - c6g.2xlarge - - t2.2xlarge - - i3en.xlarge - - m5.xlarge - - m6gd.xlarge - - g4dn.xlarge - - m5d.xlarge - - r6g.xlarge - - c5d.xlarge - - r5d.xlarge - - r4.xlarge - - i4i.xlarge - - d2.xlarge - - t4g.xlarge - - c4.xlarge - - t3.xlarge - - c6i.xlarge - - r5.xlarge - - x1e.xlarge - - x2iedn.xlarge - - m4.xlarge - - c5.xlarge - - r6i.xlarge - - c6gd.xlarge - - m6i.xlarge - - c6gn.xlarge - - m6g.xlarge - - t2.xlarge - - c6g.xlarge - - i3.xlarge - - c5n.xlarge - - r6gd.xlarge - - r4.large - - c6i.large - - t3.large - - c6gn.large - - r6g.large - - m6gd.large - - i3.large - - m4.large - - t3.micro - - r5d.large - - c4.large - - t4g.small - - t3.medium - - c5d.large - - r5.large - - r6gd.large - - t3.nano - - i3en.large - - m5.large - - t4g.medium - - m5d.large - - t3.small - - c5.large - - t4g.nano - - t2.large - - t4g.micro - - c6g.large - - t2.medium - - m6i.large - - c5n.large - - i4i.large - - t4g.large - - m6g.large - - r6i.large - - c6gd.large - - t2.small - - c6g.medium - - c6gd.medium - - m6gd.medium - - t2.nano - - r6gd.medium - - r6g.medium - - c6gn.medium - - m6g.medium - - t2.micro + - i4i.metal + - r6i.32xlarge + - x2iedn.32xlarge + - x1e.32xlarge + - x2iedn.metal + - c6i.32xlarge + - x1.32xlarge + - i4i.32xlarge + - r6i.metal + - c6i.metal + - x2idn.metal + - m6i.32xlarge + - x2idn.32xlarge + - m6i.metal + - c5d.24xlarge + - m6i.24xlarge + - r5.metal + - r5d.metal + - i3en.metal + - m5d.24xlarge + - c5.24xlarge + - x2idn.24xlarge + - i3en.24xlarge + - x2iedn.24xlarge + - r6i.24xlarge + - c5d.metal + - r5d.24xlarge + - m5d.metal + - c6i.24xlarge + - m5.metal + - i4i.24xlarge + - r5.24xlarge + - g4dn.metal + - c5.metal + - m5.24xlarge + - c5.18xlarge + - c5d.18xlarge + - c5n.metal + - i3.metal + - c5n.18xlarge + - c6gd.16xlarge + - c6gd.metal + - m6gd.16xlarge + - x2idn.16xlarge + - m6i.16xlarge + - m6g.metal + - r6i.16xlarge + - r6g.16xlarge + - i4i.16xlarge + - m4.16xlarge + - r4.16xlarge + - m6gd.metal + - m5d.16xlarge + - x2iedn.16xlarge + - c6i.16xlarge + - r6gd.16xlarge + - c6g.16xlarge + - c6g.metal + - r6g.metal + - r5d.16xlarge + - r5.16xlarge + - g4dn.16xlarge + - m6g.16xlarge + - i3.16xlarge + - x1.16xlarge + - x1e.16xlarge + - m5.16xlarge + - c6gn.16xlarge + - r6gd.metal + - i3en.12xlarge + - c5.12xlarge + - m5d.12xlarge + - r5d.12xlarge + - m6gd.12xlarge + - g4dn.12xlarge + - c6i.12xlarge + - r6i.12xlarge + - r5.12xlarge + - m6i.12xlarge + - r6gd.12xlarge + - c6g.12xlarge + - m5.12xlarge + - i4i.12xlarge + - c6gn.12xlarge + - c5d.12xlarge + - c6gd.12xlarge + - m6g.12xlarge + - r6g.12xlarge + - c5n.9xlarge + - d2.8xlarge + - c4.8xlarge + - c5d.9xlarge + - c5.9xlarge + - g4dn.8xlarge + - c6g.8xlarge + - i3.8xlarge + - c6i.8xlarge + - x2iedn.8xlarge + - r5.8xlarge + - m6gd.8xlarge + - i4i.8xlarge + - c6gd.8xlarge + - m6i.8xlarge + - m6g.8xlarge + - r6gd.8xlarge + - r5d.8xlarge + - x1e.8xlarge + - r6g.8xlarge + - r6i.8xlarge + - m5d.8xlarge + - c6gn.8xlarge + - r4.8xlarge + - m5.8xlarge + - i3en.6xlarge + - r6i.4xlarge + - c4.4xlarge + - r5d.4xlarge + - m6gd.4xlarge + - m5.4xlarge + - c6i.4xlarge + - m6g.4xlarge + - g4dn.4xlarge + - r6gd.4xlarge + - d2.4xlarge + - m5d.4xlarge + - i4i.4xlarge + - c6gn.4xlarge + - c6g.4xlarge + - x2iedn.4xlarge + - c6gd.4xlarge + - r4.4xlarge + - c5d.4xlarge + - m4.4xlarge + - c5.4xlarge + - i3.4xlarge + - r5.4xlarge + - r6g.4xlarge + - m6i.4xlarge + - x1e.4xlarge + - c5n.4xlarge + - i3en.3xlarge + - r5d.2xlarge + - x2iedn.2xlarge + - c5.2xlarge + - r6i.2xlarge + - i4i.2xlarge + - m4.2xlarge + - c6i.2xlarge + - r6g.2xlarge + - m6i.2xlarge + - c5d.2xlarge + - r4.2xlarge + - c6gd.2xlarge + - i3en.2xlarge + - m6g.2xlarge + - c5n.2xlarge + - m5d.2xlarge + - g4dn.2xlarge + - c4.2xlarge + - c6gn.2xlarge + - i3.2xlarge + - r6gd.2xlarge + - x1e.2xlarge + - m5.2xlarge + - t3.2xlarge + - d2.2xlarge + - r5.2xlarge + - m6gd.2xlarge + - t4g.2xlarge + - c6g.2xlarge + - t2.2xlarge + - i3en.xlarge + - m5.xlarge + - m6gd.xlarge + - g4dn.xlarge + - m5d.xlarge + - r6g.xlarge + - c5d.xlarge + - r5d.xlarge + - r4.xlarge + - i4i.xlarge + - d2.xlarge + - t4g.xlarge + - c4.xlarge + - t3.xlarge + - c6i.xlarge + - r5.xlarge + - x1e.xlarge + - x2iedn.xlarge + - m4.xlarge + - c5.xlarge + - r6i.xlarge + - c6gd.xlarge + - m6i.xlarge + - c6gn.xlarge + - m6g.xlarge + - t2.xlarge + - c6g.xlarge + - i3.xlarge + - c5n.xlarge + - r6gd.xlarge + - r4.large + - c6i.large + - t3.large + - c6gn.large + - r6g.large + - m6gd.large + - i3.large + - m4.large + - t3.micro + - r5d.large + - c4.large + - t4g.small + - t3.medium + - c5d.large + - r5.large + - r6gd.large + - t3.nano + - i3en.large + - m5.large + - t4g.medium + - m5d.large + - t3.small + - c5.large + - t4g.nano + - t2.large + - t4g.micro + - c6g.large + - t2.medium + - m6i.large + - c5n.large + - i4i.large + - t4g.large + - m6g.large + - r6i.large + - c6gd.large + - t2.small + - c6g.medium + - c6gd.medium + - m6gd.medium + - t2.nano + - r6gd.medium + - r6g.medium + - c6gn.medium + - m6g.medium + - t2.micro ap-south-1: - - u-12tb1.112xlarge - - u-6tb1.112xlarge - - u-6tb1.56xlarge - - r6a.48xlarge - - m6a.metal - - m7i.metal-48xl - - m6a.48xlarge - - g5.48xlarge - - r7i.metal-48xl - - inf2.48xlarge - - c7i.48xlarge - - g6.48xlarge - - r7i.48xlarge - - c6a.48xlarge - - c6a.metal - - m7i.48xlarge - - c7i.metal-48xl - - r6a.metal - - c6i.metal - - x2iedn.metal - - m6a.32xlarge - - x2idn.metal - - c6in.32xlarge - - x1.32xlarge - - i4i.32xlarge - - r6id.32xlarge - - m6id.32xlarge - - x2iedn.32xlarge - - c6i.32xlarge - - r6i.32xlarge - - m6in.metal - - m6idn.32xlarge - - r6id.metal - - m6i.metal - - m6in.32xlarge - - c6in.metal - - r6a.32xlarge - - x1e.32xlarge - - m6i.32xlarge - - m6id.metal - - i4i.metal - - c6a.32xlarge - - x2idn.32xlarge - - m6idn.metal - - r6i.metal - - r5.metal - - m7i.metal-24xl - - m6idn.24xlarge - - m5.24xlarge - - m7i.24xlarge - - m5ad.24xlarge - - c5.24xlarge - - r5d.24xlarge - - c5.metal - - i4i.24xlarge - - c5d.metal - - r6a.24xlarge - - r7i.24xlarge - - r5d.metal - - r5n.24xlarge - - m5d.24xlarge - - r5.24xlarge - - c5a.24xlarge - - r6id.24xlarge - - m6a.24xlarge - - r7i.metal-24xl - - c7i.metal-24xl - - c7i.24xlarge - - r5a.24xlarge - - c6a.24xlarge - - g5.24xlarge - - c5d.24xlarge - - m5d.metal - - x2iedn.24xlarge - - inf1.24xlarge - - r6i.24xlarge - - m5.metal - - c6in.24xlarge - - m6id.24xlarge - - inf2.24xlarge - - x2idn.24xlarge - - m6in.24xlarge - - g4dn.metal - - i3en.metal - - i3en.24xlarge - - m5a.24xlarge - - r5ad.24xlarge - - r5n.metal - - m6i.24xlarge - - c6i.24xlarge - - g6.24xlarge - - c5.18xlarge - - i3.metal - - c5d.18xlarge - - c5n.18xlarge - - c5n.metal - - m7gd.metal - - c6g.16xlarge - - c6gd.metal - - m7g.16xlarge - - c6gd.16xlarge - - m6gd.16xlarge - - m4.16xlarge - - r5.16xlarge - - r5n.16xlarge - - r5d.16xlarge - - m7gd.16xlarge - - r7i.16xlarge - - x2iedn.16xlarge - - m6a.16xlarge - - r6g.16xlarge - - c6a.16xlarge - - m6id.16xlarge - - r6gd.16xlarge - - r6i.16xlarge - - r6gd.metal - - r7gd.metal - - g6.16xlarge - - m6i.16xlarge - - c7i.16xlarge - - c6gn.16xlarge - - r5ad.16xlarge - - x1e.16xlarge - - c6in.16xlarge - - m5d.16xlarge - - c6g.metal - - c7gd.16xlarge - - c6i.16xlarge - - m6g.metal - - m6g.16xlarge - - m5.16xlarge - - r7g.16xlarge - - g5.16xlarge - - c7g.metal - - x2idn.16xlarge - - c5a.16xlarge - - r6id.16xlarge - - x1.16xlarge - - r7g.metal - - p2.16xlarge - - r4.16xlarge - - m6gd.metal - - m6in.16xlarge - - m5ad.16xlarge - - g4dn.16xlarge - - r6g.metal - - m5a.16xlarge - - r6a.16xlarge - - i4i.16xlarge - - r7gd.16xlarge - - c7g.16xlarge - - m7i.16xlarge - - m6idn.16xlarge - - c7gd.metal - - m7g.metal - - r5a.16xlarge - - i3.16xlarge - - r7g.12xlarge - - m6g.12xlarge - - c6a.12xlarge - - r5.12xlarge - - c5.12xlarge - - c7g.12xlarge - - c6in.12xlarge - - r6gd.12xlarge - - m6id.12xlarge - - m6in.12xlarge - - r5d.12xlarge - - m7g.12xlarge - - r5ad.12xlarge - - r5a.12xlarge - - g6.12xlarge - - g5.12xlarge - - c6g.12xlarge - - r6g.12xlarge - - m5.12xlarge - - r5n.12xlarge - - m7gd.12xlarge - - r7gd.12xlarge - - m6a.12xlarge - - i4i.12xlarge - - g4dn.12xlarge - - r7i.12xlarge - - m7i.12xlarge - - m5ad.12xlarge - - r6i.12xlarge - - c6gd.12xlarge - - c5d.12xlarge - - c7gd.12xlarge - - c6gn.12xlarge - - m6idn.12xlarge - - c7i.12xlarge - - c5a.12xlarge - - c6i.12xlarge - - z1d.metal - - r6a.12xlarge - - m6i.12xlarge - - m5a.12xlarge - - i3en.12xlarge - - m6gd.12xlarge - - r6id.12xlarge - - z1d.12xlarge - - m5d.12xlarge - - m4.10xlarge - - d2.8xlarge - - c5.9xlarge - - c5d.9xlarge - - c4.8xlarge - - c5n.9xlarge - - c7gd.8xlarge - - r6gd.8xlarge - - r5.8xlarge - - m5ad.8xlarge - - r7g.8xlarge - - g6.8xlarge - - r5d.8xlarge - - c7g.8xlarge - - g4dn.8xlarge - - r5ad.8xlarge - - i4i.8xlarge - - is4gen.8xlarge - - c5a.8xlarge - - r3.8xlarge - - r7i.8xlarge - - x1e.8xlarge - - r5n.8xlarge - - c7i.8xlarge - - r5a.8xlarge - - g5.8xlarge - - r6a.8xlarge - - c6a.8xlarge - - i3.8xlarge - - m7i-flex.8xlarge - - c6g.8xlarge - - inf2.8xlarge - - c6gn.8xlarge - - c6i.8xlarge - - r6id.8xlarge - - i2.8xlarge - - p2.8xlarge - - c6gd.8xlarge - - m6gd.8xlarge - - gr6.8xlarge - - r7gd.8xlarge - - m5a.8xlarge - - m7gd.8xlarge - - m5.8xlarge - - m6idn.8xlarge - - r6g.8xlarge - - m5d.8xlarge - - m6g.8xlarge - - r6i.8xlarge - - m6in.8xlarge - - m6id.8xlarge - - d3.8xlarge - - m6a.8xlarge - - m7g.8xlarge - - c7i-flex.8xlarge - - m6i.8xlarge - - c6in.8xlarge - - r4.8xlarge - - x2iedn.8xlarge - - m7i.8xlarge - - i3en.6xlarge - - inf1.6xlarge - - z1d.6xlarge - - c7gd.4xlarge - - c5a.4xlarge - - c6i.4xlarge - - r6id.4xlarge - - r6a.4xlarge - - r4.4xlarge - - r5.4xlarge - - m5ad.4xlarge - - g4dn.4xlarge - - c6gn.4xlarge - - c7i-flex.4xlarge - - m5d.4xlarge - - m6gd.4xlarge - - m5.4xlarge - - r7i.4xlarge - - m7i.4xlarge - - r6i.4xlarge - - d3.4xlarge - - c5n.4xlarge - - m6g.4xlarge - - c5d.4xlarge - - m6a.4xlarge - - i4i.4xlarge - - r7g.4xlarge - - m6i.4xlarge - - m4.4xlarge - - g5.4xlarge - - x1e.4xlarge - - r6g.4xlarge - - c7i.4xlarge - - gr6.4xlarge - - a1.metal - - m6idn.4xlarge - - c6g.4xlarge - - c5.4xlarge - - c6gd.4xlarge - - m6id.4xlarge - - c4.4xlarge - - is4gen.4xlarge - - g6.4xlarge - - i3.4xlarge - - r5ad.4xlarge - - r5n.4xlarge - - m5a.4xlarge - - m7g.4xlarge - - r3.4xlarge - - d2.4xlarge - - x2iedn.4xlarge - - c7g.4xlarge - - m7i-flex.4xlarge - - m6in.4xlarge - - m7gd.4xlarge - - a1.4xlarge - - i2.4xlarge - - r5a.4xlarge - - c6in.4xlarge - - r6gd.4xlarge - - r5d.4xlarge - - r7gd.4xlarge - - c6a.4xlarge - - z1d.3xlarge - - i3en.3xlarge - - mac1.metal - - m5.2xlarge - - a1.2xlarge - - d3.2xlarge - - c5.2xlarge - - m4.2xlarge - - c5n.2xlarge - - r7gd.2xlarge - - x1e.2xlarge - - t3a.2xlarge - - t4g.2xlarge - - r3.2xlarge - - r5a.2xlarge - - i4i.2xlarge - - c6i.2xlarge - - r5ad.2xlarge - - c7gd.2xlarge - - g6.2xlarge - - m6idn.2xlarge - - c5a.2xlarge - - c6g.2xlarge - - x2iedn.2xlarge - - c7i-flex.2xlarge - - inf1.2xlarge - - is4gen.2xlarge - - m6g.2xlarge - - r6i.2xlarge - - m7i.2xlarge - - m5ad.2xlarge - - g4dn.2xlarge - - m6a.2xlarge - - r7i.2xlarge - - i2.2xlarge - - m6i.2xlarge - - c4.2xlarge - - m7gd.2xlarge - - m7i-flex.2xlarge - - c7i.2xlarge - - t2.2xlarge - - i3.2xlarge - - m7g.2xlarge - - m6gd.2xlarge - - r5n.2xlarge - - c6a.2xlarge - - r4.2xlarge - - c5d.2xlarge - - g5.2xlarge - - m5a.2xlarge - - m6id.2xlarge - - d2.2xlarge - - t3.2xlarge - - r6a.2xlarge - - r5d.2xlarge - - c6gd.2xlarge - - r6g.2xlarge - - r7g.2xlarge - - r6gd.2xlarge - - c6in.2xlarge - - r6id.2xlarge - - c6gn.2xlarge - - r5.2xlarge - - m5d.2xlarge - - z1d.2xlarge - - m6in.2xlarge - - i3en.2xlarge - - c7g.2xlarge - - m7gd.xlarge - - t3a.xlarge - - r6a.xlarge - - is4gen.xlarge - - r5a.xlarge - - c5d.xlarge - - c7g.xlarge - - d2.xlarge - - g4dn.xlarge - - d3.xlarge - - m6a.xlarge - - m7i-flex.xlarge - - x1e.xlarge - - r5n.xlarge - - m6idn.xlarge - - i2.xlarge - - m6i.xlarge - - c4.xlarge - - r6id.xlarge - - m6g.xlarge - - m7i.xlarge - - m5.xlarge - - m6gd.xlarge - - c5n.xlarge - - c6in.xlarge - - r6g.xlarge - - r6gd.xlarge - - inf1.xlarge - - c6a.xlarge - - c7i.xlarge - - c5.xlarge - - r5d.xlarge - - m7g.xlarge - - m5d.xlarge - - inf2.xlarge - - r6i.xlarge - - r3.xlarge - - c7gd.xlarge - - g5.xlarge - - r5ad.xlarge - - x2iedn.xlarge - - a1.xlarge - - m5ad.xlarge - - c6i.xlarge - - i3en.xlarge - - c7i-flex.xlarge - - r7i.xlarge - - i3.xlarge - - m5a.xlarge - - c6g.xlarge - - m6in.xlarge - - t3.xlarge - - g6.xlarge - - c6gn.xlarge - - r7gd.xlarge - - c5a.xlarge - - t2.xlarge - - r4.xlarge - - z1d.xlarge - - m4.xlarge - - m6id.xlarge - - c6gd.xlarge - - t4g.xlarge - - p2.xlarge - - r7g.xlarge - - i4i.xlarge - - r5.xlarge - - m4.large - - r6id.large - - m7i-flex.large - - a1.large - - c6i.large - - m5d.large - - m7gd.large - - r4.large - - r6a.large - - is4gen.large - - i4i.large - - c5n.large - - m5.large - - c7i.large - - z1d.large - - t3a.large - - i3en.large - - r5ad.large - - t4g.medium - - c7gd.large - - c7g.large - - r3.large - - c5d.large - - t2.medium - - t3.small - - t3.medium - - m6a.large - - t2.large - - r7g.large - - t3a.medium - - r5.large - - r6g.large - - m5a.large - - m6g.large - - t4g.nano - - m6idn.large - - t3.large - - r5a.large - - r6gd.large - - r6i.large - - r7gd.large - - t3a.small - - c6a.large - - c7i-flex.large - - m6i.large - - i3.large - - c6in.large - - m5ad.large - - r7i.large - - m7i.large - - m6gd.large - - m7g.large - - t4g.micro - - r5n.large - - t3.micro - - c5a.large - - c5.large - - t4g.large - - r5d.large - - c6gd.large - - t4g.small - - c6gn.large - - t3a.nano - - t3.nano - - c6g.large - - t3a.micro - - m6in.large - - m6id.large - - c4.large - - is4gen.medium - - c7gd.medium - - c7g.medium - - r7gd.medium - - t2.nano - - m7gd.medium - - r6gd.medium - - m6g.medium - - a1.medium - - r7g.medium - - c6gd.medium - - m7g.medium - - t2.micro - - c6g.medium - - m6gd.medium - - t2.small - - c6gn.medium - - r6g.medium + - u-12tb1.112xlarge + - u-6tb1.112xlarge + - u-6tb1.56xlarge + - r6a.48xlarge + - m6a.metal + - m7i.metal-48xl + - m6a.48xlarge + - g5.48xlarge + - r7i.metal-48xl + - inf2.48xlarge + - c7i.48xlarge + - g6.48xlarge + - r7i.48xlarge + - c6a.48xlarge + - c6a.metal + - m7i.48xlarge + - c7i.metal-48xl + - r6a.metal + - c6i.metal + - x2iedn.metal + - m6a.32xlarge + - x2idn.metal + - c6in.32xlarge + - x1.32xlarge + - i4i.32xlarge + - r6id.32xlarge + - m6id.32xlarge + - x2iedn.32xlarge + - c6i.32xlarge + - r6i.32xlarge + - m6in.metal + - m6idn.32xlarge + - r6id.metal + - m6i.metal + - m6in.32xlarge + - c6in.metal + - r6a.32xlarge + - x1e.32xlarge + - m6i.32xlarge + - m6id.metal + - i4i.metal + - c6a.32xlarge + - x2idn.32xlarge + - m6idn.metal + - r6i.metal + - r5.metal + - m7i.metal-24xl + - m6idn.24xlarge + - m5.24xlarge + - m7i.24xlarge + - m5ad.24xlarge + - c5.24xlarge + - r5d.24xlarge + - c5.metal + - i4i.24xlarge + - c5d.metal + - r6a.24xlarge + - r7i.24xlarge + - r5d.metal + - r5n.24xlarge + - m5d.24xlarge + - r5.24xlarge + - c5a.24xlarge + - r6id.24xlarge + - m6a.24xlarge + - r7i.metal-24xl + - c7i.metal-24xl + - c7i.24xlarge + - r5a.24xlarge + - c6a.24xlarge + - g5.24xlarge + - c5d.24xlarge + - m5d.metal + - x2iedn.24xlarge + - inf1.24xlarge + - r6i.24xlarge + - m5.metal + - c6in.24xlarge + - m6id.24xlarge + - inf2.24xlarge + - x2idn.24xlarge + - m6in.24xlarge + - g4dn.metal + - i3en.metal + - i3en.24xlarge + - m5a.24xlarge + - r5ad.24xlarge + - r5n.metal + - m6i.24xlarge + - c6i.24xlarge + - g6.24xlarge + - c5.18xlarge + - i3.metal + - c5d.18xlarge + - c5n.18xlarge + - c5n.metal + - m7gd.metal + - c6g.16xlarge + - c6gd.metal + - m7g.16xlarge + - c6gd.16xlarge + - m6gd.16xlarge + - m4.16xlarge + - r5.16xlarge + - r5n.16xlarge + - r5d.16xlarge + - m7gd.16xlarge + - r7i.16xlarge + - x2iedn.16xlarge + - m6a.16xlarge + - r6g.16xlarge + - c6a.16xlarge + - m6id.16xlarge + - r6gd.16xlarge + - r6i.16xlarge + - r6gd.metal + - r7gd.metal + - g6.16xlarge + - m6i.16xlarge + - c7i.16xlarge + - c6gn.16xlarge + - r5ad.16xlarge + - x1e.16xlarge + - c6in.16xlarge + - m5d.16xlarge + - c6g.metal + - c7gd.16xlarge + - c6i.16xlarge + - m6g.metal + - m6g.16xlarge + - m5.16xlarge + - r7g.16xlarge + - g5.16xlarge + - c7g.metal + - x2idn.16xlarge + - c5a.16xlarge + - r6id.16xlarge + - x1.16xlarge + - r7g.metal + - p2.16xlarge + - r4.16xlarge + - m6gd.metal + - m6in.16xlarge + - m5ad.16xlarge + - g4dn.16xlarge + - r6g.metal + - m5a.16xlarge + - r6a.16xlarge + - i4i.16xlarge + - r7gd.16xlarge + - c7g.16xlarge + - m7i.16xlarge + - m6idn.16xlarge + - c7gd.metal + - m7g.metal + - r5a.16xlarge + - i3.16xlarge + - r7g.12xlarge + - m6g.12xlarge + - c6a.12xlarge + - r5.12xlarge + - c5.12xlarge + - c7g.12xlarge + - c6in.12xlarge + - r6gd.12xlarge + - m6id.12xlarge + - m6in.12xlarge + - r5d.12xlarge + - m7g.12xlarge + - r5ad.12xlarge + - r5a.12xlarge + - g6.12xlarge + - g5.12xlarge + - c6g.12xlarge + - r6g.12xlarge + - m5.12xlarge + - r5n.12xlarge + - m7gd.12xlarge + - r7gd.12xlarge + - m6a.12xlarge + - i4i.12xlarge + - g4dn.12xlarge + - r7i.12xlarge + - m7i.12xlarge + - m5ad.12xlarge + - r6i.12xlarge + - c6gd.12xlarge + - c5d.12xlarge + - c7gd.12xlarge + - c6gn.12xlarge + - m6idn.12xlarge + - c7i.12xlarge + - c5a.12xlarge + - c6i.12xlarge + - z1d.metal + - r6a.12xlarge + - m6i.12xlarge + - m5a.12xlarge + - i3en.12xlarge + - m6gd.12xlarge + - r6id.12xlarge + - z1d.12xlarge + - m5d.12xlarge + - m4.10xlarge + - d2.8xlarge + - c5.9xlarge + - c5d.9xlarge + - c4.8xlarge + - c5n.9xlarge + - c7gd.8xlarge + - r6gd.8xlarge + - r5.8xlarge + - m5ad.8xlarge + - r7g.8xlarge + - g6.8xlarge + - r5d.8xlarge + - c7g.8xlarge + - g4dn.8xlarge + - r5ad.8xlarge + - i4i.8xlarge + - is4gen.8xlarge + - c5a.8xlarge + - r3.8xlarge + - r7i.8xlarge + - x1e.8xlarge + - r5n.8xlarge + - c7i.8xlarge + - r5a.8xlarge + - g5.8xlarge + - r6a.8xlarge + - c6a.8xlarge + - i3.8xlarge + - m7i-flex.8xlarge + - c6g.8xlarge + - inf2.8xlarge + - c6gn.8xlarge + - c6i.8xlarge + - r6id.8xlarge + - i2.8xlarge + - p2.8xlarge + - c6gd.8xlarge + - m6gd.8xlarge + - gr6.8xlarge + - r7gd.8xlarge + - m5a.8xlarge + - m7gd.8xlarge + - m5.8xlarge + - m6idn.8xlarge + - r6g.8xlarge + - m5d.8xlarge + - m6g.8xlarge + - r6i.8xlarge + - m6in.8xlarge + - m6id.8xlarge + - d3.8xlarge + - m6a.8xlarge + - m7g.8xlarge + - c7i-flex.8xlarge + - m6i.8xlarge + - c6in.8xlarge + - r4.8xlarge + - x2iedn.8xlarge + - m7i.8xlarge + - i3en.6xlarge + - inf1.6xlarge + - z1d.6xlarge + - c7gd.4xlarge + - c5a.4xlarge + - c6i.4xlarge + - r6id.4xlarge + - r6a.4xlarge + - r4.4xlarge + - r5.4xlarge + - m5ad.4xlarge + - g4dn.4xlarge + - c6gn.4xlarge + - c7i-flex.4xlarge + - m5d.4xlarge + - m6gd.4xlarge + - m5.4xlarge + - r7i.4xlarge + - m7i.4xlarge + - r6i.4xlarge + - d3.4xlarge + - c5n.4xlarge + - m6g.4xlarge + - c5d.4xlarge + - m6a.4xlarge + - i4i.4xlarge + - r7g.4xlarge + - m6i.4xlarge + - m4.4xlarge + - g5.4xlarge + - x1e.4xlarge + - r6g.4xlarge + - c7i.4xlarge + - gr6.4xlarge + - a1.metal + - m6idn.4xlarge + - c6g.4xlarge + - c5.4xlarge + - c6gd.4xlarge + - m6id.4xlarge + - c4.4xlarge + - is4gen.4xlarge + - g6.4xlarge + - i3.4xlarge + - r5ad.4xlarge + - r5n.4xlarge + - m5a.4xlarge + - m7g.4xlarge + - r3.4xlarge + - d2.4xlarge + - x2iedn.4xlarge + - c7g.4xlarge + - m7i-flex.4xlarge + - m6in.4xlarge + - m7gd.4xlarge + - a1.4xlarge + - i2.4xlarge + - r5a.4xlarge + - c6in.4xlarge + - r6gd.4xlarge + - r5d.4xlarge + - r7gd.4xlarge + - c6a.4xlarge + - z1d.3xlarge + - i3en.3xlarge + - mac1.metal + - m5.2xlarge + - a1.2xlarge + - d3.2xlarge + - c5.2xlarge + - m4.2xlarge + - c5n.2xlarge + - r7gd.2xlarge + - x1e.2xlarge + - t3a.2xlarge + - t4g.2xlarge + - r3.2xlarge + - r5a.2xlarge + - i4i.2xlarge + - c6i.2xlarge + - r5ad.2xlarge + - c7gd.2xlarge + - g6.2xlarge + - m6idn.2xlarge + - c5a.2xlarge + - c6g.2xlarge + - x2iedn.2xlarge + - c7i-flex.2xlarge + - inf1.2xlarge + - is4gen.2xlarge + - m6g.2xlarge + - r6i.2xlarge + - m7i.2xlarge + - m5ad.2xlarge + - g4dn.2xlarge + - m6a.2xlarge + - r7i.2xlarge + - i2.2xlarge + - m6i.2xlarge + - c4.2xlarge + - m7gd.2xlarge + - m7i-flex.2xlarge + - c7i.2xlarge + - t2.2xlarge + - i3.2xlarge + - m7g.2xlarge + - m6gd.2xlarge + - r5n.2xlarge + - c6a.2xlarge + - r4.2xlarge + - c5d.2xlarge + - g5.2xlarge + - m5a.2xlarge + - m6id.2xlarge + - d2.2xlarge + - t3.2xlarge + - r6a.2xlarge + - r5d.2xlarge + - c6gd.2xlarge + - r6g.2xlarge + - r7g.2xlarge + - r6gd.2xlarge + - c6in.2xlarge + - r6id.2xlarge + - c6gn.2xlarge + - r5.2xlarge + - m5d.2xlarge + - z1d.2xlarge + - m6in.2xlarge + - i3en.2xlarge + - c7g.2xlarge + - m7gd.xlarge + - t3a.xlarge + - r6a.xlarge + - is4gen.xlarge + - r5a.xlarge + - c5d.xlarge + - c7g.xlarge + - d2.xlarge + - g4dn.xlarge + - d3.xlarge + - m6a.xlarge + - m7i-flex.xlarge + - x1e.xlarge + - r5n.xlarge + - m6idn.xlarge + - i2.xlarge + - m6i.xlarge + - c4.xlarge + - r6id.xlarge + - m6g.xlarge + - m7i.xlarge + - m5.xlarge + - m6gd.xlarge + - c5n.xlarge + - c6in.xlarge + - r6g.xlarge + - r6gd.xlarge + - inf1.xlarge + - c6a.xlarge + - c7i.xlarge + - c5.xlarge + - r5d.xlarge + - m7g.xlarge + - m5d.xlarge + - inf2.xlarge + - r6i.xlarge + - r3.xlarge + - c7gd.xlarge + - g5.xlarge + - r5ad.xlarge + - x2iedn.xlarge + - a1.xlarge + - m5ad.xlarge + - c6i.xlarge + - i3en.xlarge + - c7i-flex.xlarge + - r7i.xlarge + - i3.xlarge + - m5a.xlarge + - c6g.xlarge + - m6in.xlarge + - t3.xlarge + - g6.xlarge + - c6gn.xlarge + - r7gd.xlarge + - c5a.xlarge + - t2.xlarge + - r4.xlarge + - z1d.xlarge + - m4.xlarge + - m6id.xlarge + - c6gd.xlarge + - t4g.xlarge + - p2.xlarge + - r7g.xlarge + - i4i.xlarge + - r5.xlarge + - m4.large + - r6id.large + - m7i-flex.large + - a1.large + - c6i.large + - m5d.large + - m7gd.large + - r4.large + - r6a.large + - is4gen.large + - i4i.large + - c5n.large + - m5.large + - c7i.large + - z1d.large + - t3a.large + - i3en.large + - r5ad.large + - t4g.medium + - c7gd.large + - c7g.large + - r3.large + - c5d.large + - t2.medium + - t3.small + - t3.medium + - m6a.large + - t2.large + - r7g.large + - t3a.medium + - r5.large + - r6g.large + - m5a.large + - m6g.large + - t4g.nano + - m6idn.large + - t3.large + - r5a.large + - r6gd.large + - r6i.large + - r7gd.large + - t3a.small + - c6a.large + - c7i-flex.large + - m6i.large + - i3.large + - c6in.large + - m5ad.large + - r7i.large + - m7i.large + - m6gd.large + - m7g.large + - t4g.micro + - r5n.large + - t3.micro + - c5a.large + - c5.large + - t4g.large + - r5d.large + - c6gd.large + - t4g.small + - c6gn.large + - t3a.nano + - t3.nano + - c6g.large + - t3a.micro + - m6in.large + - m6id.large + - c4.large + - is4gen.medium + - c7gd.medium + - c7g.medium + - r7gd.medium + - t2.nano + - m7gd.medium + - r6gd.medium + - m6g.medium + - a1.medium + - r7g.medium + - c6gd.medium + - m7g.medium + - t2.micro + - c6g.medium + - m6gd.medium + - t2.small + - c6gn.medium + - r6g.medium ap-southeast-1: - - u-6tb1.112xlarge - - u-12tb1.112xlarge - - u-9tb1.112xlarge - - u-3tb1.56xlarge - - u-6tb1.56xlarge - - c6a.48xlarge - - m6a.metal - - m7i.48xlarge - - c7i.48xlarge - - inf2.48xlarge - - m7i.metal-48xl - - r6a.metal - - c6a.metal - - r7i.metal-48xl - - c7i.metal-48xl - - m6a.48xlarge - - r7i.48xlarge - - r6a.48xlarge - - r6a.32xlarge - - r6idn.32xlarge - - x2iedn.32xlarge - - c6i.metal - - x1.32xlarge - - r6i.32xlarge - - r6id.32xlarge - - m6i.metal - - m6a.32xlarge - - x2iedn.metal - - x2idn.32xlarge - - m6id.32xlarge - - x1e.32xlarge - - m6id.metal - - c6id.metal - - r6in.metal - - m6idn.metal - - i4i.32xlarge - - c6in.32xlarge - - r6i.metal - - r6id.metal - - r6idn.metal - - c6in.metal - - r6in.32xlarge - - c6id.32xlarge - - c6i.32xlarge - - m6in.metal - - m6in.32xlarge - - i4i.metal - - c6a.32xlarge - - m6idn.32xlarge - - x2idn.metal - - m6i.32xlarge - - r5d.metal - - c5d.24xlarge - - m7i.metal-24xl - - m5dn.metal - - r5.24xlarge - - r6i.24xlarge - - m5n.metal - - m5.metal - - r5n.24xlarge - - m5n.24xlarge - - i3en.24xlarge - - m5ad.24xlarge - - r5b.24xlarge - - c7i.24xlarge - - c5.metal - - m5d.24xlarge - - r6a.24xlarge - - c5.24xlarge - - hpc6a.48xlarge - - m7i.24xlarge - - r6id.24xlarge - - m5dn.24xlarge - - c5d.metal - - m6idn.24xlarge - - i4i.24xlarge - - r5dn.metal - - m5d.metal - - r5d.24xlarge - - r7i.24xlarge - - c7i.metal-24xl - - inf2.24xlarge - - r7i.metal-24xl - - c6in.24xlarge - - r5.metal - - m6a.24xlarge - - m6id.24xlarge - - x2iedn.24xlarge - - c6a.24xlarge - - c5a.24xlarge - - m5.24xlarge - - r5a.24xlarge - - inf1.24xlarge - - c6i.24xlarge - - r5b.metal - - m6i.24xlarge - - g4dn.metal - - m6in.24xlarge - - r6in.24xlarge - - r6idn.24xlarge - - r5n.metal - - c5ad.24xlarge - - c6id.24xlarge - - r5dn.24xlarge - - m5a.24xlarge - - r5ad.24xlarge - - x2idn.24xlarge - - i3en.metal - - c5.18xlarge - - i3.metal - - c5n.metal - - c5n.18xlarge - - c5d.18xlarge - - m4.16xlarge - - m7i.16xlarge - - c6gn.16xlarge - - i3.16xlarge - - g5g.metal - - m5ad.16xlarge - - r6gd.metal - - r6g.metal - - c6gd.16xlarge - - c7i.16xlarge - - r6g.16xlarge - - r6a.16xlarge - - m6gd.16xlarge - - m6idn.16xlarge - - m7g.16xlarge - - x1.16xlarge - - p3.16xlarge - - m7gd.metal - - m6i.16xlarge - - p2.16xlarge - - m7gd.16xlarge - - r6in.16xlarge - - m5n.16xlarge - - r7gd.metal - - m7g.metal - - i4g.16xlarge - - g4dn.16xlarge - - m6in.16xlarge - - c6i.16xlarge - - r5ad.16xlarge - - g3.16xlarge - - r5n.16xlarge - - r5a.16xlarge - - g5g.16xlarge - - r6i.16xlarge - - c6id.16xlarge - - c7gd.metal - - r7i.16xlarge - - r6id.16xlarge - - r5d.16xlarge - - c7g.16xlarge - - c6a.16xlarge - - r6gd.16xlarge - - r7g.metal - - im4gn.16xlarge - - m6gd.metal - - c6g.16xlarge - - x2iedn.16xlarge - - c7g.metal - - m6g.metal - - c6in.16xlarge - - x2idn.16xlarge - - c5ad.16xlarge - - m6id.16xlarge - - m5a.16xlarge - - c6gd.metal - - r7g.16xlarge - - r4.16xlarge - - m6a.16xlarge - - r5b.16xlarge - - m5d.16xlarge - - m5.16xlarge - - r6idn.16xlarge - - x1e.16xlarge - - m6g.16xlarge - - c7gd.16xlarge - - c6g.metal - - m5dn.16xlarge - - r5.16xlarge - - i4i.16xlarge - - r7gd.16xlarge - - c5a.16xlarge - - r5dn.16xlarge - - r6id.12xlarge - - m6i.12xlarge - - m5dn.12xlarge - - d3en.12xlarge - - z1d.metal - - r5n.12xlarge - - r7gd.12xlarge - - c6id.12xlarge - - c6g.12xlarge - - r7g.12xlarge - - m5a.12xlarge - - m5.12xlarge - - r5a.12xlarge - - m6in.12xlarge - - r5ad.12xlarge - - c5.12xlarge - - r6gd.12xlarge - - m6a.12xlarge - - c7gd.12xlarge - - c7i.12xlarge - - c6gn.12xlarge - - r6idn.12xlarge - - m7gd.12xlarge - - z1d.12xlarge - - m5n.12xlarge - - c5ad.12xlarge - - i3en.12xlarge - - m5d.12xlarge - - m6id.12xlarge - - r5.12xlarge - - c7g.12xlarge - - c6gd.12xlarge - - m7i.12xlarge - - r6a.12xlarge - - m5ad.12xlarge - - m6idn.12xlarge - - r6i.12xlarge - - m6g.12xlarge - - c5a.12xlarge - - i4i.12xlarge - - r5b.12xlarge - - c6in.12xlarge - - c6a.12xlarge - - r6in.12xlarge - - m7g.12xlarge - - c6i.12xlarge - - r5dn.12xlarge - - m6gd.12xlarge - - c5d.12xlarge - - g4dn.12xlarge - - r6g.12xlarge - - m5zn.metal - - r7i.12xlarge - - r5d.12xlarge - - m5zn.12xlarge - - m4.10xlarge - - c5.9xlarge - - c4.8xlarge - - d2.8xlarge - - c5d.9xlarge - - c5n.9xlarge - - c6g.8xlarge - - p2.8xlarge - - inf2.8xlarge - - g5g.8xlarge - - i4i.8xlarge - - r6g.8xlarge - - x2iedn.8xlarge - - m6id.8xlarge - - r4.8xlarge - - m5n.8xlarge - - m6gd.8xlarge - - r6a.8xlarge - - c6i.8xlarge - - c5a.8xlarge - - m5.8xlarge - - p3.8xlarge - - r7i.8xlarge - - m6i.8xlarge - - c6in.8xlarge - - g3.8xlarge - - r3.8xlarge - - m7g.8xlarge - - m7i-flex.8xlarge - - c6id.8xlarge - - d3.8xlarge - - m6idn.8xlarge - - im4gn.8xlarge - - r5n.8xlarge - - m5ad.8xlarge - - i4g.8xlarge - - r7gd.8xlarge - - m6in.8xlarge - - r5.8xlarge - - c6a.8xlarge - - c7g.8xlarge - - c7gd.8xlarge - - d3en.8xlarge - - m7gd.8xlarge - - m6g.8xlarge - - r5a.8xlarge - - m5d.8xlarge - - c5ad.8xlarge - - x1e.8xlarge - - c7i.8xlarge - - m7i.8xlarge - - r5dn.8xlarge - - c6gd.8xlarge - - r6in.8xlarge - - r6i.8xlarge - - r7g.8xlarge - - r5ad.8xlarge - - is4gen.8xlarge - - c7i-flex.8xlarge - - r5b.8xlarge - - r5d.8xlarge - - c3.8xlarge - - i2.8xlarge - - m6a.8xlarge - - m5a.8xlarge - - r6id.8xlarge - - i3.8xlarge - - m5dn.8xlarge - - c6gn.8xlarge - - g4dn.8xlarge - - r6idn.8xlarge - - r6gd.8xlarge - - d3en.6xlarge - - m5zn.6xlarge - - z1d.6xlarge - - i3en.6xlarge - - inf1.6xlarge - - m5d.4xlarge - - r4.4xlarge - - im4gn.4xlarge - - m6idn.4xlarge - - g4dn.4xlarge - - r6idn.4xlarge - - r7i.4xlarge - - c7gd.4xlarge - - m5n.4xlarge - - c5.4xlarge - - i3.4xlarge - - c6i.4xlarge - - r7g.4xlarge - - i2.4xlarge - - m7gd.4xlarge - - r5b.4xlarge - - m6gd.4xlarge - - a1.4xlarge - - m4.4xlarge - - m7g.4xlarge - - r5a.4xlarge - - m5ad.4xlarge - - r6g.4xlarge - - c5ad.4xlarge - - m5dn.4xlarge - - m6in.4xlarge - - i4g.4xlarge - - d2.4xlarge - - r5ad.4xlarge - - c7i.4xlarge - - m7i-flex.4xlarge - - d3.4xlarge - - c7g.4xlarge - - c6gd.4xlarge - - r3.4xlarge - - a1.metal - - x1e.4xlarge - - r5.4xlarge - - r6a.4xlarge - - c6a.4xlarge - - c6id.4xlarge - - r7gd.4xlarge - - c6g.4xlarge - - i4i.4xlarge - - g3.4xlarge - - m5a.4xlarge - - c5n.4xlarge - - r5n.4xlarge - - d3en.4xlarge - - r6id.4xlarge - - m6a.4xlarge - - m5.4xlarge - - c6in.4xlarge - - r5dn.4xlarge - - g5g.4xlarge - - r6gd.4xlarge - - r6in.4xlarge - - is4gen.4xlarge - - m6id.4xlarge - - x2iedn.4xlarge - - m6g.4xlarge - - c5d.4xlarge - - c7i-flex.4xlarge - - c4.4xlarge - - c5a.4xlarge - - c6gn.4xlarge - - m6i.4xlarge - - r5d.4xlarge - - m7i.4xlarge - - c3.4xlarge - - r6i.4xlarge - - m5zn.3xlarge - - mac1.metal - - z1d.3xlarge - - i3en.3xlarge - - m5n.2xlarge - - i3en.2xlarge - - t3.2xlarge - - m7i-flex.2xlarge - - c7i-flex.2xlarge - - m6g.2xlarge - - m7i.2xlarge - - t2.2xlarge - - t3a.2xlarge - - c6i.2xlarge - - g4dn.2xlarge - - r5ad.2xlarge - - r5.2xlarge - - r6in.2xlarge - - x1e.2xlarge - - c7i.2xlarge - - x2iedn.2xlarge - - m5a.2xlarge - - r6i.2xlarge - - m6i.2xlarge - - d2.2xlarge - - m5dn.2xlarge - - r7g.2xlarge - - c6g.2xlarge - - r5d.2xlarge - - c7g.2xlarge - - m7gd.2xlarge - - c6id.2xlarge - - t4g.2xlarge - - m5d.2xlarge - - z1d.2xlarge - - c7gd.2xlarge - - m5zn.2xlarge - - r6g.2xlarge - - r7i.2xlarge - - i4g.2xlarge - - m6gd.2xlarge - - i2.2xlarge - - g5g.2xlarge - - mac2.metal - - r6id.2xlarge - - m5.2xlarge - - c6gn.2xlarge - - m4.2xlarge - - r5a.2xlarge - - i3.2xlarge - - c1.xlarge - - m2.4xlarge - - r5b.2xlarge - - c3.2xlarge - - p3.2xlarge - - m6a.2xlarge - - m6in.2xlarge - - r6gd.2xlarge - - c6a.2xlarge - - c5a.2xlarge - - m6id.2xlarge - - c5.2xlarge - - i4i.2xlarge - - m7g.2xlarge - - m5ad.2xlarge - - r3.2xlarge - - c5d.2xlarge - - r5dn.2xlarge - - c6gd.2xlarge - - d3.2xlarge - - m6idn.2xlarge - - r5n.2xlarge - - c5ad.2xlarge - - im4gn.2xlarge - - r6a.2xlarge - - r6idn.2xlarge - - c6in.2xlarge - - c5n.2xlarge - - r4.2xlarge - - d3en.2xlarge - - is4gen.2xlarge - - r7gd.2xlarge - - inf1.2xlarge - - c4.2xlarge - - a1.2xlarge - - m3.2xlarge - - r6a.xlarge - - r5n.xlarge - - g5g.xlarge - - c6gn.xlarge - - t3a.xlarge - - m3.xlarge - - r4.xlarge - - m5.xlarge - - c5n.xlarge - - r5ad.xlarge - - r6in.xlarge - - c6in.xlarge - - i3.xlarge - - im4gn.xlarge - - m6in.xlarge - - r3.xlarge - - m6g.xlarge - - r5b.xlarge - - m6idn.xlarge - - c3.xlarge - - c6g.xlarge - - c6gd.xlarge - - r6i.xlarge - - g4dn.xlarge - - m7g.xlarge - - c5d.xlarge - - x2iedn.xlarge - - r5d.xlarge - - d2.xlarge - - r6gd.xlarge - - a1.xlarge - - m5n.xlarge - - m7gd.xlarge - - m5ad.xlarge - - r7gd.xlarge - - c6a.xlarge - - r7i.xlarge - - t2.xlarge - - m5dn.xlarge - - i3en.xlarge - - d3.xlarge - - i4i.xlarge - - c6i.xlarge - - r6idn.xlarge - - r5a.xlarge - - d3en.xlarge - - c5ad.xlarge - - c7i.xlarge - - m4.xlarge - - c5.xlarge - - m5a.xlarge - - m6gd.xlarge - - inf2.xlarge - - m7i-flex.xlarge - - inf1.xlarge - - i2.xlarge - - r7g.xlarge - - c6id.xlarge - - r5.xlarge - - c4.xlarge - - m6a.xlarge - - m7i.xlarge - - m6i.xlarge - - c7i-flex.xlarge - - t4g.xlarge - - r5dn.xlarge - - c7gd.xlarge - - m6id.xlarge - - m5zn.xlarge - - t3.xlarge - - r6id.xlarge - - m1.xlarge - - x1e.xlarge - - m5d.xlarge - - c5a.xlarge - - i4g.xlarge - - r6g.xlarge - - z1d.xlarge - - is4gen.xlarge - - c7g.xlarge - - p2.xlarge - - m2.2xlarge - - i4i.large - - m5dn.large - - m7i.large - - im4gn.large - - m7i-flex.large - - r6id.large - - r6a.large - - c7g.large - - m5.large - - m7g.large - - c3.large - - t4g.micro - - m2.xlarge - - i3en.large - - t2.large - - c5ad.large - - c4.large - - t2.medium - - r5b.large - - t3a.medium - - m4.large - - r4.large - - is4gen.large - - t3.small - - r5ad.large - - t4g.nano - - c6gn.large - - t3a.large - - c7gd.large - - r7g.large - - m3.large - - t3a.nano - - t3.medium - - t3.large - - r6in.large - - c1.medium - - c5d.large - - a1.large - - r3.large - - c5.large - - r5.large - - z1d.large - - t3a.small - - c6a.large - - m1.large - - t4g.small - - m6i.large - - r6g.large - - r6i.large - - m5d.large - - m6in.large - - m6id.large - - c5a.large - - m5ad.large - - m6gd.large - - c6i.large - - i4g.large - - m5n.large - - r5dn.large - - m5a.large - - r7gd.large - - t3a.micro - - m6g.large - - r7i.large - - c6in.large - - m6idn.large - - m7gd.large - - m6a.large - - c6id.large - - r6idn.large - - t3.nano - - m5zn.large - - r6gd.large - - c6g.large - - t3.micro - - c7i.large - - i3.large - - r5a.large - - t4g.medium - - c7i-flex.large - - c6gd.large - - c5n.large - - r5d.large - - t4g.large - - r5n.large - - t2.micro - - t2.small - - r6gd.medium - - a1.medium - - t2.nano - - m7g.medium - - r7g.medium - - c6gd.medium - - m7gd.medium - - m6gd.medium - - m6g.medium - - c6gn.medium - - c7gd.medium - - m1.medium - - t1.micro - - m1.small - - c7g.medium - - is4gen.medium - - c6g.medium - - m3.medium - - r6g.medium - - r7gd.medium + - u-6tb1.112xlarge + - u-12tb1.112xlarge + - u-9tb1.112xlarge + - u-3tb1.56xlarge + - u-6tb1.56xlarge + - c6a.48xlarge + - m6a.metal + - m7i.48xlarge + - c7i.48xlarge + - inf2.48xlarge + - m7i.metal-48xl + - r6a.metal + - c6a.metal + - r7i.metal-48xl + - c7i.metal-48xl + - m6a.48xlarge + - r7i.48xlarge + - r6a.48xlarge + - r6a.32xlarge + - r6idn.32xlarge + - x2iedn.32xlarge + - c6i.metal + - x1.32xlarge + - r6i.32xlarge + - r6id.32xlarge + - m6i.metal + - m6a.32xlarge + - x2iedn.metal + - x2idn.32xlarge + - m6id.32xlarge + - x1e.32xlarge + - m6id.metal + - c6id.metal + - r6in.metal + - m6idn.metal + - i4i.32xlarge + - c6in.32xlarge + - r6i.metal + - r6id.metal + - r6idn.metal + - c6in.metal + - r6in.32xlarge + - c6id.32xlarge + - c6i.32xlarge + - m6in.metal + - m6in.32xlarge + - i4i.metal + - c6a.32xlarge + - m6idn.32xlarge + - x2idn.metal + - m6i.32xlarge + - r5d.metal + - c5d.24xlarge + - m7i.metal-24xl + - m5dn.metal + - r5.24xlarge + - r6i.24xlarge + - m5n.metal + - m5.metal + - r5n.24xlarge + - m5n.24xlarge + - i3en.24xlarge + - m5ad.24xlarge + - r5b.24xlarge + - c7i.24xlarge + - c5.metal + - m5d.24xlarge + - r6a.24xlarge + - c5.24xlarge + - hpc6a.48xlarge + - m7i.24xlarge + - r6id.24xlarge + - m5dn.24xlarge + - c5d.metal + - m6idn.24xlarge + - i4i.24xlarge + - r5dn.metal + - m5d.metal + - r5d.24xlarge + - r7i.24xlarge + - c7i.metal-24xl + - inf2.24xlarge + - r7i.metal-24xl + - c6in.24xlarge + - r5.metal + - m6a.24xlarge + - m6id.24xlarge + - x2iedn.24xlarge + - c6a.24xlarge + - c5a.24xlarge + - m5.24xlarge + - r5a.24xlarge + - inf1.24xlarge + - c6i.24xlarge + - r5b.metal + - m6i.24xlarge + - g4dn.metal + - m6in.24xlarge + - r6in.24xlarge + - r6idn.24xlarge + - r5n.metal + - c5ad.24xlarge + - c6id.24xlarge + - r5dn.24xlarge + - m5a.24xlarge + - r5ad.24xlarge + - x2idn.24xlarge + - i3en.metal + - c5.18xlarge + - i3.metal + - c5n.metal + - c5n.18xlarge + - c5d.18xlarge + - m4.16xlarge + - m7i.16xlarge + - c6gn.16xlarge + - i3.16xlarge + - g5g.metal + - m5ad.16xlarge + - r6gd.metal + - r6g.metal + - c6gd.16xlarge + - c7i.16xlarge + - r6g.16xlarge + - r6a.16xlarge + - m6gd.16xlarge + - m6idn.16xlarge + - m7g.16xlarge + - x1.16xlarge + - p3.16xlarge + - m7gd.metal + - m6i.16xlarge + - p2.16xlarge + - m7gd.16xlarge + - r6in.16xlarge + - m5n.16xlarge + - r7gd.metal + - m7g.metal + - i4g.16xlarge + - g4dn.16xlarge + - m6in.16xlarge + - c6i.16xlarge + - r5ad.16xlarge + - g3.16xlarge + - r5n.16xlarge + - r5a.16xlarge + - g5g.16xlarge + - r6i.16xlarge + - c6id.16xlarge + - c7gd.metal + - r7i.16xlarge + - r6id.16xlarge + - r5d.16xlarge + - c7g.16xlarge + - c6a.16xlarge + - r6gd.16xlarge + - r7g.metal + - im4gn.16xlarge + - m6gd.metal + - c6g.16xlarge + - x2iedn.16xlarge + - c7g.metal + - m6g.metal + - c6in.16xlarge + - x2idn.16xlarge + - c5ad.16xlarge + - m6id.16xlarge + - m5a.16xlarge + - c6gd.metal + - r7g.16xlarge + - r4.16xlarge + - m6a.16xlarge + - r5b.16xlarge + - m5d.16xlarge + - m5.16xlarge + - r6idn.16xlarge + - x1e.16xlarge + - m6g.16xlarge + - c7gd.16xlarge + - c6g.metal + - m5dn.16xlarge + - r5.16xlarge + - i4i.16xlarge + - r7gd.16xlarge + - c5a.16xlarge + - r5dn.16xlarge + - r6id.12xlarge + - m6i.12xlarge + - m5dn.12xlarge + - d3en.12xlarge + - z1d.metal + - r5n.12xlarge + - r7gd.12xlarge + - c6id.12xlarge + - c6g.12xlarge + - r7g.12xlarge + - m5a.12xlarge + - m5.12xlarge + - r5a.12xlarge + - m6in.12xlarge + - r5ad.12xlarge + - c5.12xlarge + - r6gd.12xlarge + - m6a.12xlarge + - c7gd.12xlarge + - c7i.12xlarge + - c6gn.12xlarge + - r6idn.12xlarge + - m7gd.12xlarge + - z1d.12xlarge + - m5n.12xlarge + - c5ad.12xlarge + - i3en.12xlarge + - m5d.12xlarge + - m6id.12xlarge + - r5.12xlarge + - c7g.12xlarge + - c6gd.12xlarge + - m7i.12xlarge + - r6a.12xlarge + - m5ad.12xlarge + - m6idn.12xlarge + - r6i.12xlarge + - m6g.12xlarge + - c5a.12xlarge + - i4i.12xlarge + - r5b.12xlarge + - c6in.12xlarge + - c6a.12xlarge + - r6in.12xlarge + - m7g.12xlarge + - c6i.12xlarge + - r5dn.12xlarge + - m6gd.12xlarge + - c5d.12xlarge + - g4dn.12xlarge + - r6g.12xlarge + - m5zn.metal + - r7i.12xlarge + - r5d.12xlarge + - m5zn.12xlarge + - m4.10xlarge + - c5.9xlarge + - c4.8xlarge + - d2.8xlarge + - c5d.9xlarge + - c5n.9xlarge + - c6g.8xlarge + - p2.8xlarge + - inf2.8xlarge + - g5g.8xlarge + - i4i.8xlarge + - r6g.8xlarge + - x2iedn.8xlarge + - m6id.8xlarge + - r4.8xlarge + - m5n.8xlarge + - m6gd.8xlarge + - r6a.8xlarge + - c6i.8xlarge + - c5a.8xlarge + - m5.8xlarge + - p3.8xlarge + - r7i.8xlarge + - m6i.8xlarge + - c6in.8xlarge + - g3.8xlarge + - r3.8xlarge + - m7g.8xlarge + - m7i-flex.8xlarge + - c6id.8xlarge + - d3.8xlarge + - m6idn.8xlarge + - im4gn.8xlarge + - r5n.8xlarge + - m5ad.8xlarge + - i4g.8xlarge + - r7gd.8xlarge + - m6in.8xlarge + - r5.8xlarge + - c6a.8xlarge + - c7g.8xlarge + - c7gd.8xlarge + - d3en.8xlarge + - m7gd.8xlarge + - m6g.8xlarge + - r5a.8xlarge + - m5d.8xlarge + - c5ad.8xlarge + - x1e.8xlarge + - c7i.8xlarge + - m7i.8xlarge + - r5dn.8xlarge + - c6gd.8xlarge + - r6in.8xlarge + - r6i.8xlarge + - r7g.8xlarge + - r5ad.8xlarge + - is4gen.8xlarge + - c7i-flex.8xlarge + - r5b.8xlarge + - r5d.8xlarge + - c3.8xlarge + - i2.8xlarge + - m6a.8xlarge + - m5a.8xlarge + - r6id.8xlarge + - i3.8xlarge + - m5dn.8xlarge + - c6gn.8xlarge + - g4dn.8xlarge + - r6idn.8xlarge + - r6gd.8xlarge + - d3en.6xlarge + - m5zn.6xlarge + - z1d.6xlarge + - i3en.6xlarge + - inf1.6xlarge + - m5d.4xlarge + - r4.4xlarge + - im4gn.4xlarge + - m6idn.4xlarge + - g4dn.4xlarge + - r6idn.4xlarge + - r7i.4xlarge + - c7gd.4xlarge + - m5n.4xlarge + - c5.4xlarge + - i3.4xlarge + - c6i.4xlarge + - r7g.4xlarge + - i2.4xlarge + - m7gd.4xlarge + - r5b.4xlarge + - m6gd.4xlarge + - a1.4xlarge + - m4.4xlarge + - m7g.4xlarge + - r5a.4xlarge + - m5ad.4xlarge + - r6g.4xlarge + - c5ad.4xlarge + - m5dn.4xlarge + - m6in.4xlarge + - i4g.4xlarge + - d2.4xlarge + - r5ad.4xlarge + - c7i.4xlarge + - m7i-flex.4xlarge + - d3.4xlarge + - c7g.4xlarge + - c6gd.4xlarge + - r3.4xlarge + - a1.metal + - x1e.4xlarge + - r5.4xlarge + - r6a.4xlarge + - c6a.4xlarge + - c6id.4xlarge + - r7gd.4xlarge + - c6g.4xlarge + - i4i.4xlarge + - g3.4xlarge + - m5a.4xlarge + - c5n.4xlarge + - r5n.4xlarge + - d3en.4xlarge + - r6id.4xlarge + - m6a.4xlarge + - m5.4xlarge + - c6in.4xlarge + - r5dn.4xlarge + - g5g.4xlarge + - r6gd.4xlarge + - r6in.4xlarge + - is4gen.4xlarge + - m6id.4xlarge + - x2iedn.4xlarge + - m6g.4xlarge + - c5d.4xlarge + - c7i-flex.4xlarge + - c4.4xlarge + - c5a.4xlarge + - c6gn.4xlarge + - m6i.4xlarge + - r5d.4xlarge + - m7i.4xlarge + - c3.4xlarge + - r6i.4xlarge + - m5zn.3xlarge + - mac1.metal + - z1d.3xlarge + - i3en.3xlarge + - m5n.2xlarge + - i3en.2xlarge + - t3.2xlarge + - m7i-flex.2xlarge + - c7i-flex.2xlarge + - m6g.2xlarge + - m7i.2xlarge + - t2.2xlarge + - t3a.2xlarge + - c6i.2xlarge + - g4dn.2xlarge + - r5ad.2xlarge + - r5.2xlarge + - r6in.2xlarge + - x1e.2xlarge + - c7i.2xlarge + - x2iedn.2xlarge + - m5a.2xlarge + - r6i.2xlarge + - m6i.2xlarge + - d2.2xlarge + - m5dn.2xlarge + - r7g.2xlarge + - c6g.2xlarge + - r5d.2xlarge + - c7g.2xlarge + - m7gd.2xlarge + - c6id.2xlarge + - t4g.2xlarge + - m5d.2xlarge + - z1d.2xlarge + - c7gd.2xlarge + - m5zn.2xlarge + - r6g.2xlarge + - r7i.2xlarge + - i4g.2xlarge + - m6gd.2xlarge + - i2.2xlarge + - g5g.2xlarge + - mac2.metal + - r6id.2xlarge + - m5.2xlarge + - c6gn.2xlarge + - m4.2xlarge + - r5a.2xlarge + - i3.2xlarge + - c1.xlarge + - m2.4xlarge + - r5b.2xlarge + - c3.2xlarge + - p3.2xlarge + - m6a.2xlarge + - m6in.2xlarge + - r6gd.2xlarge + - c6a.2xlarge + - c5a.2xlarge + - m6id.2xlarge + - c5.2xlarge + - i4i.2xlarge + - m7g.2xlarge + - m5ad.2xlarge + - r3.2xlarge + - c5d.2xlarge + - r5dn.2xlarge + - c6gd.2xlarge + - d3.2xlarge + - m6idn.2xlarge + - r5n.2xlarge + - c5ad.2xlarge + - im4gn.2xlarge + - r6a.2xlarge + - r6idn.2xlarge + - c6in.2xlarge + - c5n.2xlarge + - r4.2xlarge + - d3en.2xlarge + - is4gen.2xlarge + - r7gd.2xlarge + - inf1.2xlarge + - c4.2xlarge + - a1.2xlarge + - m3.2xlarge + - r6a.xlarge + - r5n.xlarge + - g5g.xlarge + - c6gn.xlarge + - t3a.xlarge + - m3.xlarge + - r4.xlarge + - m5.xlarge + - c5n.xlarge + - r5ad.xlarge + - r6in.xlarge + - c6in.xlarge + - i3.xlarge + - im4gn.xlarge + - m6in.xlarge + - r3.xlarge + - m6g.xlarge + - r5b.xlarge + - m6idn.xlarge + - c3.xlarge + - c6g.xlarge + - c6gd.xlarge + - r6i.xlarge + - g4dn.xlarge + - m7g.xlarge + - c5d.xlarge + - x2iedn.xlarge + - r5d.xlarge + - d2.xlarge + - r6gd.xlarge + - a1.xlarge + - m5n.xlarge + - m7gd.xlarge + - m5ad.xlarge + - r7gd.xlarge + - c6a.xlarge + - r7i.xlarge + - t2.xlarge + - m5dn.xlarge + - i3en.xlarge + - d3.xlarge + - i4i.xlarge + - c6i.xlarge + - r6idn.xlarge + - r5a.xlarge + - d3en.xlarge + - c5ad.xlarge + - c7i.xlarge + - m4.xlarge + - c5.xlarge + - m5a.xlarge + - m6gd.xlarge + - inf2.xlarge + - m7i-flex.xlarge + - inf1.xlarge + - i2.xlarge + - r7g.xlarge + - c6id.xlarge + - r5.xlarge + - c4.xlarge + - m6a.xlarge + - m7i.xlarge + - m6i.xlarge + - c7i-flex.xlarge + - t4g.xlarge + - r5dn.xlarge + - c7gd.xlarge + - m6id.xlarge + - m5zn.xlarge + - t3.xlarge + - r6id.xlarge + - m1.xlarge + - x1e.xlarge + - m5d.xlarge + - c5a.xlarge + - i4g.xlarge + - r6g.xlarge + - z1d.xlarge + - is4gen.xlarge + - c7g.xlarge + - p2.xlarge + - m2.2xlarge + - i4i.large + - m5dn.large + - m7i.large + - im4gn.large + - m7i-flex.large + - r6id.large + - r6a.large + - c7g.large + - m5.large + - m7g.large + - c3.large + - t4g.micro + - m2.xlarge + - i3en.large + - t2.large + - c5ad.large + - c4.large + - t2.medium + - r5b.large + - t3a.medium + - m4.large + - r4.large + - is4gen.large + - t3.small + - r5ad.large + - t4g.nano + - c6gn.large + - t3a.large + - c7gd.large + - r7g.large + - m3.large + - t3a.nano + - t3.medium + - t3.large + - r6in.large + - c1.medium + - c5d.large + - a1.large + - r3.large + - c5.large + - r5.large + - z1d.large + - t3a.small + - c6a.large + - m1.large + - t4g.small + - m6i.large + - r6g.large + - r6i.large + - m5d.large + - m6in.large + - m6id.large + - c5a.large + - m5ad.large + - m6gd.large + - c6i.large + - i4g.large + - m5n.large + - r5dn.large + - m5a.large + - r7gd.large + - t3a.micro + - m6g.large + - r7i.large + - c6in.large + - m6idn.large + - m7gd.large + - m6a.large + - c6id.large + - r6idn.large + - t3.nano + - m5zn.large + - r6gd.large + - c6g.large + - t3.micro + - c7i.large + - i3.large + - r5a.large + - t4g.medium + - c7i-flex.large + - c6gd.large + - c5n.large + - r5d.large + - t4g.large + - r5n.large + - t2.micro + - t2.small + - r6gd.medium + - a1.medium + - t2.nano + - m7g.medium + - r7g.medium + - c6gd.medium + - m7gd.medium + - m6gd.medium + - m6g.medium + - c6gn.medium + - c7gd.medium + - m1.medium + - t1.micro + - m1.small + - c7g.medium + - is4gen.medium + - c6g.medium + - m3.medium + - r6g.medium + - r7gd.medium ap-southeast-2: - - u7in-16tb.224xlarge - - u-6tb1.112xlarge - - u-12tb1.112xlarge - - u-3tb1.56xlarge - - u-6tb1.56xlarge - - m7i.metal-48xl - - r6a.metal - - m7i.48xlarge - - c7i.48xlarge - - r7i.48xlarge - - c6a.metal - - c6a.48xlarge - - g6.48xlarge - - c7i.metal-48xl - - g5.48xlarge - - r6a.48xlarge - - m6a.metal - - m6a.48xlarge - - r7i.metal-48xl - - inf2.48xlarge - - m6in.32xlarge - - c6id.32xlarge - - c6in.metal - - x2idn.metal - - m6in.metal - - i4i.metal - - r6i.metal - - r6a.32xlarge - - r6id.metal - - c6id.metal - - m6i.32xlarge - - x2idn.32xlarge - - m6id.32xlarge - - x1e.32xlarge - - r6idn.metal - - c6i.metal - - m6id.metal - - x2iedn.metal - - c6a.32xlarge - - m6a.32xlarge - - x1.32xlarge - - i4i.32xlarge - - r6i.32xlarge - - r6idn.32xlarge - - m6i.metal - - r6in.metal - - r6in.32xlarge - - c6i.32xlarge - - m6idn.metal - - c6in.32xlarge - - r6id.32xlarge - - m6idn.32xlarge - - x2iedn.32xlarge - - inf2.24xlarge - - g5.24xlarge - - r7i.24xlarge - - r6i.24xlarge - - x2idn.24xlarge - - c5.metal - - r5dn.metal - - r5ad.24xlarge - - m6id.24xlarge - - c5.24xlarge - - r5a.24xlarge - - m6i.24xlarge - - r5d.24xlarge - - m5ad.24xlarge - - inf1.24xlarge - - r7i.metal-24xl - - g4dn.metal - - r5b.metal - - m5d.24xlarge - - x2iedn.24xlarge - - r5d.metal - - r6in.24xlarge - - r6id.24xlarge - - r5.24xlarge - - r5n.24xlarge - - c5ad.24xlarge - - i3en.metal - - c6id.24xlarge - - g6.24xlarge - - m6idn.24xlarge - - m6a.24xlarge - - m5a.24xlarge - - r5b.24xlarge - - c6a.24xlarge - - i4i.24xlarge - - i3en.24xlarge - - r5dn.24xlarge - - c5a.24xlarge - - c7i.24xlarge - - r6idn.24xlarge - - m5d.metal - - r5n.metal - - r6a.24xlarge - - m5.24xlarge - - m7i.metal-24xl - - c6in.24xlarge - - r5.metal - - m6in.24xlarge - - hpc6a.48xlarge - - c6i.24xlarge - - m7i.24xlarge - - c7i.metal-24xl - - c5d.metal - - c5d.24xlarge - - m5.metal - - c5n.metal - - c5.18xlarge - - c5d.18xlarge - - c5n.18xlarge - - i3.metal - - r6g.16xlarge - - c6g.metal - - r7gd.16xlarge - - c6gd.metal - - c7i.16xlarge - - c5a.16xlarge - - r5dn.16xlarge - - r5b.16xlarge - - c6id.16xlarge - - r6a.16xlarge - - r5ad.16xlarge - - c6in.16xlarge - - i3.16xlarge - - r5n.16xlarge - - r6gd.metal - - m5a.16xlarge - - m6i.16xlarge - - c5ad.16xlarge - - c7g.metal - - r5a.16xlarge - - x1e.16xlarge - - m6in.16xlarge - - c7gd.metal - - c6gd.16xlarge - - r7g.16xlarge - - g3.16xlarge - - m6gd.16xlarge - - f1.16xlarge - - m6g.16xlarge - - m6gd.metal - - x2iedn.16xlarge - - m7gd.metal - - c6i.16xlarge - - m4.16xlarge - - r6i.16xlarge - - r6in.16xlarge - - m7g.16xlarge - - c6g.16xlarge - - x1.16xlarge - - r6idn.16xlarge - - r5d.16xlarge - - m7g.metal - - m6id.16xlarge - - r7gd.metal - - c6a.16xlarge - - m5ad.16xlarge - - p3.16xlarge - - m6a.16xlarge - - g4dn.16xlarge - - i4i.16xlarge - - r6id.16xlarge - - r6gd.16xlarge - - x2idn.16xlarge - - r5.16xlarge - - m7i.16xlarge - - r7g.metal - - r6g.metal - - r7i.16xlarge - - m5.16xlarge - - g6.16xlarge - - m6g.metal - - c6gn.16xlarge - - p2.16xlarge - - c7g.16xlarge - - m7gd.16xlarge - - c7gd.16xlarge - - m5d.16xlarge - - g5.16xlarge - - m6idn.16xlarge - - r4.16xlarge - - im4gn.16xlarge - - z1d.12xlarge - - c6a.12xlarge - - c6gn.12xlarge - - c6i.12xlarge - - r6idn.12xlarge - - r5n.12xlarge - - i4i.12xlarge - - r6gd.12xlarge - - r5b.12xlarge - - m5ad.12xlarge - - i3en.12xlarge - - c6gd.12xlarge - - r7gd.12xlarge - - g6.12xlarge - - g5.12xlarge - - m6id.12xlarge - - r5d.12xlarge - - r5.12xlarge - - c7g.12xlarge - - m5zn.metal - - c6id.12xlarge - - m5zn.12xlarge - - r6in.12xlarge - - d3en.12xlarge - - m6i.12xlarge - - c7gd.12xlarge - - r6i.12xlarge - - g4dn.12xlarge - - m5d.12xlarge - - m6in.12xlarge - - c6in.12xlarge - - c5ad.12xlarge - - c7i.12xlarge - - z1d.metal - - r6a.12xlarge - - r7g.12xlarge - - m7gd.12xlarge - - m5a.12xlarge - - r7i.12xlarge - - m6g.12xlarge - - c5.12xlarge - - m7i.12xlarge - - c5d.12xlarge - - c5a.12xlarge - - m6idn.12xlarge - - m6a.12xlarge - - m5.12xlarge - - c6g.12xlarge - - r6id.12xlarge - - r5dn.12xlarge - - r5a.12xlarge - - m6gd.12xlarge - - r5ad.12xlarge - - m7g.12xlarge - - r6g.12xlarge - - m4.10xlarge - - c4.8xlarge - - c5d.9xlarge - - c5n.9xlarge - - d2.8xlarge - - c5.9xlarge - - d3en.8xlarge - - c6i.8xlarge - - c6in.8xlarge - - m6gd.8xlarge - - r6id.8xlarge - - r5dn.8xlarge - - m7gd.8xlarge - - c3.8xlarge - - r5d.8xlarge - - im4gn.8xlarge - - r3.8xlarge - - m5.8xlarge - - r7i.8xlarge - - i3.8xlarge - - c6id.8xlarge - - r6gd.8xlarge - - m6a.8xlarge - - m6id.8xlarge - - r7gd.8xlarge - - c6gd.8xlarge - - r5a.8xlarge - - c6a.8xlarge - - r5n.8xlarge - - m7i.8xlarge - - p2.8xlarge - - m5ad.8xlarge - - i4i.8xlarge - - r5.8xlarge - - i2.8xlarge - - c6gn.8xlarge - - r6in.8xlarge - - inf2.8xlarge - - c7gd.8xlarge - - c7i-flex.8xlarge - - c7g.8xlarge - - d3.8xlarge - - m6i.8xlarge - - p3.8xlarge - - x1e.8xlarge - - c5ad.8xlarge - - gr6.8xlarge - - r4.8xlarge - - c6g.8xlarge - - c7i.8xlarge - - x2iedn.8xlarge - - r6i.8xlarge - - m6in.8xlarge - - g3.8xlarge - - g5.8xlarge - - g6.8xlarge - - m5a.8xlarge - - m7i-flex.8xlarge - - r5ad.8xlarge - - m6g.8xlarge - - r5b.8xlarge - - r6a.8xlarge - - is4gen.8xlarge - - g4dn.8xlarge - - r6idn.8xlarge - - c5a.8xlarge - - m5d.8xlarge - - m7g.8xlarge - - m6idn.8xlarge - - r7g.8xlarge - - r6g.8xlarge - - d3en.6xlarge - - z1d.6xlarge - - i3en.6xlarge - - inf1.6xlarge - - m5zn.6xlarge - - c6a.4xlarge - - c6id.4xlarge - - m5a.4xlarge - - c4.4xlarge - - r6a.4xlarge - - x2iedn.4xlarge - - f1.4xlarge - - m6g.4xlarge - - r7i.4xlarge - - c5ad.4xlarge - - im4gn.4xlarge - - r6in.4xlarge - - m7i-flex.4xlarge - - a1.metal - - g3.4xlarge - - c7gd.4xlarge - - m6idn.4xlarge - - r5n.4xlarge - - r5b.4xlarge - - c6in.4xlarge - - r3.4xlarge - - c5n.4xlarge - - r5.4xlarge - - r4.4xlarge - - m7g.4xlarge - - m6i.4xlarge - - d3.4xlarge - - g6.4xlarge - - r6gd.4xlarge - - i2.4xlarge - - m7gd.4xlarge - - r6idn.4xlarge - - m5d.4xlarge - - r6g.4xlarge - - r5a.4xlarge - - d3en.4xlarge - - x1e.4xlarge - - c7i-flex.4xlarge - - is4gen.4xlarge - - r6id.4xlarge - - m5ad.4xlarge - - c7g.4xlarge - - d2.4xlarge - - gr6.4xlarge - - c3.4xlarge - - c6g.4xlarge - - r5ad.4xlarge - - c5a.4xlarge - - m7i.4xlarge - - c6gd.4xlarge - - r5dn.4xlarge - - a1.4xlarge - - g4dn.4xlarge - - r7g.4xlarge - - r6i.4xlarge - - i3.4xlarge - - c6i.4xlarge - - m6gd.4xlarge - - c7i.4xlarge - - m6id.4xlarge - - m4.4xlarge - - c5.4xlarge - - m6a.4xlarge - - m6in.4xlarge - - m5.4xlarge - - i4i.4xlarge - - r7gd.4xlarge - - c5d.4xlarge - - c6gn.4xlarge - - r5d.4xlarge - - g5.4xlarge - - z1d.3xlarge - - i3en.3xlarge - - mac1.metal - - mac2-m2pro.metal - - m5zn.3xlarge - - c6g.2xlarge - - g6.2xlarge - - f1.2xlarge - - r5d.2xlarge - - d3.2xlarge - - c4.2xlarge - - r5ad.2xlarge - - m6idn.2xlarge - - r5a.2xlarge - - r4.2xlarge - - inf1.2xlarge - - c5a.2xlarge - - g5.2xlarge - - t3a.2xlarge - - c7g.2xlarge - - c7gd.2xlarge - - g4dn.2xlarge - - i4i.2xlarge - - r6idn.2xlarge - - r6g.2xlarge - - m5a.2xlarge - - x2iedn.2xlarge - - r6id.2xlarge - - m5zn.2xlarge - - c6i.2xlarge - - r7g.2xlarge - - m7g.2xlarge - - m5ad.2xlarge - - d2.2xlarge - - m6a.2xlarge - - r5dn.2xlarge - - m3.2xlarge - - m2.4xlarge - - c6a.2xlarge - - m6g.2xlarge - - m4.2xlarge - - r7i.2xlarge - - p3.2xlarge - - m6in.2xlarge - - x1e.2xlarge - - r6in.2xlarge - - c6id.2xlarge - - t2.2xlarge - - i3en.2xlarge - - m6id.2xlarge - - im4gn.2xlarge - - m7gd.2xlarge - - c5ad.2xlarge - - r6i.2xlarge - - m7i.2xlarge - - c5n.2xlarge - - c6gn.2xlarge - - a1.2xlarge - - d3en.2xlarge - - mac2-m2.metal - - r5.2xlarge - - m6i.2xlarge - - c5.2xlarge - - i2.2xlarge - - m7i-flex.2xlarge - - t4g.2xlarge - - c6in.2xlarge - - c6gd.2xlarge - - r6gd.2xlarge - - r6a.2xlarge - - c7i-flex.2xlarge - - t3.2xlarge - - c5d.2xlarge - - c7i.2xlarge - - m5.2xlarge - - m5d.2xlarge - - i3.2xlarge - - c3.2xlarge - - c1.xlarge - - is4gen.2xlarge - - r3.2xlarge - - r5b.2xlarge - - m6gd.2xlarge - - z1d.2xlarge - - r5n.2xlarge - - r7gd.2xlarge - - r3.xlarge - - r6id.xlarge - - m4.xlarge - - r7g.xlarge - - m6gd.xlarge - - d3en.xlarge - - g6.xlarge - - r5.xlarge - - r6gd.xlarge - - c5a.xlarge - - g4dn.xlarge - - t4g.xlarge - - r5dn.xlarge - - r6in.xlarge - - z1d.xlarge - - x2iedn.xlarge - - m5ad.xlarge - - r5ad.xlarge - - inf2.xlarge - - a1.xlarge - - c7g.xlarge - - r6i.xlarge - - c7i.xlarge - - r5n.xlarge - - c7i-flex.xlarge - - g5.xlarge - - c5d.xlarge - - c6in.xlarge - - m7i-flex.xlarge - - im4gn.xlarge - - t3a.xlarge - - t3.xlarge - - r7gd.xlarge - - c5.xlarge - - m6a.xlarge - - m6in.xlarge - - m2.2xlarge - - c5ad.xlarge - - c5n.xlarge - - d2.xlarge - - d3.xlarge - - c6id.xlarge - - is4gen.xlarge - - c6a.xlarge - - m6id.xlarge - - m6i.xlarge - - m3.xlarge - - m5zn.xlarge - - g3s.xlarge - - c6gd.xlarge - - m7gd.xlarge - - c6gn.xlarge - - r7i.xlarge - - c7gd.xlarge - - c4.xlarge - - i3.xlarge - - inf1.xlarge - - c6g.xlarge - - r5b.xlarge - - r4.xlarge - - m5a.xlarge - - m1.xlarge - - c3.xlarge - - m6g.xlarge - - p2.xlarge - - r5d.xlarge - - c6i.xlarge - - m7g.xlarge - - i3en.xlarge - - t2.xlarge - - m7i.xlarge - - i2.xlarge - - x1e.xlarge - - m5d.xlarge - - r6a.xlarge - - m6idn.xlarge - - r6g.xlarge - - r6idn.xlarge - - i4i.xlarge - - r5a.xlarge - - m5.xlarge - - c5.large - - r5.large - - t4g.large - - i3en.large - - c5n.large - - c4.large - - r6idn.large - - i4i.large - - m6g.large - - r5dn.large - - r7gd.large - - z1d.large - - r5d.large - - t4g.micro - - r6in.large - - m5d.large - - t4g.small - - m3.large - - r4.large - - c6in.large - - t3.small - - m7i.large - - t4g.medium - - r6g.large - - m5a.large - - r5a.large - - c5d.large - - c5a.large - - t3.nano - - c7i.large - - t4g.nano - - m5zn.large - - r5b.large - - m7i-flex.large - - c3.large - - m6gd.large - - t3a.large - - t3.micro - - m7g.large - - c6g.large - - m6id.large - - r6a.large - - a1.large - - c7i-flex.large - - c6a.large - - r3.large - - r7g.large - - t2.large - - m6i.large - - m6in.large - - r5n.large - - m6a.large - - c6id.large - - m6idn.large - - r6id.large - - r7i.large - - m5.large - - t3a.micro - - is4gen.large - - m2.xlarge - - t2.medium - - m4.large - - im4gn.large - - c6i.large - - t3.medium - - r6i.large - - r5ad.large - - c7gd.large - - m7gd.large - - c1.medium - - t3a.nano - - c7g.large - - t3a.medium - - m5ad.large - - c6gn.large - - t3.large - - c5ad.large - - i3.large - - r6gd.large - - m1.large - - t3a.small - - c6gd.large - - r7g.medium - - t2.micro - - r7gd.medium - - m6gd.medium - - a1.medium - - c6gn.medium - - m7g.medium - - m1.medium - - r6g.medium - - c6gd.medium - - c6g.medium - - m7gd.medium - - m3.medium - - r6gd.medium - - c7g.medium - - t1.micro - - is4gen.medium - - m6g.medium - - t2.small - - t2.nano - - c7gd.medium - - m1.small + - u7in-16tb.224xlarge + - u-6tb1.112xlarge + - u-12tb1.112xlarge + - u-3tb1.56xlarge + - u-6tb1.56xlarge + - m7i.metal-48xl + - r6a.metal + - m7i.48xlarge + - c7i.48xlarge + - r7i.48xlarge + - c6a.metal + - c6a.48xlarge + - g6.48xlarge + - c7i.metal-48xl + - g5.48xlarge + - r6a.48xlarge + - m6a.metal + - m6a.48xlarge + - r7i.metal-48xl + - inf2.48xlarge + - m6in.32xlarge + - c6id.32xlarge + - c6in.metal + - x2idn.metal + - m6in.metal + - i4i.metal + - r6i.metal + - r6a.32xlarge + - r6id.metal + - c6id.metal + - m6i.32xlarge + - x2idn.32xlarge + - m6id.32xlarge + - x1e.32xlarge + - r6idn.metal + - c6i.metal + - m6id.metal + - x2iedn.metal + - c6a.32xlarge + - m6a.32xlarge + - x1.32xlarge + - i4i.32xlarge + - r6i.32xlarge + - r6idn.32xlarge + - m6i.metal + - r6in.metal + - r6in.32xlarge + - c6i.32xlarge + - m6idn.metal + - c6in.32xlarge + - r6id.32xlarge + - m6idn.32xlarge + - x2iedn.32xlarge + - inf2.24xlarge + - g5.24xlarge + - r7i.24xlarge + - r6i.24xlarge + - x2idn.24xlarge + - c5.metal + - r5dn.metal + - r5ad.24xlarge + - m6id.24xlarge + - c5.24xlarge + - r5a.24xlarge + - m6i.24xlarge + - r5d.24xlarge + - m5ad.24xlarge + - inf1.24xlarge + - r7i.metal-24xl + - g4dn.metal + - r5b.metal + - m5d.24xlarge + - x2iedn.24xlarge + - r5d.metal + - r6in.24xlarge + - r6id.24xlarge + - r5.24xlarge + - r5n.24xlarge + - c5ad.24xlarge + - i3en.metal + - c6id.24xlarge + - g6.24xlarge + - m6idn.24xlarge + - m6a.24xlarge + - m5a.24xlarge + - r5b.24xlarge + - c6a.24xlarge + - i4i.24xlarge + - i3en.24xlarge + - r5dn.24xlarge + - c5a.24xlarge + - c7i.24xlarge + - r6idn.24xlarge + - m5d.metal + - r5n.metal + - r6a.24xlarge + - m5.24xlarge + - m7i.metal-24xl + - c6in.24xlarge + - r5.metal + - m6in.24xlarge + - hpc6a.48xlarge + - c6i.24xlarge + - m7i.24xlarge + - c7i.metal-24xl + - c5d.metal + - c5d.24xlarge + - m5.metal + - c5n.metal + - c5.18xlarge + - c5d.18xlarge + - c5n.18xlarge + - i3.metal + - r6g.16xlarge + - c6g.metal + - r7gd.16xlarge + - c6gd.metal + - c7i.16xlarge + - c5a.16xlarge + - r5dn.16xlarge + - r5b.16xlarge + - c6id.16xlarge + - r6a.16xlarge + - r5ad.16xlarge + - c6in.16xlarge + - i3.16xlarge + - r5n.16xlarge + - r6gd.metal + - m5a.16xlarge + - m6i.16xlarge + - c5ad.16xlarge + - c7g.metal + - r5a.16xlarge + - x1e.16xlarge + - m6in.16xlarge + - c7gd.metal + - c6gd.16xlarge + - r7g.16xlarge + - g3.16xlarge + - m6gd.16xlarge + - f1.16xlarge + - m6g.16xlarge + - m6gd.metal + - x2iedn.16xlarge + - m7gd.metal + - c6i.16xlarge + - m4.16xlarge + - r6i.16xlarge + - r6in.16xlarge + - m7g.16xlarge + - c6g.16xlarge + - x1.16xlarge + - r6idn.16xlarge + - r5d.16xlarge + - m7g.metal + - m6id.16xlarge + - r7gd.metal + - c6a.16xlarge + - m5ad.16xlarge + - p3.16xlarge + - m6a.16xlarge + - g4dn.16xlarge + - i4i.16xlarge + - r6id.16xlarge + - r6gd.16xlarge + - x2idn.16xlarge + - r5.16xlarge + - m7i.16xlarge + - r7g.metal + - r6g.metal + - r7i.16xlarge + - m5.16xlarge + - g6.16xlarge + - m6g.metal + - c6gn.16xlarge + - p2.16xlarge + - c7g.16xlarge + - m7gd.16xlarge + - c7gd.16xlarge + - m5d.16xlarge + - g5.16xlarge + - m6idn.16xlarge + - r4.16xlarge + - im4gn.16xlarge + - z1d.12xlarge + - c6a.12xlarge + - c6gn.12xlarge + - c6i.12xlarge + - r6idn.12xlarge + - r5n.12xlarge + - i4i.12xlarge + - r6gd.12xlarge + - r5b.12xlarge + - m5ad.12xlarge + - i3en.12xlarge + - c6gd.12xlarge + - r7gd.12xlarge + - g6.12xlarge + - g5.12xlarge + - m6id.12xlarge + - r5d.12xlarge + - r5.12xlarge + - c7g.12xlarge + - m5zn.metal + - c6id.12xlarge + - m5zn.12xlarge + - r6in.12xlarge + - d3en.12xlarge + - m6i.12xlarge + - c7gd.12xlarge + - r6i.12xlarge + - g4dn.12xlarge + - m5d.12xlarge + - m6in.12xlarge + - c6in.12xlarge + - c5ad.12xlarge + - c7i.12xlarge + - z1d.metal + - r6a.12xlarge + - r7g.12xlarge + - m7gd.12xlarge + - m5a.12xlarge + - r7i.12xlarge + - m6g.12xlarge + - c5.12xlarge + - m7i.12xlarge + - c5d.12xlarge + - c5a.12xlarge + - m6idn.12xlarge + - m6a.12xlarge + - m5.12xlarge + - c6g.12xlarge + - r6id.12xlarge + - r5dn.12xlarge + - r5a.12xlarge + - m6gd.12xlarge + - r5ad.12xlarge + - m7g.12xlarge + - r6g.12xlarge + - m4.10xlarge + - c4.8xlarge + - c5d.9xlarge + - c5n.9xlarge + - d2.8xlarge + - c5.9xlarge + - d3en.8xlarge + - c6i.8xlarge + - c6in.8xlarge + - m6gd.8xlarge + - r6id.8xlarge + - r5dn.8xlarge + - m7gd.8xlarge + - c3.8xlarge + - r5d.8xlarge + - im4gn.8xlarge + - r3.8xlarge + - m5.8xlarge + - r7i.8xlarge + - i3.8xlarge + - c6id.8xlarge + - r6gd.8xlarge + - m6a.8xlarge + - m6id.8xlarge + - r7gd.8xlarge + - c6gd.8xlarge + - r5a.8xlarge + - c6a.8xlarge + - r5n.8xlarge + - m7i.8xlarge + - p2.8xlarge + - m5ad.8xlarge + - i4i.8xlarge + - r5.8xlarge + - i2.8xlarge + - c6gn.8xlarge + - r6in.8xlarge + - inf2.8xlarge + - c7gd.8xlarge + - c7i-flex.8xlarge + - c7g.8xlarge + - d3.8xlarge + - m6i.8xlarge + - p3.8xlarge + - x1e.8xlarge + - c5ad.8xlarge + - gr6.8xlarge + - r4.8xlarge + - c6g.8xlarge + - c7i.8xlarge + - x2iedn.8xlarge + - r6i.8xlarge + - m6in.8xlarge + - g3.8xlarge + - g5.8xlarge + - g6.8xlarge + - m5a.8xlarge + - m7i-flex.8xlarge + - r5ad.8xlarge + - m6g.8xlarge + - r5b.8xlarge + - r6a.8xlarge + - is4gen.8xlarge + - g4dn.8xlarge + - r6idn.8xlarge + - c5a.8xlarge + - m5d.8xlarge + - m7g.8xlarge + - m6idn.8xlarge + - r7g.8xlarge + - r6g.8xlarge + - d3en.6xlarge + - z1d.6xlarge + - i3en.6xlarge + - inf1.6xlarge + - m5zn.6xlarge + - c6a.4xlarge + - c6id.4xlarge + - m5a.4xlarge + - c4.4xlarge + - r6a.4xlarge + - x2iedn.4xlarge + - f1.4xlarge + - m6g.4xlarge + - r7i.4xlarge + - c5ad.4xlarge + - im4gn.4xlarge + - r6in.4xlarge + - m7i-flex.4xlarge + - a1.metal + - g3.4xlarge + - c7gd.4xlarge + - m6idn.4xlarge + - r5n.4xlarge + - r5b.4xlarge + - c6in.4xlarge + - r3.4xlarge + - c5n.4xlarge + - r5.4xlarge + - r4.4xlarge + - m7g.4xlarge + - m6i.4xlarge + - d3.4xlarge + - g6.4xlarge + - r6gd.4xlarge + - i2.4xlarge + - m7gd.4xlarge + - r6idn.4xlarge + - m5d.4xlarge + - r6g.4xlarge + - r5a.4xlarge + - d3en.4xlarge + - x1e.4xlarge + - c7i-flex.4xlarge + - is4gen.4xlarge + - r6id.4xlarge + - m5ad.4xlarge + - c7g.4xlarge + - d2.4xlarge + - gr6.4xlarge + - c3.4xlarge + - c6g.4xlarge + - r5ad.4xlarge + - c5a.4xlarge + - m7i.4xlarge + - c6gd.4xlarge + - r5dn.4xlarge + - a1.4xlarge + - g4dn.4xlarge + - r7g.4xlarge + - r6i.4xlarge + - i3.4xlarge + - c6i.4xlarge + - m6gd.4xlarge + - c7i.4xlarge + - m6id.4xlarge + - m4.4xlarge + - c5.4xlarge + - m6a.4xlarge + - m6in.4xlarge + - m5.4xlarge + - i4i.4xlarge + - r7gd.4xlarge + - c5d.4xlarge + - c6gn.4xlarge + - r5d.4xlarge + - g5.4xlarge + - z1d.3xlarge + - i3en.3xlarge + - mac1.metal + - mac2-m2pro.metal + - m5zn.3xlarge + - c6g.2xlarge + - g6.2xlarge + - f1.2xlarge + - r5d.2xlarge + - d3.2xlarge + - c4.2xlarge + - r5ad.2xlarge + - m6idn.2xlarge + - r5a.2xlarge + - r4.2xlarge + - inf1.2xlarge + - c5a.2xlarge + - g5.2xlarge + - t3a.2xlarge + - c7g.2xlarge + - c7gd.2xlarge + - g4dn.2xlarge + - i4i.2xlarge + - r6idn.2xlarge + - r6g.2xlarge + - m5a.2xlarge + - x2iedn.2xlarge + - r6id.2xlarge + - m5zn.2xlarge + - c6i.2xlarge + - r7g.2xlarge + - m7g.2xlarge + - m5ad.2xlarge + - d2.2xlarge + - m6a.2xlarge + - r5dn.2xlarge + - m3.2xlarge + - m2.4xlarge + - c6a.2xlarge + - m6g.2xlarge + - m4.2xlarge + - r7i.2xlarge + - p3.2xlarge + - m6in.2xlarge + - x1e.2xlarge + - r6in.2xlarge + - c6id.2xlarge + - t2.2xlarge + - i3en.2xlarge + - m6id.2xlarge + - im4gn.2xlarge + - m7gd.2xlarge + - c5ad.2xlarge + - r6i.2xlarge + - m7i.2xlarge + - c5n.2xlarge + - c6gn.2xlarge + - a1.2xlarge + - d3en.2xlarge + - mac2-m2.metal + - r5.2xlarge + - m6i.2xlarge + - c5.2xlarge + - i2.2xlarge + - m7i-flex.2xlarge + - t4g.2xlarge + - c6in.2xlarge + - c6gd.2xlarge + - r6gd.2xlarge + - r6a.2xlarge + - c7i-flex.2xlarge + - t3.2xlarge + - c5d.2xlarge + - c7i.2xlarge + - m5.2xlarge + - m5d.2xlarge + - i3.2xlarge + - c3.2xlarge + - c1.xlarge + - is4gen.2xlarge + - r3.2xlarge + - r5b.2xlarge + - m6gd.2xlarge + - z1d.2xlarge + - r5n.2xlarge + - r7gd.2xlarge + - r3.xlarge + - r6id.xlarge + - m4.xlarge + - r7g.xlarge + - m6gd.xlarge + - d3en.xlarge + - g6.xlarge + - r5.xlarge + - r6gd.xlarge + - c5a.xlarge + - g4dn.xlarge + - t4g.xlarge + - r5dn.xlarge + - r6in.xlarge + - z1d.xlarge + - x2iedn.xlarge + - m5ad.xlarge + - r5ad.xlarge + - inf2.xlarge + - a1.xlarge + - c7g.xlarge + - r6i.xlarge + - c7i.xlarge + - r5n.xlarge + - c7i-flex.xlarge + - g5.xlarge + - c5d.xlarge + - c6in.xlarge + - m7i-flex.xlarge + - im4gn.xlarge + - t3a.xlarge + - t3.xlarge + - r7gd.xlarge + - c5.xlarge + - m6a.xlarge + - m6in.xlarge + - m2.2xlarge + - c5ad.xlarge + - c5n.xlarge + - d2.xlarge + - d3.xlarge + - c6id.xlarge + - is4gen.xlarge + - c6a.xlarge + - m6id.xlarge + - m6i.xlarge + - m3.xlarge + - m5zn.xlarge + - g3s.xlarge + - c6gd.xlarge + - m7gd.xlarge + - c6gn.xlarge + - r7i.xlarge + - c7gd.xlarge + - c4.xlarge + - i3.xlarge + - inf1.xlarge + - c6g.xlarge + - r5b.xlarge + - r4.xlarge + - m5a.xlarge + - m1.xlarge + - c3.xlarge + - m6g.xlarge + - p2.xlarge + - r5d.xlarge + - c6i.xlarge + - m7g.xlarge + - i3en.xlarge + - t2.xlarge + - m7i.xlarge + - i2.xlarge + - x1e.xlarge + - m5d.xlarge + - r6a.xlarge + - m6idn.xlarge + - r6g.xlarge + - r6idn.xlarge + - i4i.xlarge + - r5a.xlarge + - m5.xlarge + - c5.large + - r5.large + - t4g.large + - i3en.large + - c5n.large + - c4.large + - r6idn.large + - i4i.large + - m6g.large + - r5dn.large + - r7gd.large + - z1d.large + - r5d.large + - t4g.micro + - r6in.large + - m5d.large + - t4g.small + - m3.large + - r4.large + - c6in.large + - t3.small + - m7i.large + - t4g.medium + - r6g.large + - m5a.large + - r5a.large + - c5d.large + - c5a.large + - t3.nano + - c7i.large + - t4g.nano + - m5zn.large + - r5b.large + - m7i-flex.large + - c3.large + - m6gd.large + - t3a.large + - t3.micro + - m7g.large + - c6g.large + - m6id.large + - r6a.large + - a1.large + - c7i-flex.large + - c6a.large + - r3.large + - r7g.large + - t2.large + - m6i.large + - m6in.large + - r5n.large + - m6a.large + - c6id.large + - m6idn.large + - r6id.large + - r7i.large + - m5.large + - t3a.micro + - is4gen.large + - m2.xlarge + - t2.medium + - m4.large + - im4gn.large + - c6i.large + - t3.medium + - r6i.large + - r5ad.large + - c7gd.large + - m7gd.large + - c1.medium + - t3a.nano + - c7g.large + - t3a.medium + - m5ad.large + - c6gn.large + - t3.large + - c5ad.large + - i3.large + - r6gd.large + - m1.large + - t3a.small + - c6gd.large + - r7g.medium + - t2.micro + - r7gd.medium + - m6gd.medium + - a1.medium + - c6gn.medium + - m7g.medium + - m1.medium + - r6g.medium + - c6gd.medium + - c6g.medium + - m7gd.medium + - m3.medium + - r6gd.medium + - c7g.medium + - t1.micro + - is4gen.medium + - m6g.medium + - t2.small + - t2.nano + - c7gd.medium + - m1.small ca-central-1: - - u-6tb1.112xlarge - - u-3tb1.56xlarge - - u-6tb1.56xlarge - - m6a.metal - - c6a.metal - - c7i.48xlarge - - r7i.metal-48xl - - m7i.48xlarge - - c6a.48xlarge - - c7i.metal-48xl - - m7i.metal-48xl - - g5.48xlarge - - r7i.48xlarge - - g6.48xlarge - - m6a.48xlarge - - i4i.32xlarge - - m6in.metal - - c6i.metal - - m6in.32xlarge - - m6id.32xlarge - - r6i.metal - - i4i.metal - - m6a.32xlarge - - r6i.32xlarge - - c6in.32xlarge - - c6id.32xlarge - - m6id.metal - - m6idn.32xlarge - - x2iedn.32xlarge - - c6i.32xlarge - - x2idn.32xlarge - - m6i.32xlarge - - x2iedn.metal - - m6i.metal - - c6in.metal - - c6a.32xlarge - - m6idn.metal - - x2idn.metal - - c6id.metal - - x1.32xlarge - - x1e.32xlarge - - r7i.metal-24xl - - m5d.metal - - i3en.24xlarge - - c6a.24xlarge - - r5ad.24xlarge - - i4i.24xlarge - - i3en.metal - - r5d.metal - - c7i.metal-24xl - - c6in.24xlarge - - g5.24xlarge - - m5d.24xlarge - - c5a.24xlarge - - m7i.metal-24xl - - c5.24xlarge - - r7i.24xlarge - - r6i.24xlarge - - c7i.24xlarge - - m5ad.24xlarge - - x2idn.24xlarge - - r5a.24xlarge - - r5.24xlarge - - inf1.24xlarge - - r5b.metal - - c5d.metal - - x2iedn.24xlarge - - r5.metal - - g4dn.metal - - c5d.24xlarge - - m6i.24xlarge - - m5.metal - - m6id.24xlarge - - r5n.24xlarge - - m5a.24xlarge - - m6idn.24xlarge - - r5d.24xlarge - - m6in.24xlarge - - r5b.24xlarge - - g6.24xlarge - - c5.metal - - m7i.24xlarge - - r5n.metal - - c6i.24xlarge - - m6a.24xlarge - - c6id.24xlarge - - m5.24xlarge - - i3.metal - - c5d.18xlarge - - c5n.metal - - c5n.18xlarge - - c5.18xlarge - - m6a.16xlarge - - r5ad.16xlarge - - r6g.16xlarge - - m7i.16xlarge - - m6gd.16xlarge - - i4i.16xlarge - - c6g.16xlarge - - m6in.16xlarge - - m6i.16xlarge - - c7g.16xlarge - - c7g.metal - - c5a.16xlarge - - g6.16xlarge - - r6i.16xlarge - - m7g.16xlarge - - p3.16xlarge - - g5.16xlarge - - m5a.16xlarge - - m4.16xlarge - - r7i.16xlarge - - m5d.16xlarge - - x1e.16xlarge - - c6g.metal - - m6g.16xlarge - - r6gd.metal - - m6idn.16xlarge - - r6gd.16xlarge - - r7g.metal - - g3.16xlarge - - m7g.metal - - r7g.16xlarge - - r5a.16xlarge - - c6id.16xlarge - - c6gn.16xlarge - - m5ad.16xlarge - - r5b.16xlarge - - c6i.16xlarge - - r5n.16xlarge - - x2iedn.16xlarge - - g4ad.16xlarge - - g4dn.16xlarge - - c6a.16xlarge - - i3.16xlarge - - r6g.metal - - c7i.16xlarge - - c6gd.16xlarge - - c6gd.metal - - r4.16xlarge - - m6g.metal - - im4gn.16xlarge - - r5d.16xlarge - - m5.16xlarge - - m6gd.metal - - r5.16xlarge - - c6in.16xlarge - - i4g.16xlarge - - x1.16xlarge - - x2idn.16xlarge - - m6id.16xlarge - - r5ad.12xlarge - - m6g.12xlarge - - r5a.12xlarge - - c6gn.12xlarge - - m6id.12xlarge - - c6id.12xlarge - - r6i.12xlarge - - m6gd.12xlarge - - r5.12xlarge - - c7g.12xlarge - - m7g.12xlarge - - r7i.12xlarge - - r6g.12xlarge - - g4dn.12xlarge - - c6a.12xlarge - - m6i.12xlarge - - m5a.12xlarge - - g5.12xlarge - - r6gd.12xlarge - - r7g.12xlarge - - c5d.12xlarge - - m6in.12xlarge - - r5d.12xlarge - - m5.12xlarge - - g6.12xlarge - - r5n.12xlarge - - c6gd.12xlarge - - i4i.12xlarge - - m5d.12xlarge - - m6idn.12xlarge - - c5a.12xlarge - - c6g.12xlarge - - c7i.12xlarge - - c6in.12xlarge - - m7i.12xlarge - - r5b.12xlarge - - c6i.12xlarge - - m6a.12xlarge - - c5.12xlarge - - m5ad.12xlarge - - i3en.12xlarge - - m4.10xlarge - - c5d.9xlarge - - c4.8xlarge - - c5n.9xlarge - - d2.8xlarge - - c5.9xlarge - - r5.8xlarge - - m5ad.8xlarge - - r5d.8xlarge - - im4gn.8xlarge - - x2iedn.8xlarge - - r5n.8xlarge - - m7g.8xlarge - - r4.8xlarge - - m7i-flex.8xlarge - - d3.8xlarge - - m7i.8xlarge - - c6id.8xlarge - - c7i.8xlarge - - c6in.8xlarge - - c6gd.8xlarge - - m5d.8xlarge - - r5a.8xlarge - - m6a.8xlarge - - m6g.8xlarge - - i4i.8xlarge - - p3.8xlarge - - c6a.8xlarge - - i4g.8xlarge - - c6gn.8xlarge - - m5a.8xlarge - - g6.8xlarge - - x1e.8xlarge - - g4ad.8xlarge - - m6in.8xlarge - - g4dn.8xlarge - - m6i.8xlarge - - gr6.8xlarge - - r6i.8xlarge - - c6g.8xlarge - - m6idn.8xlarge - - i3.8xlarge - - is4gen.8xlarge - - m5.8xlarge - - r7g.8xlarge - - r5ad.8xlarge - - c6i.8xlarge - - m6gd.8xlarge - - m6id.8xlarge - - c7g.8xlarge - - r6g.8xlarge - - g3.8xlarge - - g5.8xlarge - - c7i-flex.8xlarge - - r6gd.8xlarge - - r7i.8xlarge - - r5b.8xlarge - - c5a.8xlarge - - inf1.6xlarge - - i3en.6xlarge - - m6in.4xlarge - - m6id.4xlarge - - im4gn.4xlarge - - c7i-flex.4xlarge - - r5.4xlarge - - r5n.4xlarge - - d3.4xlarge - - i4i.4xlarge - - r6gd.4xlarge - - i4g.4xlarge - - i3.4xlarge - - m5ad.4xlarge - - c6i.4xlarge - - g4ad.4xlarge - - x2iedn.4xlarge - - m5.4xlarge - - r5b.4xlarge - - c6gn.4xlarge - - c4.4xlarge - - r5d.4xlarge - - c6gd.4xlarge - - r5a.4xlarge - - m5a.4xlarge - - r7i.4xlarge - - m6idn.4xlarge - - m7i-flex.4xlarge - - m7i.4xlarge - - m7g.4xlarge - - c5.4xlarge - - g6.4xlarge - - m4.4xlarge - - r7g.4xlarge - - d2.4xlarge - - c6a.4xlarge - - c6id.4xlarge - - g3.4xlarge - - c5d.4xlarge - - c5a.4xlarge - - m6i.4xlarge - - c5n.4xlarge - - m5d.4xlarge - - m6g.4xlarge - - r5ad.4xlarge - - c6in.4xlarge - - r6g.4xlarge - - c6g.4xlarge - - r4.4xlarge - - g4dn.4xlarge - - x1e.4xlarge - - c7g.4xlarge - - r6i.4xlarge - - gr6.4xlarge - - m6gd.4xlarge - - c7i.4xlarge - - is4gen.4xlarge - - m6a.4xlarge - - g5.4xlarge - - i3en.3xlarge - - g6.2xlarge - - m7g.2xlarge - - m6id.2xlarge - - r5d.2xlarge - - m7i.2xlarge - - c4.2xlarge - - i4g.2xlarge - - c7i-flex.2xlarge - - g4dn.2xlarge - - m6idn.2xlarge - - r4.2xlarge - - m5.2xlarge - - r6gd.2xlarge - - t2.2xlarge - - r5ad.2xlarge - - c6i.2xlarge - - c6in.2xlarge - - c7i.2xlarge - - t3a.2xlarge - - m5a.2xlarge - - im4gn.2xlarge - - c6a.2xlarge - - c5n.2xlarge - - m5d.2xlarge - - m6a.2xlarge - - x1e.2xlarge - - r5a.2xlarge - - c6id.2xlarge - - x2iedn.2xlarge - - c6gd.2xlarge - - m6g.2xlarge - - g5.2xlarge - - t4g.2xlarge - - c5d.2xlarge - - m5ad.2xlarge - - r6i.2xlarge - - i3.2xlarge - - g4ad.2xlarge - - t3.2xlarge - - p3.2xlarge - - c6g.2xlarge - - r7i.2xlarge - - d3.2xlarge - - r6g.2xlarge - - m6in.2xlarge - - d2.2xlarge - - m6gd.2xlarge - - m6i.2xlarge - - is4gen.2xlarge - - m7i-flex.2xlarge - - r7g.2xlarge - - m4.2xlarge - - c5.2xlarge - - c6gn.2xlarge - - i4i.2xlarge - - r5b.2xlarge - - i3en.2xlarge - - r5n.2xlarge - - c5a.2xlarge - - c7g.2xlarge - - r5.2xlarge - - inf1.2xlarge - - c6gd.xlarge - - m7i-flex.xlarge - - g6.xlarge - - t3a.xlarge - - r5n.xlarge - - m6i.xlarge - - m6idn.xlarge - - m6id.xlarge - - r5b.xlarge - - m5d.xlarge - - i3.xlarge - - r6gd.xlarge - - t4g.xlarge - - x2iedn.xlarge - - c6gn.xlarge - - c5d.xlarge - - m6a.xlarge - - c7i-flex.xlarge - - c7i.xlarge - - c6i.xlarge - - i4i.xlarge - - d3.xlarge - - r5.xlarge - - c5a.xlarge - - c4.xlarge - - m6in.xlarge - - c6g.xlarge - - i3en.xlarge - - x1e.xlarge - - m5ad.xlarge - - im4gn.xlarge - - r5ad.xlarge - - c6a.xlarge - - is4gen.xlarge - - c5n.xlarge - - t2.xlarge - - r6i.xlarge - - r5d.xlarge - - r5a.xlarge - - t3.xlarge - - m5a.xlarge - - m7i.xlarge - - g4dn.xlarge - - i4g.xlarge - - c6id.xlarge - - m6gd.xlarge - - c6in.xlarge - - r4.xlarge - - g4ad.xlarge - - inf1.xlarge - - m5.xlarge - - m7g.xlarge - - c7g.xlarge - - m4.xlarge - - r7g.xlarge - - g5.xlarge - - r7i.xlarge - - c5.xlarge - - d2.xlarge - - r6g.xlarge - - m6g.xlarge - - t3.small - - r5b.large - - t4g.medium - - m7i.large - - t4g.micro - - t3.medium - - is4gen.large - - r6i.large - - t2.medium - - i4i.large - - m5.large - - r4.large - - c4.large - - r5a.large - - m5d.large - - r7i.large - - i3en.large - - r7g.large - - t2.large - - t3a.micro - - m7i-flex.large - - c5a.large - - i4g.large - - c6i.large - - c6id.large - - c7g.large - - t4g.nano - - t3.large - - r6gd.large - - m6in.large - - c7i-flex.large - - i3.large - - m6gd.large - - t4g.large - - m5ad.large - - im4gn.large - - m5a.large - - t3.micro - - t3a.small - - m6i.large - - m6g.large - - c6a.large - - m7g.large - - r5n.large - - c7i.large - - t3a.large - - c5d.large - - r5d.large - - m6id.large - - m6idn.large - - t3.nano - - c6gn.large - - m6a.large - - r5.large - - r6g.large - - t3a.nano - - c6in.large - - t4g.small - - c6gd.large - - c5n.large - - r5ad.large - - c6g.large - - t3a.medium - - m4.large - - c5.large - - r7g.medium - - is4gen.medium - - m6g.medium - - r6gd.medium - - t2.nano - - m7g.medium - - c6gn.medium - - m6gd.medium - - c7g.medium - - r6g.medium - - c6gd.medium - - t2.micro - - t2.small - - c6g.medium + - u-6tb1.112xlarge + - u-3tb1.56xlarge + - u-6tb1.56xlarge + - m6a.metal + - c6a.metal + - c7i.48xlarge + - r7i.metal-48xl + - m7i.48xlarge + - c6a.48xlarge + - c7i.metal-48xl + - m7i.metal-48xl + - g5.48xlarge + - r7i.48xlarge + - g6.48xlarge + - m6a.48xlarge + - i4i.32xlarge + - m6in.metal + - c6i.metal + - m6in.32xlarge + - m6id.32xlarge + - r6i.metal + - i4i.metal + - m6a.32xlarge + - r6i.32xlarge + - c6in.32xlarge + - c6id.32xlarge + - m6id.metal + - m6idn.32xlarge + - x2iedn.32xlarge + - c6i.32xlarge + - x2idn.32xlarge + - m6i.32xlarge + - x2iedn.metal + - m6i.metal + - c6in.metal + - c6a.32xlarge + - m6idn.metal + - x2idn.metal + - c6id.metal + - x1.32xlarge + - x1e.32xlarge + - r7i.metal-24xl + - m5d.metal + - i3en.24xlarge + - c6a.24xlarge + - r5ad.24xlarge + - i4i.24xlarge + - i3en.metal + - r5d.metal + - c7i.metal-24xl + - c6in.24xlarge + - g5.24xlarge + - m5d.24xlarge + - c5a.24xlarge + - m7i.metal-24xl + - c5.24xlarge + - r7i.24xlarge + - r6i.24xlarge + - c7i.24xlarge + - m5ad.24xlarge + - x2idn.24xlarge + - r5a.24xlarge + - r5.24xlarge + - inf1.24xlarge + - r5b.metal + - c5d.metal + - x2iedn.24xlarge + - r5.metal + - g4dn.metal + - c5d.24xlarge + - m6i.24xlarge + - m5.metal + - m6id.24xlarge + - r5n.24xlarge + - m5a.24xlarge + - m6idn.24xlarge + - r5d.24xlarge + - m6in.24xlarge + - r5b.24xlarge + - g6.24xlarge + - c5.metal + - m7i.24xlarge + - r5n.metal + - c6i.24xlarge + - m6a.24xlarge + - c6id.24xlarge + - m5.24xlarge + - i3.metal + - c5d.18xlarge + - c5n.metal + - c5n.18xlarge + - c5.18xlarge + - m6a.16xlarge + - r5ad.16xlarge + - r6g.16xlarge + - m7i.16xlarge + - m6gd.16xlarge + - i4i.16xlarge + - c6g.16xlarge + - m6in.16xlarge + - m6i.16xlarge + - c7g.16xlarge + - c7g.metal + - c5a.16xlarge + - g6.16xlarge + - r6i.16xlarge + - m7g.16xlarge + - p3.16xlarge + - g5.16xlarge + - m5a.16xlarge + - m4.16xlarge + - r7i.16xlarge + - m5d.16xlarge + - x1e.16xlarge + - c6g.metal + - m6g.16xlarge + - r6gd.metal + - m6idn.16xlarge + - r6gd.16xlarge + - r7g.metal + - g3.16xlarge + - m7g.metal + - r7g.16xlarge + - r5a.16xlarge + - c6id.16xlarge + - c6gn.16xlarge + - m5ad.16xlarge + - r5b.16xlarge + - c6i.16xlarge + - r5n.16xlarge + - x2iedn.16xlarge + - g4ad.16xlarge + - g4dn.16xlarge + - c6a.16xlarge + - i3.16xlarge + - r6g.metal + - c7i.16xlarge + - c6gd.16xlarge + - c6gd.metal + - r4.16xlarge + - m6g.metal + - im4gn.16xlarge + - r5d.16xlarge + - m5.16xlarge + - m6gd.metal + - r5.16xlarge + - c6in.16xlarge + - i4g.16xlarge + - x1.16xlarge + - x2idn.16xlarge + - m6id.16xlarge + - r5ad.12xlarge + - m6g.12xlarge + - r5a.12xlarge + - c6gn.12xlarge + - m6id.12xlarge + - c6id.12xlarge + - r6i.12xlarge + - m6gd.12xlarge + - r5.12xlarge + - c7g.12xlarge + - m7g.12xlarge + - r7i.12xlarge + - r6g.12xlarge + - g4dn.12xlarge + - c6a.12xlarge + - m6i.12xlarge + - m5a.12xlarge + - g5.12xlarge + - r6gd.12xlarge + - r7g.12xlarge + - c5d.12xlarge + - m6in.12xlarge + - r5d.12xlarge + - m5.12xlarge + - g6.12xlarge + - r5n.12xlarge + - c6gd.12xlarge + - i4i.12xlarge + - m5d.12xlarge + - m6idn.12xlarge + - c5a.12xlarge + - c6g.12xlarge + - c7i.12xlarge + - c6in.12xlarge + - m7i.12xlarge + - r5b.12xlarge + - c6i.12xlarge + - m6a.12xlarge + - c5.12xlarge + - m5ad.12xlarge + - i3en.12xlarge + - m4.10xlarge + - c5d.9xlarge + - c4.8xlarge + - c5n.9xlarge + - d2.8xlarge + - c5.9xlarge + - r5.8xlarge + - m5ad.8xlarge + - r5d.8xlarge + - im4gn.8xlarge + - x2iedn.8xlarge + - r5n.8xlarge + - m7g.8xlarge + - r4.8xlarge + - m7i-flex.8xlarge + - d3.8xlarge + - m7i.8xlarge + - c6id.8xlarge + - c7i.8xlarge + - c6in.8xlarge + - c6gd.8xlarge + - m5d.8xlarge + - r5a.8xlarge + - m6a.8xlarge + - m6g.8xlarge + - i4i.8xlarge + - p3.8xlarge + - c6a.8xlarge + - i4g.8xlarge + - c6gn.8xlarge + - m5a.8xlarge + - g6.8xlarge + - x1e.8xlarge + - g4ad.8xlarge + - m6in.8xlarge + - g4dn.8xlarge + - m6i.8xlarge + - gr6.8xlarge + - r6i.8xlarge + - c6g.8xlarge + - m6idn.8xlarge + - i3.8xlarge + - is4gen.8xlarge + - m5.8xlarge + - r7g.8xlarge + - r5ad.8xlarge + - c6i.8xlarge + - m6gd.8xlarge + - m6id.8xlarge + - c7g.8xlarge + - r6g.8xlarge + - g3.8xlarge + - g5.8xlarge + - c7i-flex.8xlarge + - r6gd.8xlarge + - r7i.8xlarge + - r5b.8xlarge + - c5a.8xlarge + - inf1.6xlarge + - i3en.6xlarge + - m6in.4xlarge + - m6id.4xlarge + - im4gn.4xlarge + - c7i-flex.4xlarge + - r5.4xlarge + - r5n.4xlarge + - d3.4xlarge + - i4i.4xlarge + - r6gd.4xlarge + - i4g.4xlarge + - i3.4xlarge + - m5ad.4xlarge + - c6i.4xlarge + - g4ad.4xlarge + - x2iedn.4xlarge + - m5.4xlarge + - r5b.4xlarge + - c6gn.4xlarge + - c4.4xlarge + - r5d.4xlarge + - c6gd.4xlarge + - r5a.4xlarge + - m5a.4xlarge + - r7i.4xlarge + - m6idn.4xlarge + - m7i-flex.4xlarge + - m7i.4xlarge + - m7g.4xlarge + - c5.4xlarge + - g6.4xlarge + - m4.4xlarge + - r7g.4xlarge + - d2.4xlarge + - c6a.4xlarge + - c6id.4xlarge + - g3.4xlarge + - c5d.4xlarge + - c5a.4xlarge + - m6i.4xlarge + - c5n.4xlarge + - m5d.4xlarge + - m6g.4xlarge + - r5ad.4xlarge + - c6in.4xlarge + - r6g.4xlarge + - c6g.4xlarge + - r4.4xlarge + - g4dn.4xlarge + - x1e.4xlarge + - c7g.4xlarge + - r6i.4xlarge + - gr6.4xlarge + - m6gd.4xlarge + - c7i.4xlarge + - is4gen.4xlarge + - m6a.4xlarge + - g5.4xlarge + - i3en.3xlarge + - g6.2xlarge + - m7g.2xlarge + - m6id.2xlarge + - r5d.2xlarge + - m7i.2xlarge + - c4.2xlarge + - i4g.2xlarge + - c7i-flex.2xlarge + - g4dn.2xlarge + - m6idn.2xlarge + - r4.2xlarge + - m5.2xlarge + - r6gd.2xlarge + - t2.2xlarge + - r5ad.2xlarge + - c6i.2xlarge + - c6in.2xlarge + - c7i.2xlarge + - t3a.2xlarge + - m5a.2xlarge + - im4gn.2xlarge + - c6a.2xlarge + - c5n.2xlarge + - m5d.2xlarge + - m6a.2xlarge + - x1e.2xlarge + - r5a.2xlarge + - c6id.2xlarge + - x2iedn.2xlarge + - c6gd.2xlarge + - m6g.2xlarge + - g5.2xlarge + - t4g.2xlarge + - c5d.2xlarge + - m5ad.2xlarge + - r6i.2xlarge + - i3.2xlarge + - g4ad.2xlarge + - t3.2xlarge + - p3.2xlarge + - c6g.2xlarge + - r7i.2xlarge + - d3.2xlarge + - r6g.2xlarge + - m6in.2xlarge + - d2.2xlarge + - m6gd.2xlarge + - m6i.2xlarge + - is4gen.2xlarge + - m7i-flex.2xlarge + - r7g.2xlarge + - m4.2xlarge + - c5.2xlarge + - c6gn.2xlarge + - i4i.2xlarge + - r5b.2xlarge + - i3en.2xlarge + - r5n.2xlarge + - c5a.2xlarge + - c7g.2xlarge + - r5.2xlarge + - inf1.2xlarge + - c6gd.xlarge + - m7i-flex.xlarge + - g6.xlarge + - t3a.xlarge + - r5n.xlarge + - m6i.xlarge + - m6idn.xlarge + - m6id.xlarge + - r5b.xlarge + - m5d.xlarge + - i3.xlarge + - r6gd.xlarge + - t4g.xlarge + - x2iedn.xlarge + - c6gn.xlarge + - c5d.xlarge + - m6a.xlarge + - c7i-flex.xlarge + - c7i.xlarge + - c6i.xlarge + - i4i.xlarge + - d3.xlarge + - r5.xlarge + - c5a.xlarge + - c4.xlarge + - m6in.xlarge + - c6g.xlarge + - i3en.xlarge + - x1e.xlarge + - m5ad.xlarge + - im4gn.xlarge + - r5ad.xlarge + - c6a.xlarge + - is4gen.xlarge + - c5n.xlarge + - t2.xlarge + - r6i.xlarge + - r5d.xlarge + - r5a.xlarge + - t3.xlarge + - m5a.xlarge + - m7i.xlarge + - g4dn.xlarge + - i4g.xlarge + - c6id.xlarge + - m6gd.xlarge + - c6in.xlarge + - r4.xlarge + - g4ad.xlarge + - inf1.xlarge + - m5.xlarge + - m7g.xlarge + - c7g.xlarge + - m4.xlarge + - r7g.xlarge + - g5.xlarge + - r7i.xlarge + - c5.xlarge + - d2.xlarge + - r6g.xlarge + - m6g.xlarge + - t3.small + - r5b.large + - t4g.medium + - m7i.large + - t4g.micro + - t3.medium + - is4gen.large + - r6i.large + - t2.medium + - i4i.large + - m5.large + - r4.large + - c4.large + - r5a.large + - m5d.large + - r7i.large + - i3en.large + - r7g.large + - t2.large + - t3a.micro + - m7i-flex.large + - c5a.large + - i4g.large + - c6i.large + - c6id.large + - c7g.large + - t4g.nano + - t3.large + - r6gd.large + - m6in.large + - c7i-flex.large + - i3.large + - m6gd.large + - t4g.large + - m5ad.large + - im4gn.large + - m5a.large + - t3.micro + - t3a.small + - m6i.large + - m6g.large + - c6a.large + - m7g.large + - r5n.large + - c7i.large + - t3a.large + - c5d.large + - r5d.large + - m6id.large + - m6idn.large + - t3.nano + - c6gn.large + - m6a.large + - r5.large + - r6g.large + - t3a.nano + - c6in.large + - t4g.small + - c6gd.large + - c5n.large + - r5ad.large + - c6g.large + - t3a.medium + - m4.large + - c5.large + - r7g.medium + - is4gen.medium + - m6g.medium + - r6gd.medium + - t2.nano + - m7g.medium + - c6gn.medium + - m6gd.medium + - c7g.medium + - r6g.medium + - c6gd.medium + - t2.micro + - t2.small + - c6g.medium eu-central-1: - - u-12tb1.112xlarge - - u-6tb1.112xlarge - - u-9tb1.112xlarge - - u-18tb1.112xlarge - - u-3tb1.56xlarge - - u-6tb1.56xlarge - - r6a.48xlarge - - g5.48xlarge - - r8g.48xlarge - - x8g.48xlarge - - c6a.48xlarge - - c6a.metal - - r6a.metal - - r8g.metal-48xl - - c8g.48xlarge - - m6a.48xlarge - - c7i.metal-48xl - - x8g.metal-48xl - - r7i.48xlarge - - c7a.48xlarge - - r7i.metal-48xl - - c7a.metal-48xl - - m7a.metal-48xl - - r7a.48xlarge - - inf2.48xlarge - - m7a.48xlarge - - m6a.metal - - m7i.metal-48xl - - r7a.metal-48xl - - m8g.48xlarge - - m7i.48xlarge - - c8g.metal-48xl - - c7i.48xlarge - - m8g.metal-48xl - - g6.48xlarge - - c6id.32xlarge - - x1e.32xlarge - - m7a.32xlarge - - m6in.metal - - r6id.metal - - r6id.32xlarge - - i4i.32xlarge - - m6id.32xlarge - - m6idn.metal - - r6in.32xlarge - - c6in.metal - - r7iz.32xlarge - - r7iz.metal-32xl - - r6i.metal - - x2idn.32xlarge - - r6idn.32xlarge - - c6a.32xlarge - - r6idn.metal - - m6a.32xlarge - - c7a.32xlarge - - r6in.metal - - i4i.metal - - r7a.32xlarge - - x2idn.metal - - m6i.metal - - x1.32xlarge - - c6in.32xlarge - - x2iedn.32xlarge - - x2iedn.metal - - m6idn.32xlarge - - r6a.32xlarge - - m6i.32xlarge - - c6id.metal - - c6i.metal - - m6id.metal - - m6in.32xlarge - - r6i.32xlarge - - c6i.32xlarge - - m5dn.metal - - inf2.24xlarge - - c6i.24xlarge - - i3en.metal - - r5.24xlarge - - dl2q.24xlarge - - r5a.24xlarge - - r7i.24xlarge - - r6a.24xlarge - - c7i.metal-24xl - - m8g.metal-24xl - - r6in.24xlarge - - c6a.24xlarge - - r5d.24xlarge - - r6i.24xlarge - - m5d.metal - - r5n.24xlarge - - r7i.metal-24xl - - r8g.metal-24xl - - r5.metal - - m5n.metal - - r5dn.24xlarge - - g6.24xlarge - - r7a.24xlarge - - r5d.metal - - r5b.metal - - c7i.24xlarge - - m5ad.24xlarge - - x2idn.24xlarge - - r8g.24xlarge - - g5.24xlarge - - m5.metal - - x2iedn.24xlarge - - r5n.metal - - m6a.24xlarge - - m7i.metal-24xl - - x8g.metal-24xl - - x8g.24xlarge - - i4i.24xlarge - - inf1.24xlarge - - c5ad.24xlarge - - p4d.24xlarge - - c5.24xlarge - - i3en.24xlarge - - m6idn.24xlarge - - m5d.24xlarge - - m5dn.24xlarge - - c5a.24xlarge - - r5dn.metal - - m5.24xlarge - - m5n.24xlarge - - r5b.24xlarge - - c6id.24xlarge - - m5a.24xlarge - - m6id.24xlarge - - c7a.24xlarge - - c8g.24xlarge - - r5ad.24xlarge - - m7a.24xlarge - - c5d.24xlarge - - c5.metal - - c8g.metal-24xl - - m8g.24xlarge - - c5d.metal - - r6idn.24xlarge - - m7i.24xlarge - - m6i.24xlarge - - m6in.24xlarge - - r6id.24xlarge - - g4dn.metal - - c6in.24xlarge - - c5d.18xlarge - - c5n.metal - - c5.18xlarge - - i3.metal - - c5n.18xlarge - - r6g.metal - - r7i.16xlarge - - r7iz.16xlarge - - m7gd.metal - - m6in.16xlarge - - m6i.16xlarge - - x2idn.16xlarge - - r5.16xlarge - - c8g.16xlarge - - m6id.16xlarge - - g3.16xlarge - - r6g.16xlarge - - r5d.16xlarge - - r5n.16xlarge - - c6g.16xlarge - - r7g.16xlarge - - c6a.16xlarge - - c6gd.metal - - m4.16xlarge - - m7i.16xlarge - - m6a.16xlarge - - r6a.16xlarge - - m6g.16xlarge - - m6gd.16xlarge - - r5ad.16xlarge - - c5a.16xlarge - - c6g.metal - - m5a.16xlarge - - m6g.metal - - m5n.16xlarge - - c7i.16xlarge - - c7a.16xlarge - - c7gd.metal - - x1.16xlarge - - r4.16xlarge - - c6gd.16xlarge - - r6idn.16xlarge - - r6i.16xlarge - - g5g.metal - - r6id.16xlarge - - g5g.16xlarge - - r8g.16xlarge - - c7g.metal - - r5a.16xlarge - - g4dn.16xlarge - - g5.16xlarge - - c5ad.16xlarge - - c7gd.16xlarge - - c7g.16xlarge - - x1e.16xlarge - - r5dn.16xlarge - - c6id.16xlarge - - m7g.metal - - c6i.16xlarge - - r7gd.metal - - m6idn.16xlarge - - m5ad.16xlarge - - r6gd.metal - - c6gn.16xlarge - - m5dn.16xlarge - - p3.16xlarge - - g6.16xlarge - - r6gd.16xlarge - - m6gd.metal - - r7iz.metal-16xl - - im4gn.16xlarge - - m8g.16xlarge - - m7a.16xlarge - - x8g.16xlarge - - r7gd.16xlarge - - r7a.16xlarge - - m7gd.16xlarge - - r5b.16xlarge - - x2iedn.16xlarge - - i4i.16xlarge - - p2.16xlarge - - m5.16xlarge - - m5d.16xlarge - - g4ad.16xlarge - - m7g.16xlarge - - r7g.metal - - i3.16xlarge - - r6in.16xlarge - - c6in.16xlarge - - m7i.12xlarge - - c7gd.12xlarge - - r5ad.12xlarge - - r6a.12xlarge - - c5d.12xlarge - - m6gd.12xlarge - - m5.12xlarge - - r6in.12xlarge - - c5.12xlarge - - m7gd.12xlarge - - r6g.12xlarge - - m6in.12xlarge - - c6gn.12xlarge - - c7a.12xlarge - - r6idn.12xlarge - - r7g.12xlarge - - g5.12xlarge - - c6id.12xlarge - - c6g.12xlarge - - g6.12xlarge - - z1d.metal - - m6g.12xlarge - - r5a.12xlarge - - r6id.12xlarge - - m5d.12xlarge - - i4i.12xlarge - - c5a.12xlarge - - d3en.12xlarge - - r7a.12xlarge - - r7i.12xlarge - - c5ad.12xlarge - - m5dn.12xlarge - - r8g.12xlarge - - m6a.12xlarge - - g4dn.12xlarge - - m5zn.12xlarge - - m6id.12xlarge - - c6in.12xlarge - - m5n.12xlarge - - m6idn.12xlarge - - r7gd.12xlarge - - c7i.12xlarge - - z1d.12xlarge - - m7a.12xlarge - - r6i.12xlarge - - m5a.12xlarge - - m5zn.metal - - m6i.12xlarge - - r6gd.12xlarge - - m5ad.12xlarge - - x8g.12xlarge - - c7g.12xlarge - - i3en.12xlarge - - m7g.12xlarge - - c6a.12xlarge - - r7iz.12xlarge - - r5.12xlarge - - r5b.12xlarge - - r5d.12xlarge - - m8g.12xlarge - - c8g.12xlarge - - c6gd.12xlarge - - r5n.12xlarge - - c6i.12xlarge - - r5dn.12xlarge - - m4.10xlarge - - c5d.9xlarge - - c5.9xlarge - - d2.8xlarge - - c5n.9xlarge - - c4.8xlarge - - c6g.8xlarge - - m6g.8xlarge - - m7a.8xlarge - - m8g.8xlarge - - inf2.8xlarge - - i3.8xlarge - - c6i.8xlarge - - r7a.8xlarge - - r6g.8xlarge - - r6a.8xlarge - - i4i.8xlarge - - r7gd.8xlarge - - g4ad.8xlarge - - r5n.8xlarge - - x2iedn.8xlarge - - r6i.8xlarge - - d3en.8xlarge - - p2.8xlarge - - is4gen.8xlarge - - m5a.8xlarge - - c7g.8xlarge - - m6in.8xlarge - - r5d.8xlarge - - r6idn.8xlarge - - c5a.8xlarge - - r7g.8xlarge - - g6.8xlarge - - i2.8xlarge - - r3.8xlarge - - m5dn.8xlarge - - r5ad.8xlarge - - r6in.8xlarge - - m6id.8xlarge - - m6gd.8xlarge - - c6in.8xlarge - - x8g.8xlarge - - r5dn.8xlarge - - c7gd.8xlarge - - r8g.8xlarge - - m5ad.8xlarge - - r7i.8xlarge - - r6gd.8xlarge - - c7i-flex.8xlarge - - c5ad.8xlarge - - m7i-flex.8xlarge - - c8g.8xlarge - - r5.8xlarge - - r6id.8xlarge - - m6idn.8xlarge - - m6a.8xlarge - - c7i.8xlarge - - m7gd.8xlarge - - m5.8xlarge - - m7g.8xlarge - - m5n.8xlarge - - gr6.8xlarge - - m7i.8xlarge - - r4.8xlarge - - g4dn.8xlarge - - c3.8xlarge - - r5a.8xlarge - - g5g.8xlarge - - r7iz.8xlarge - - im4gn.8xlarge - - r5b.8xlarge - - x1e.8xlarge - - g5.8xlarge - - m6i.8xlarge - - p3.8xlarge - - d3.8xlarge - - c6gd.8xlarge - - m5d.8xlarge - - c6a.8xlarge - - c7a.8xlarge - - c6id.8xlarge - - c6gn.8xlarge - - g3.8xlarge - - i3en.6xlarge - - m5zn.6xlarge - - inf1.6xlarge - - d3en.6xlarge - - z1d.6xlarge - - m6in.4xlarge - - m8g.4xlarge - - m5d.4xlarge - - c7gd.4xlarge - - r7i.4xlarge - - m6gd.4xlarge - - g4dn.4xlarge - - r5.4xlarge - - g3.4xlarge - - m4.4xlarge - - c6id.4xlarge - - m6a.4xlarge - - m7i.4xlarge - - f1.4xlarge - - r6in.4xlarge - - c6i.4xlarge - - g5g.4xlarge - - r7iz.4xlarge - - r4.4xlarge - - d3.4xlarge - - d2.4xlarge - - r8g.4xlarge - - r5dn.4xlarge - - a1.metal - - c8g.4xlarge - - c6gd.4xlarge - - g5.4xlarge - - c4.4xlarge - - is4gen.4xlarge - - m7g.4xlarge - - m6idn.4xlarge - - c5.4xlarge - - r7a.4xlarge - - c7g.4xlarge - - i3.4xlarge - - x1e.4xlarge - - d3en.4xlarge - - g6.4xlarge - - gr6.4xlarge - - r6gd.4xlarge - - c6g.4xlarge - - r5ad.4xlarge - - c3.4xlarge - - m6g.4xlarge - - m5ad.4xlarge - - r7gd.4xlarge - - r5b.4xlarge - - r6id.4xlarge - - c6a.4xlarge - - m7i-flex.4xlarge - - m5a.4xlarge - - c7i.4xlarge - - c5ad.4xlarge - - m5n.4xlarge - - i2.4xlarge - - im4gn.4xlarge - - a1.4xlarge - - c6in.4xlarge - - m5dn.4xlarge - - c5n.4xlarge - - m6i.4xlarge - - c5a.4xlarge - - m7a.4xlarge - - r3.4xlarge - - c6gn.4xlarge - - x8g.4xlarge - - r6idn.4xlarge - - m6id.4xlarge - - c7i-flex.4xlarge - - r6a.4xlarge - - x2iedn.4xlarge - - r5a.4xlarge - - r6g.4xlarge - - g4ad.4xlarge - - r6i.4xlarge - - c7a.4xlarge - - m7gd.4xlarge - - r5n.4xlarge - - r5d.4xlarge - - r7g.4xlarge - - m5.4xlarge - - c5d.4xlarge - - i4i.4xlarge - - mac1.metal - - m5zn.3xlarge - - i3en.3xlarge - - z1d.3xlarge - - r5dn.2xlarge - - c3.2xlarge - - r5n.2xlarge - - r7a.2xlarge - - c7gd.2xlarge - - m6g.2xlarge - - m6i.2xlarge - - d3.2xlarge - - c6g.2xlarge - - f1.2xlarge - - r6i.2xlarge - - g5.2xlarge - - r7i.2xlarge - - c4.2xlarge - - m7gd.2xlarge - - x2iedn.2xlarge - - t4g.2xlarge - - c6in.2xlarge - - r6in.2xlarge - - r5ad.2xlarge - - c7g.2xlarge - - im4gn.2xlarge - - r5b.2xlarge - - x8g.2xlarge - - m6id.2xlarge - - c5a.2xlarge - - d3en.2xlarge - - c8g.2xlarge - - i4i.2xlarge - - c5d.2xlarge - - c7i.2xlarge - - g4dn.2xlarge - - r3.2xlarge - - m3.2xlarge - - m5dn.2xlarge - - g4ad.2xlarge - - m6a.2xlarge - - c6gn.2xlarge - - r4.2xlarge - - m5.2xlarge - - r5a.2xlarge - - t2.2xlarge - - m5zn.2xlarge - - m6idn.2xlarge - - r6g.2xlarge - - d2.2xlarge - - i3en.2xlarge - - c5ad.2xlarge - - c7a.2xlarge - - m6gd.2xlarge - - m6in.2xlarge - - is4gen.2xlarge - - r6a.2xlarge - - r7g.2xlarge - - r6gd.2xlarge - - c5n.2xlarge - - mac2-m2.metal - - m5a.2xlarge - - m5ad.2xlarge - - x1e.2xlarge - - m8g.2xlarge - - c6a.2xlarge - - r5d.2xlarge - - m7a.2xlarge - - r7gd.2xlarge - - c6gd.2xlarge - - m7g.2xlarge - - r6idn.2xlarge - - i3.2xlarge - - g5g.2xlarge - - c6id.2xlarge - - m5n.2xlarge - - t3.2xlarge - - c7i-flex.2xlarge - - i2.2xlarge - - a1.2xlarge - - r8g.2xlarge - - r6id.2xlarge - - inf1.2xlarge - - p3.2xlarge - - r7iz.2xlarge - - r5.2xlarge - - m4.2xlarge - - z1d.2xlarge - - m7i.2xlarge - - c6i.2xlarge - - m7i-flex.2xlarge - - c5.2xlarge - - m5d.2xlarge - - t3a.2xlarge - - g6.2xlarge - - c6i.xlarge - - a1.xlarge - - m7gd.xlarge - - r7a.xlarge - - r5a.xlarge - - c4.xlarge - - r5d.xlarge - - m6i.xlarge - - z1d.xlarge - - m6g.xlarge - - m5ad.xlarge - - t2.xlarge - - c6g.xlarge - - r5.xlarge - - inf1.xlarge - - g4ad.xlarge - - r3.xlarge - - d3en.xlarge - - g5g.xlarge - - m7i-flex.xlarge - - m6gd.xlarge - - r6gd.xlarge - - r7gd.xlarge - - c7a.xlarge - - d2.xlarge - - r5b.xlarge - - r6idn.xlarge - - m5dn.xlarge - - is4gen.xlarge - - r8g.xlarge - - i3.xlarge - - t3a.xlarge - - m6idn.xlarge - - c7i.xlarge - - m7g.xlarge - - c5n.xlarge - - r5n.xlarge - - p2.xlarge - - m6in.xlarge - - m6a.xlarge - - g5.xlarge - - m3.xlarge - - r6id.xlarge - - r6in.xlarge - - r5dn.xlarge - - m5d.xlarge - - r7g.xlarge - - c7i-flex.xlarge - - m7i.xlarge - - r4.xlarge - - m6id.xlarge - - c7gd.xlarge - - r6g.xlarge - - c6gd.xlarge - - c3.xlarge - - m5zn.xlarge - - r7i.xlarge - - m7a.xlarge - - m5.xlarge - - inf2.xlarge - - m5a.xlarge - - c6id.xlarge - - g4dn.xlarge - - m8g.xlarge - - t4g.xlarge - - c5.xlarge - - i2.xlarge - - r6i.xlarge - - c6gn.xlarge - - i4i.xlarge - - g3s.xlarge - - x1e.xlarge - - c5d.xlarge - - t3.xlarge - - c6a.xlarge - - c8g.xlarge - - r6a.xlarge - - c5ad.xlarge - - g6.xlarge - - m5n.xlarge - - x2iedn.xlarge - - m4.xlarge - - d3.xlarge - - c7g.xlarge - - i3en.xlarge - - r5ad.xlarge - - im4gn.xlarge - - r7iz.xlarge - - c5a.xlarge - - c6in.xlarge - - x8g.xlarge - - r6in.large - - m6id.large - - m5zn.large - - m7g.large - - r6idn.large - - r6a.large - - t3a.medium - - r4.large - - r7g.large - - t3.large - - m5n.large - - t3a.large - - c5n.large - - is4gen.large - - m5a.large - - c8g.large - - c5ad.large - - c7a.large - - c6i.large - - t3a.nano - - c3.large - - t3.nano - - t4g.large - - r5.large - - m3.large - - m7i.large - - t4g.micro - - r7a.large - - c6gn.large - - t2.large - - m6idn.large - - t4g.nano - - m5ad.large - - m6gd.large - - m6i.large - - i3.large - - m7gd.large - - m6in.large - - c6a.large - - r7gd.large - - r6gd.large - - m6a.large - - m7i-flex.large - - c6in.large - - i3en.large - - c5a.large - - r5a.large - - r5dn.large - - i4i.large - - r5b.large - - c5.large - - m5d.large - - r6g.large - - c7g.large - - m8g.large - - t3.small - - r3.large - - t3a.micro - - im4gn.large - - c7gd.large - - t2.medium - - m7a.large - - m5.large - - c5d.large - - c6id.large - - m5dn.large - - t3.medium - - r5ad.large - - r6id.large - - t4g.medium - - z1d.large - - a1.large - - c7i-flex.large - - x8g.large - - t4g.small - - t3.micro - - c6g.large - - m6g.large - - r5n.large - - r7i.large - - c7i.large - - c6gd.large - - r5d.large - - r8g.large - - c4.large - - t3a.small - - m4.large - - r7iz.large - - r6i.large - - c6g.medium - - x8g.medium - - c6gn.medium - - m7gd.medium - - m8g.medium - - r7a.medium - - m6g.medium - - m6gd.medium - - c7a.medium - - m3.medium - - c7gd.medium - - t2.micro - - r7g.medium - - t2.nano - - c7g.medium - - r7gd.medium - - a1.medium - - is4gen.medium - - t2.small - - r6gd.medium - - r6g.medium - - c6gd.medium - - m7g.medium - - r8g.medium - - m7a.medium - - c8g.medium + - u-12tb1.112xlarge + - u-6tb1.112xlarge + - u-9tb1.112xlarge + - u-18tb1.112xlarge + - u-3tb1.56xlarge + - u-6tb1.56xlarge + - r6a.48xlarge + - g5.48xlarge + - r8g.48xlarge + - x8g.48xlarge + - c6a.48xlarge + - c6a.metal + - r6a.metal + - r8g.metal-48xl + - c8g.48xlarge + - m6a.48xlarge + - c7i.metal-48xl + - x8g.metal-48xl + - r7i.48xlarge + - c7a.48xlarge + - r7i.metal-48xl + - c7a.metal-48xl + - m7a.metal-48xl + - r7a.48xlarge + - inf2.48xlarge + - m7a.48xlarge + - m6a.metal + - m7i.metal-48xl + - r7a.metal-48xl + - m8g.48xlarge + - m7i.48xlarge + - c8g.metal-48xl + - c7i.48xlarge + - m8g.metal-48xl + - g6.48xlarge + - c6id.32xlarge + - x1e.32xlarge + - m7a.32xlarge + - m6in.metal + - r6id.metal + - r6id.32xlarge + - i4i.32xlarge + - m6id.32xlarge + - m6idn.metal + - r6in.32xlarge + - c6in.metal + - r7iz.32xlarge + - r7iz.metal-32xl + - r6i.metal + - x2idn.32xlarge + - r6idn.32xlarge + - c6a.32xlarge + - r6idn.metal + - m6a.32xlarge + - c7a.32xlarge + - r6in.metal + - i4i.metal + - r7a.32xlarge + - x2idn.metal + - m6i.metal + - x1.32xlarge + - c6in.32xlarge + - x2iedn.32xlarge + - x2iedn.metal + - m6idn.32xlarge + - r6a.32xlarge + - m6i.32xlarge + - c6id.metal + - c6i.metal + - m6id.metal + - m6in.32xlarge + - r6i.32xlarge + - c6i.32xlarge + - m5dn.metal + - inf2.24xlarge + - c6i.24xlarge + - i3en.metal + - r5.24xlarge + - dl2q.24xlarge + - r5a.24xlarge + - r7i.24xlarge + - r6a.24xlarge + - c7i.metal-24xl + - m8g.metal-24xl + - r6in.24xlarge + - c6a.24xlarge + - r5d.24xlarge + - r6i.24xlarge + - m5d.metal + - r5n.24xlarge + - r7i.metal-24xl + - r8g.metal-24xl + - r5.metal + - m5n.metal + - r5dn.24xlarge + - g6.24xlarge + - r7a.24xlarge + - r5d.metal + - r5b.metal + - c7i.24xlarge + - m5ad.24xlarge + - x2idn.24xlarge + - r8g.24xlarge + - g5.24xlarge + - m5.metal + - x2iedn.24xlarge + - r5n.metal + - m6a.24xlarge + - m7i.metal-24xl + - x8g.metal-24xl + - x8g.24xlarge + - i4i.24xlarge + - inf1.24xlarge + - c5ad.24xlarge + - p4d.24xlarge + - c5.24xlarge + - i3en.24xlarge + - m6idn.24xlarge + - m5d.24xlarge + - m5dn.24xlarge + - c5a.24xlarge + - r5dn.metal + - m5.24xlarge + - m5n.24xlarge + - r5b.24xlarge + - c6id.24xlarge + - m5a.24xlarge + - m6id.24xlarge + - c7a.24xlarge + - c8g.24xlarge + - r5ad.24xlarge + - m7a.24xlarge + - c5d.24xlarge + - c5.metal + - c8g.metal-24xl + - m8g.24xlarge + - c5d.metal + - r6idn.24xlarge + - m7i.24xlarge + - m6i.24xlarge + - m6in.24xlarge + - r6id.24xlarge + - g4dn.metal + - c6in.24xlarge + - c5d.18xlarge + - c5n.metal + - c5.18xlarge + - i3.metal + - c5n.18xlarge + - r6g.metal + - r7i.16xlarge + - r7iz.16xlarge + - m7gd.metal + - m6in.16xlarge + - m6i.16xlarge + - x2idn.16xlarge + - r5.16xlarge + - c8g.16xlarge + - m6id.16xlarge + - g3.16xlarge + - r6g.16xlarge + - r5d.16xlarge + - r5n.16xlarge + - c6g.16xlarge + - r7g.16xlarge + - c6a.16xlarge + - c6gd.metal + - m4.16xlarge + - m7i.16xlarge + - m6a.16xlarge + - r6a.16xlarge + - m6g.16xlarge + - m6gd.16xlarge + - r5ad.16xlarge + - c5a.16xlarge + - c6g.metal + - m5a.16xlarge + - m6g.metal + - m5n.16xlarge + - c7i.16xlarge + - c7a.16xlarge + - c7gd.metal + - x1.16xlarge + - r4.16xlarge + - c6gd.16xlarge + - r6idn.16xlarge + - r6i.16xlarge + - g5g.metal + - r6id.16xlarge + - g5g.16xlarge + - r8g.16xlarge + - c7g.metal + - r5a.16xlarge + - g4dn.16xlarge + - g5.16xlarge + - c5ad.16xlarge + - c7gd.16xlarge + - c7g.16xlarge + - x1e.16xlarge + - r5dn.16xlarge + - c6id.16xlarge + - m7g.metal + - c6i.16xlarge + - r7gd.metal + - m6idn.16xlarge + - m5ad.16xlarge + - r6gd.metal + - c6gn.16xlarge + - m5dn.16xlarge + - p3.16xlarge + - g6.16xlarge + - r6gd.16xlarge + - m6gd.metal + - r7iz.metal-16xl + - im4gn.16xlarge + - m8g.16xlarge + - m7a.16xlarge + - x8g.16xlarge + - r7gd.16xlarge + - r7a.16xlarge + - m7gd.16xlarge + - r5b.16xlarge + - x2iedn.16xlarge + - i4i.16xlarge + - p2.16xlarge + - m5.16xlarge + - m5d.16xlarge + - g4ad.16xlarge + - m7g.16xlarge + - r7g.metal + - i3.16xlarge + - r6in.16xlarge + - c6in.16xlarge + - m7i.12xlarge + - c7gd.12xlarge + - r5ad.12xlarge + - r6a.12xlarge + - c5d.12xlarge + - m6gd.12xlarge + - m5.12xlarge + - r6in.12xlarge + - c5.12xlarge + - m7gd.12xlarge + - r6g.12xlarge + - m6in.12xlarge + - c6gn.12xlarge + - c7a.12xlarge + - r6idn.12xlarge + - r7g.12xlarge + - g5.12xlarge + - c6id.12xlarge + - c6g.12xlarge + - g6.12xlarge + - z1d.metal + - m6g.12xlarge + - r5a.12xlarge + - r6id.12xlarge + - m5d.12xlarge + - i4i.12xlarge + - c5a.12xlarge + - d3en.12xlarge + - r7a.12xlarge + - r7i.12xlarge + - c5ad.12xlarge + - m5dn.12xlarge + - r8g.12xlarge + - m6a.12xlarge + - g4dn.12xlarge + - m5zn.12xlarge + - m6id.12xlarge + - c6in.12xlarge + - m5n.12xlarge + - m6idn.12xlarge + - r7gd.12xlarge + - c7i.12xlarge + - z1d.12xlarge + - m7a.12xlarge + - r6i.12xlarge + - m5a.12xlarge + - m5zn.metal + - m6i.12xlarge + - r6gd.12xlarge + - m5ad.12xlarge + - x8g.12xlarge + - c7g.12xlarge + - i3en.12xlarge + - m7g.12xlarge + - c6a.12xlarge + - r7iz.12xlarge + - r5.12xlarge + - r5b.12xlarge + - r5d.12xlarge + - m8g.12xlarge + - c8g.12xlarge + - c6gd.12xlarge + - r5n.12xlarge + - c6i.12xlarge + - r5dn.12xlarge + - m4.10xlarge + - c5d.9xlarge + - c5.9xlarge + - d2.8xlarge + - c5n.9xlarge + - c4.8xlarge + - c6g.8xlarge + - m6g.8xlarge + - m7a.8xlarge + - m8g.8xlarge + - inf2.8xlarge + - i3.8xlarge + - c6i.8xlarge + - r7a.8xlarge + - r6g.8xlarge + - r6a.8xlarge + - i4i.8xlarge + - r7gd.8xlarge + - g4ad.8xlarge + - r5n.8xlarge + - x2iedn.8xlarge + - r6i.8xlarge + - d3en.8xlarge + - p2.8xlarge + - is4gen.8xlarge + - m5a.8xlarge + - c7g.8xlarge + - m6in.8xlarge + - r5d.8xlarge + - r6idn.8xlarge + - c5a.8xlarge + - r7g.8xlarge + - g6.8xlarge + - i2.8xlarge + - r3.8xlarge + - m5dn.8xlarge + - r5ad.8xlarge + - r6in.8xlarge + - m6id.8xlarge + - m6gd.8xlarge + - c6in.8xlarge + - x8g.8xlarge + - r5dn.8xlarge + - c7gd.8xlarge + - r8g.8xlarge + - m5ad.8xlarge + - r7i.8xlarge + - r6gd.8xlarge + - c7i-flex.8xlarge + - c5ad.8xlarge + - m7i-flex.8xlarge + - c8g.8xlarge + - r5.8xlarge + - r6id.8xlarge + - m6idn.8xlarge + - m6a.8xlarge + - c7i.8xlarge + - m7gd.8xlarge + - m5.8xlarge + - m7g.8xlarge + - m5n.8xlarge + - gr6.8xlarge + - m7i.8xlarge + - r4.8xlarge + - g4dn.8xlarge + - c3.8xlarge + - r5a.8xlarge + - g5g.8xlarge + - r7iz.8xlarge + - im4gn.8xlarge + - r5b.8xlarge + - x1e.8xlarge + - g5.8xlarge + - m6i.8xlarge + - p3.8xlarge + - d3.8xlarge + - c6gd.8xlarge + - m5d.8xlarge + - c6a.8xlarge + - c7a.8xlarge + - c6id.8xlarge + - c6gn.8xlarge + - g3.8xlarge + - i3en.6xlarge + - m5zn.6xlarge + - inf1.6xlarge + - d3en.6xlarge + - z1d.6xlarge + - m6in.4xlarge + - m8g.4xlarge + - m5d.4xlarge + - c7gd.4xlarge + - r7i.4xlarge + - m6gd.4xlarge + - g4dn.4xlarge + - r5.4xlarge + - g3.4xlarge + - m4.4xlarge + - c6id.4xlarge + - m6a.4xlarge + - m7i.4xlarge + - f1.4xlarge + - r6in.4xlarge + - c6i.4xlarge + - g5g.4xlarge + - r7iz.4xlarge + - r4.4xlarge + - d3.4xlarge + - d2.4xlarge + - r8g.4xlarge + - r5dn.4xlarge + - a1.metal + - c8g.4xlarge + - c6gd.4xlarge + - g5.4xlarge + - c4.4xlarge + - is4gen.4xlarge + - m7g.4xlarge + - m6idn.4xlarge + - c5.4xlarge + - r7a.4xlarge + - c7g.4xlarge + - i3.4xlarge + - x1e.4xlarge + - d3en.4xlarge + - g6.4xlarge + - gr6.4xlarge + - r6gd.4xlarge + - c6g.4xlarge + - r5ad.4xlarge + - c3.4xlarge + - m6g.4xlarge + - m5ad.4xlarge + - r7gd.4xlarge + - r5b.4xlarge + - r6id.4xlarge + - c6a.4xlarge + - m7i-flex.4xlarge + - m5a.4xlarge + - c7i.4xlarge + - c5ad.4xlarge + - m5n.4xlarge + - i2.4xlarge + - im4gn.4xlarge + - a1.4xlarge + - c6in.4xlarge + - m5dn.4xlarge + - c5n.4xlarge + - m6i.4xlarge + - c5a.4xlarge + - m7a.4xlarge + - r3.4xlarge + - c6gn.4xlarge + - x8g.4xlarge + - r6idn.4xlarge + - m6id.4xlarge + - c7i-flex.4xlarge + - r6a.4xlarge + - x2iedn.4xlarge + - r5a.4xlarge + - r6g.4xlarge + - g4ad.4xlarge + - r6i.4xlarge + - c7a.4xlarge + - m7gd.4xlarge + - r5n.4xlarge + - r5d.4xlarge + - r7g.4xlarge + - m5.4xlarge + - c5d.4xlarge + - i4i.4xlarge + - mac1.metal + - m5zn.3xlarge + - i3en.3xlarge + - z1d.3xlarge + - r5dn.2xlarge + - c3.2xlarge + - r5n.2xlarge + - r7a.2xlarge + - c7gd.2xlarge + - m6g.2xlarge + - m6i.2xlarge + - d3.2xlarge + - c6g.2xlarge + - f1.2xlarge + - r6i.2xlarge + - g5.2xlarge + - r7i.2xlarge + - c4.2xlarge + - m7gd.2xlarge + - x2iedn.2xlarge + - t4g.2xlarge + - c6in.2xlarge + - r6in.2xlarge + - r5ad.2xlarge + - c7g.2xlarge + - im4gn.2xlarge + - r5b.2xlarge + - x8g.2xlarge + - m6id.2xlarge + - c5a.2xlarge + - d3en.2xlarge + - c8g.2xlarge + - i4i.2xlarge + - c5d.2xlarge + - c7i.2xlarge + - g4dn.2xlarge + - r3.2xlarge + - m3.2xlarge + - m5dn.2xlarge + - g4ad.2xlarge + - m6a.2xlarge + - c6gn.2xlarge + - r4.2xlarge + - m5.2xlarge + - r5a.2xlarge + - t2.2xlarge + - m5zn.2xlarge + - m6idn.2xlarge + - r6g.2xlarge + - d2.2xlarge + - i3en.2xlarge + - c5ad.2xlarge + - c7a.2xlarge + - m6gd.2xlarge + - m6in.2xlarge + - is4gen.2xlarge + - r6a.2xlarge + - r7g.2xlarge + - r6gd.2xlarge + - c5n.2xlarge + - mac2-m2.metal + - m5a.2xlarge + - m5ad.2xlarge + - x1e.2xlarge + - m8g.2xlarge + - c6a.2xlarge + - r5d.2xlarge + - m7a.2xlarge + - r7gd.2xlarge + - c6gd.2xlarge + - m7g.2xlarge + - r6idn.2xlarge + - i3.2xlarge + - g5g.2xlarge + - c6id.2xlarge + - m5n.2xlarge + - t3.2xlarge + - c7i-flex.2xlarge + - i2.2xlarge + - a1.2xlarge + - r8g.2xlarge + - r6id.2xlarge + - inf1.2xlarge + - p3.2xlarge + - r7iz.2xlarge + - r5.2xlarge + - m4.2xlarge + - z1d.2xlarge + - m7i.2xlarge + - c6i.2xlarge + - m7i-flex.2xlarge + - c5.2xlarge + - m5d.2xlarge + - t3a.2xlarge + - g6.2xlarge + - c6i.xlarge + - a1.xlarge + - m7gd.xlarge + - r7a.xlarge + - r5a.xlarge + - c4.xlarge + - r5d.xlarge + - m6i.xlarge + - z1d.xlarge + - m6g.xlarge + - m5ad.xlarge + - t2.xlarge + - c6g.xlarge + - r5.xlarge + - inf1.xlarge + - g4ad.xlarge + - r3.xlarge + - d3en.xlarge + - g5g.xlarge + - m7i-flex.xlarge + - m6gd.xlarge + - r6gd.xlarge + - r7gd.xlarge + - c7a.xlarge + - d2.xlarge + - r5b.xlarge + - r6idn.xlarge + - m5dn.xlarge + - is4gen.xlarge + - r8g.xlarge + - i3.xlarge + - t3a.xlarge + - m6idn.xlarge + - c7i.xlarge + - m7g.xlarge + - c5n.xlarge + - r5n.xlarge + - p2.xlarge + - m6in.xlarge + - m6a.xlarge + - g5.xlarge + - m3.xlarge + - r6id.xlarge + - r6in.xlarge + - r5dn.xlarge + - m5d.xlarge + - r7g.xlarge + - c7i-flex.xlarge + - m7i.xlarge + - r4.xlarge + - m6id.xlarge + - c7gd.xlarge + - r6g.xlarge + - c6gd.xlarge + - c3.xlarge + - m5zn.xlarge + - r7i.xlarge + - m7a.xlarge + - m5.xlarge + - inf2.xlarge + - m5a.xlarge + - c6id.xlarge + - g4dn.xlarge + - m8g.xlarge + - t4g.xlarge + - c5.xlarge + - i2.xlarge + - r6i.xlarge + - c6gn.xlarge + - i4i.xlarge + - g3s.xlarge + - x1e.xlarge + - c5d.xlarge + - t3.xlarge + - c6a.xlarge + - c8g.xlarge + - r6a.xlarge + - c5ad.xlarge + - g6.xlarge + - m5n.xlarge + - x2iedn.xlarge + - m4.xlarge + - d3.xlarge + - c7g.xlarge + - i3en.xlarge + - r5ad.xlarge + - im4gn.xlarge + - r7iz.xlarge + - c5a.xlarge + - c6in.xlarge + - x8g.xlarge + - r6in.large + - m6id.large + - m5zn.large + - m7g.large + - r6idn.large + - r6a.large + - t3a.medium + - r4.large + - r7g.large + - t3.large + - m5n.large + - t3a.large + - c5n.large + - is4gen.large + - m5a.large + - c8g.large + - c5ad.large + - c7a.large + - c6i.large + - t3a.nano + - c3.large + - t3.nano + - t4g.large + - r5.large + - m3.large + - m7i.large + - t4g.micro + - r7a.large + - c6gn.large + - t2.large + - m6idn.large + - t4g.nano + - m5ad.large + - m6gd.large + - m6i.large + - i3.large + - m7gd.large + - m6in.large + - c6a.large + - r7gd.large + - r6gd.large + - m6a.large + - m7i-flex.large + - c6in.large + - i3en.large + - c5a.large + - r5a.large + - r5dn.large + - i4i.large + - r5b.large + - c5.large + - m5d.large + - r6g.large + - c7g.large + - m8g.large + - t3.small + - r3.large + - t3a.micro + - im4gn.large + - c7gd.large + - t2.medium + - m7a.large + - m5.large + - c5d.large + - c6id.large + - m5dn.large + - t3.medium + - r5ad.large + - r6id.large + - t4g.medium + - z1d.large + - a1.large + - c7i-flex.large + - x8g.large + - t4g.small + - t3.micro + - c6g.large + - m6g.large + - r5n.large + - r7i.large + - c7i.large + - c6gd.large + - r5d.large + - r8g.large + - c4.large + - t3a.small + - m4.large + - r7iz.large + - r6i.large + - c6g.medium + - x8g.medium + - c6gn.medium + - m7gd.medium + - m8g.medium + - r7a.medium + - m6g.medium + - m6gd.medium + - c7a.medium + - m3.medium + - c7gd.medium + - t2.micro + - r7g.medium + - t2.nano + - c7g.medium + - r7gd.medium + - a1.medium + - is4gen.medium + - t2.small + - r6gd.medium + - r6g.medium + - c6gd.medium + - m7g.medium + - r8g.medium + - m7a.medium + - c8g.medium eu-north-1: - - u-6tb1.112xlarge - - u-9tb1.112xlarge - - u-6tb1.56xlarge - - inf2.48xlarge - - hpc7a.96xlarge - - m7i.48xlarge - - g6.48xlarge - - c7i.48xlarge - - m7i.metal-48xl - - g5.48xlarge - - m7a.48xlarge - - c7a.48xlarge - - m7a.metal-48xl - - r7a.48xlarge - - r7i.metal-48xl - - c7i.metal-48xl - - p5.48xlarge - - r7i.48xlarge - - c7a.metal-48xl - - r7a.metal-48xl - - x2iedn.metal - - r7a.32xlarge - - c6i.32xlarge - - r6i.metal - - r6idn.32xlarge - - c6in.32xlarge - - r6idn.metal - - c6i.metal - - r6i.32xlarge - - x2idn.32xlarge - - m6idn.metal - - x2idn.metal - - m6in.metal - - i4i.32xlarge - - m6in.32xlarge - - r6in.metal - - x2iedn.32xlarge - - m7a.32xlarge - - m6i.metal - - c7a.32xlarge - - m6idn.32xlarge - - i4i.metal - - m6i.32xlarge - - r6in.32xlarge - - c6in.metal - - g6.24xlarge - - i3en.24xlarge - - r5b.24xlarge - - r7a.24xlarge - - c5.metal - - c5d.metal - - m7a.24xlarge - - m5d.metal - - hpc6a.48xlarge - - r5b.metal - - g5.24xlarge - - inf1.24xlarge - - r5n.24xlarge - - c5a.24xlarge - - r5d.24xlarge - - c7i.metal-24xl - - r6in.24xlarge - - m6idn.24xlarge - - g4dn.metal - - c6in.24xlarge - - m7i.metal-24xl - - m5.24xlarge - - c7i.24xlarge - - c7a.24xlarge - - i4i.24xlarge - - i3en.metal - - r5n.metal - - r5dn.24xlarge - - m5d.24xlarge - - m7i.24xlarge - - r5.24xlarge - - r5dn.metal - - r7i.24xlarge - - inf2.24xlarge - - x2iedn.24xlarge - - r7i.metal-24xl - - r6idn.24xlarge - - x2idn.24xlarge - - c6i.24xlarge - - m5.metal - - hpc7a.48xlarge - - c5.24xlarge - - r5.metal - - r6i.24xlarge - - m6in.24xlarge - - m6i.24xlarge - - r5d.metal - - c5d.24xlarge - - c5d.18xlarge - - i3.metal - - c5n.metal - - c5.18xlarge - - c5n.18xlarge - - c7g.16xlarge - - m7gd.metal - - r5dn.16xlarge - - m7g.16xlarge - - g5.16xlarge - - c6g.metal - - m6in.16xlarge - - c6g.16xlarge - - m5d.16xlarge - - r6gd.16xlarge - - m7gd.16xlarge - - r5d.16xlarge - - r5n.16xlarge - - c5a.16xlarge - - r6in.16xlarge - - r5b.16xlarge - - r7gd.metal - - m7i.16xlarge - - r7a.16xlarge - - c7a.16xlarge - - x2idn.16xlarge - - g6.16xlarge - - hpc6id.32xlarge - - c7gd.16xlarge - - i4i.16xlarge - - m5.16xlarge - - c6gn.16xlarge - - m6g.16xlarge - - c7gd.metal - - c6i.16xlarge - - r6idn.16xlarge - - r6i.16xlarge - - r5.16xlarge - - c6in.16xlarge - - c6gd.metal - - m6i.16xlarge - - c6gd.16xlarge - - m6gd.metal - - i3.16xlarge - - r7g.16xlarge - - r6gd.metal - - x2iedn.16xlarge - - g4dn.16xlarge - - r7g.metal - - c7g.metal - - m7g.metal - - r6g.metal - - m6g.metal - - c7i.16xlarge - - r7i.16xlarge - - m6gd.16xlarge - - r6g.16xlarge - - m6idn.16xlarge - - r7gd.16xlarge - - m7a.16xlarge - - c7i.12xlarge - - m7i.12xlarge - - r7g.12xlarge - - r5.12xlarge - - i4i.12xlarge - - r5dn.12xlarge - - m7a.12xlarge - - c7a.12xlarge - - m7gd.12xlarge - - m7g.12xlarge - - c6gn.12xlarge - - g4dn.12xlarge - - m5d.12xlarge - - c6i.12xlarge - - r6gd.12xlarge - - m5.12xlarge - - m6in.12xlarge - - c5a.12xlarge - - c6g.12xlarge - - m6gd.12xlarge - - r5d.12xlarge - - hpc7a.24xlarge - - r6i.12xlarge - - r5n.12xlarge - - c5d.12xlarge - - r7gd.12xlarge - - c7g.12xlarge - - g6.12xlarge - - c7gd.12xlarge - - c6in.12xlarge - - m6g.12xlarge - - r6g.12xlarge - - c5.12xlarge - - r7a.12xlarge - - m6idn.12xlarge - - r6in.12xlarge - - i3en.12xlarge - - m6i.12xlarge - - r7i.12xlarge - - c6gd.12xlarge - - r5b.12xlarge - - g5.12xlarge - - r6idn.12xlarge - - c5.9xlarge - - d2.8xlarge - - c5n.9xlarge - - c5d.9xlarge - - r6gd.8xlarge - - r5d.8xlarge - - c5a.8xlarge - - m6gd.8xlarge - - m6g.8xlarge - - c6in.8xlarge - - r7a.8xlarge - - c7g.8xlarge - - m7i.8xlarge - - r6g.8xlarge - - inf2.8xlarge - - r6idn.8xlarge - - x2iedn.8xlarge - - m6in.8xlarge - - c7i-flex.8xlarge - - g5.8xlarge - - c7a.8xlarge - - m5.8xlarge - - r7gd.8xlarge - - m6idn.8xlarge - - m6i.8xlarge - - m7g.8xlarge - - c6g.8xlarge - - r6in.8xlarge - - c6i.8xlarge - - i3.8xlarge - - r5.8xlarge - - c6gd.8xlarge - - m7i-flex.8xlarge - - r5b.8xlarge - - g6.8xlarge - - i4i.8xlarge - - c7i.8xlarge - - m7gd.8xlarge - - r5dn.8xlarge - - c6gn.8xlarge - - m7a.8xlarge - - r6i.8xlarge - - m5d.8xlarge - - c7gd.8xlarge - - gr6.8xlarge - - r7g.8xlarge - - r5n.8xlarge - - r7i.8xlarge - - g4dn.8xlarge - - i3en.6xlarge - - hpc7a.12xlarge - - inf1.6xlarge - - r5d.4xlarge - - gr6.4xlarge - - c6gn.4xlarge - - c5a.4xlarge - - r5n.4xlarge - - r6g.4xlarge - - m7i.4xlarge - - c5n.4xlarge - - c6gd.4xlarge - - r5b.4xlarge - - r5.4xlarge - - m7a.4xlarge - - m5.4xlarge - - d2.4xlarge - - c7a.4xlarge - - g5.4xlarge - - r6gd.4xlarge - - c6in.4xlarge - - c7i.4xlarge - - m6gd.4xlarge - - m7i-flex.4xlarge - - c6i.4xlarge - - c7g.4xlarge - - m6i.4xlarge - - m7gd.4xlarge - - r7gd.4xlarge - - g6.4xlarge - - r7a.4xlarge - - c7i-flex.4xlarge - - c6g.4xlarge - - c5d.4xlarge - - i4i.4xlarge - - m5d.4xlarge - - r7i.4xlarge - - r7g.4xlarge - - c5.4xlarge - - g4dn.4xlarge - - i3.4xlarge - - r5dn.4xlarge - - r6i.4xlarge - - m6idn.4xlarge - - x2iedn.4xlarge - - m6in.4xlarge - - r6in.4xlarge - - m6g.4xlarge - - c7gd.4xlarge - - r6idn.4xlarge - - m7g.4xlarge - - i3en.3xlarge - - mac1.metal - - r5b.2xlarge - - c6gd.2xlarge - - c7g.2xlarge - - r6i.2xlarge - - r5d.2xlarge - - m5d.2xlarge - - c5d.2xlarge - - c7i-flex.2xlarge - - m6i.2xlarge - - g4dn.2xlarge - - m7i.2xlarge - - r5n.2xlarge - - c6in.2xlarge - - r7gd.2xlarge - - t4g.2xlarge - - m6in.2xlarge - - r7i.2xlarge - - r7g.2xlarge - - c6i.2xlarge - - r5dn.2xlarge - - c7i.2xlarge - - m6idn.2xlarge - - m7g.2xlarge - - m7gd.2xlarge - - i3.2xlarge - - x2iedn.2xlarge - - c6gn.2xlarge - - m5.2xlarge - - r7a.2xlarge - - c7gd.2xlarge - - m6g.2xlarge - - c7a.2xlarge - - c5a.2xlarge - - c5n.2xlarge - - g5.2xlarge - - g6.2xlarge - - i4i.2xlarge - - inf1.2xlarge - - r6gd.2xlarge - - r6g.2xlarge - - d2.2xlarge - - r6in.2xlarge - - m7i-flex.2xlarge - - c6g.2xlarge - - t3.2xlarge - - i3en.2xlarge - - m7a.2xlarge - - r5.2xlarge - - m6gd.2xlarge - - r6idn.2xlarge - - c5.2xlarge - - g4dn.xlarge - - r6idn.xlarge - - c5n.xlarge - - r6in.xlarge - - c5.xlarge - - c7i-flex.xlarge - - m7a.xlarge - - i4i.xlarge - - r6gd.xlarge - - m7g.xlarge - - t3.xlarge - - r5b.xlarge - - m6idn.xlarge - - c6gd.xlarge - - c6in.xlarge - - r7a.xlarge - - c7i.xlarge - - d2.xlarge - - r5.xlarge - - c6g.xlarge - - r7i.xlarge - - x2iedn.xlarge - - i3.xlarge - - c7gd.xlarge - - r6g.xlarge - - m6i.xlarge - - t4g.xlarge - - c5a.xlarge - - c7a.xlarge - - r5d.xlarge - - c6gn.xlarge - - g5.xlarge - - m7gd.xlarge - - m5d.xlarge - - c5d.xlarge - - m6gd.xlarge - - m7i-flex.xlarge - - m6in.xlarge - - m7i.xlarge - - g6.xlarge - - r6i.xlarge - - c7g.xlarge - - r7g.xlarge - - m5.xlarge - - m6g.xlarge - - r5dn.xlarge - - c6i.xlarge - - r7gd.xlarge - - i3en.xlarge - - inf2.xlarge - - r5n.xlarge - - inf1.xlarge - - t3.nano - - m5d.large - - r7g.large - - c7g.large - - c5n.large - - m6in.large - - t3.medium - - m7gd.large - - r5b.large - - r6idn.large - - c7i-flex.large - - r6gd.large - - m6i.large - - c6gd.large - - r5.large - - m7i-flex.large - - c6gn.large - - m6idn.large - - m6gd.large - - r5d.large - - c7i.large - - c5.large - - t4g.medium - - c7a.large - - r6g.large - - m7a.large - - r5n.large - - m5.large - - c6g.large - - t4g.nano - - r7gd.large - - c6in.large - - t3.micro - - i4i.large - - r7i.large - - m7g.large - - c5d.large - - r6in.large - - c7gd.large - - c5a.large - - c6i.large - - r6i.large - - t4g.small - - t3.small - - t3.large - - t4g.large - - m7i.large - - t4g.micro - - r5dn.large - - i3en.large - - m6g.large - - i3.large - - r7a.large - - m7g.medium - - m7gd.medium - - m6gd.medium - - r7a.medium - - c6g.medium - - m6g.medium - - c6gn.medium - - r6g.medium - - c7g.medium - - m7a.medium - - c7gd.medium - - r7gd.medium - - r7g.medium - - c6gd.medium - - r6gd.medium - - c7a.medium + - u-6tb1.112xlarge + - u-9tb1.112xlarge + - u-6tb1.56xlarge + - inf2.48xlarge + - hpc7a.96xlarge + - m7i.48xlarge + - g6.48xlarge + - c7i.48xlarge + - m7i.metal-48xl + - g5.48xlarge + - m7a.48xlarge + - c7a.48xlarge + - m7a.metal-48xl + - r7a.48xlarge + - r7i.metal-48xl + - c7i.metal-48xl + - p5.48xlarge + - r7i.48xlarge + - c7a.metal-48xl + - r7a.metal-48xl + - x2iedn.metal + - r7a.32xlarge + - c6i.32xlarge + - r6i.metal + - r6idn.32xlarge + - c6in.32xlarge + - r6idn.metal + - c6i.metal + - r6i.32xlarge + - x2idn.32xlarge + - m6idn.metal + - x2idn.metal + - m6in.metal + - i4i.32xlarge + - m6in.32xlarge + - r6in.metal + - x2iedn.32xlarge + - m7a.32xlarge + - m6i.metal + - c7a.32xlarge + - m6idn.32xlarge + - i4i.metal + - m6i.32xlarge + - r6in.32xlarge + - c6in.metal + - g6.24xlarge + - i3en.24xlarge + - r5b.24xlarge + - r7a.24xlarge + - c5.metal + - c5d.metal + - m7a.24xlarge + - m5d.metal + - hpc6a.48xlarge + - r5b.metal + - g5.24xlarge + - inf1.24xlarge + - r5n.24xlarge + - c5a.24xlarge + - r5d.24xlarge + - c7i.metal-24xl + - r6in.24xlarge + - m6idn.24xlarge + - g4dn.metal + - c6in.24xlarge + - m7i.metal-24xl + - m5.24xlarge + - c7i.24xlarge + - c7a.24xlarge + - i4i.24xlarge + - i3en.metal + - r5n.metal + - r5dn.24xlarge + - m5d.24xlarge + - m7i.24xlarge + - r5.24xlarge + - r5dn.metal + - r7i.24xlarge + - inf2.24xlarge + - x2iedn.24xlarge + - r7i.metal-24xl + - r6idn.24xlarge + - x2idn.24xlarge + - c6i.24xlarge + - m5.metal + - hpc7a.48xlarge + - c5.24xlarge + - r5.metal + - r6i.24xlarge + - m6in.24xlarge + - m6i.24xlarge + - r5d.metal + - c5d.24xlarge + - c5d.18xlarge + - i3.metal + - c5n.metal + - c5.18xlarge + - c5n.18xlarge + - c7g.16xlarge + - m7gd.metal + - r5dn.16xlarge + - m7g.16xlarge + - g5.16xlarge + - c6g.metal + - m6in.16xlarge + - c6g.16xlarge + - m5d.16xlarge + - r6gd.16xlarge + - m7gd.16xlarge + - r5d.16xlarge + - r5n.16xlarge + - c5a.16xlarge + - r6in.16xlarge + - r5b.16xlarge + - r7gd.metal + - m7i.16xlarge + - r7a.16xlarge + - c7a.16xlarge + - x2idn.16xlarge + - g6.16xlarge + - hpc6id.32xlarge + - c7gd.16xlarge + - i4i.16xlarge + - m5.16xlarge + - c6gn.16xlarge + - m6g.16xlarge + - c7gd.metal + - c6i.16xlarge + - r6idn.16xlarge + - r6i.16xlarge + - r5.16xlarge + - c6in.16xlarge + - c6gd.metal + - m6i.16xlarge + - c6gd.16xlarge + - m6gd.metal + - i3.16xlarge + - r7g.16xlarge + - r6gd.metal + - x2iedn.16xlarge + - g4dn.16xlarge + - r7g.metal + - c7g.metal + - m7g.metal + - r6g.metal + - m6g.metal + - c7i.16xlarge + - r7i.16xlarge + - m6gd.16xlarge + - r6g.16xlarge + - m6idn.16xlarge + - r7gd.16xlarge + - m7a.16xlarge + - c7i.12xlarge + - m7i.12xlarge + - r7g.12xlarge + - r5.12xlarge + - i4i.12xlarge + - r5dn.12xlarge + - m7a.12xlarge + - c7a.12xlarge + - m7gd.12xlarge + - m7g.12xlarge + - c6gn.12xlarge + - g4dn.12xlarge + - m5d.12xlarge + - c6i.12xlarge + - r6gd.12xlarge + - m5.12xlarge + - m6in.12xlarge + - c5a.12xlarge + - c6g.12xlarge + - m6gd.12xlarge + - r5d.12xlarge + - hpc7a.24xlarge + - r6i.12xlarge + - r5n.12xlarge + - c5d.12xlarge + - r7gd.12xlarge + - c7g.12xlarge + - g6.12xlarge + - c7gd.12xlarge + - c6in.12xlarge + - m6g.12xlarge + - r6g.12xlarge + - c5.12xlarge + - r7a.12xlarge + - m6idn.12xlarge + - r6in.12xlarge + - i3en.12xlarge + - m6i.12xlarge + - r7i.12xlarge + - c6gd.12xlarge + - r5b.12xlarge + - g5.12xlarge + - r6idn.12xlarge + - c5.9xlarge + - d2.8xlarge + - c5n.9xlarge + - c5d.9xlarge + - r6gd.8xlarge + - r5d.8xlarge + - c5a.8xlarge + - m6gd.8xlarge + - m6g.8xlarge + - c6in.8xlarge + - r7a.8xlarge + - c7g.8xlarge + - m7i.8xlarge + - r6g.8xlarge + - inf2.8xlarge + - r6idn.8xlarge + - x2iedn.8xlarge + - m6in.8xlarge + - c7i-flex.8xlarge + - g5.8xlarge + - c7a.8xlarge + - m5.8xlarge + - r7gd.8xlarge + - m6idn.8xlarge + - m6i.8xlarge + - m7g.8xlarge + - c6g.8xlarge + - r6in.8xlarge + - c6i.8xlarge + - i3.8xlarge + - r5.8xlarge + - c6gd.8xlarge + - m7i-flex.8xlarge + - r5b.8xlarge + - g6.8xlarge + - i4i.8xlarge + - c7i.8xlarge + - m7gd.8xlarge + - r5dn.8xlarge + - c6gn.8xlarge + - m7a.8xlarge + - r6i.8xlarge + - m5d.8xlarge + - c7gd.8xlarge + - gr6.8xlarge + - r7g.8xlarge + - r5n.8xlarge + - r7i.8xlarge + - g4dn.8xlarge + - i3en.6xlarge + - hpc7a.12xlarge + - inf1.6xlarge + - r5d.4xlarge + - gr6.4xlarge + - c6gn.4xlarge + - c5a.4xlarge + - r5n.4xlarge + - r6g.4xlarge + - m7i.4xlarge + - c5n.4xlarge + - c6gd.4xlarge + - r5b.4xlarge + - r5.4xlarge + - m7a.4xlarge + - m5.4xlarge + - d2.4xlarge + - c7a.4xlarge + - g5.4xlarge + - r6gd.4xlarge + - c6in.4xlarge + - c7i.4xlarge + - m6gd.4xlarge + - m7i-flex.4xlarge + - c6i.4xlarge + - c7g.4xlarge + - m6i.4xlarge + - m7gd.4xlarge + - r7gd.4xlarge + - g6.4xlarge + - r7a.4xlarge + - c7i-flex.4xlarge + - c6g.4xlarge + - c5d.4xlarge + - i4i.4xlarge + - m5d.4xlarge + - r7i.4xlarge + - r7g.4xlarge + - c5.4xlarge + - g4dn.4xlarge + - i3.4xlarge + - r5dn.4xlarge + - r6i.4xlarge + - m6idn.4xlarge + - x2iedn.4xlarge + - m6in.4xlarge + - r6in.4xlarge + - m6g.4xlarge + - c7gd.4xlarge + - r6idn.4xlarge + - m7g.4xlarge + - i3en.3xlarge + - mac1.metal + - r5b.2xlarge + - c6gd.2xlarge + - c7g.2xlarge + - r6i.2xlarge + - r5d.2xlarge + - m5d.2xlarge + - c5d.2xlarge + - c7i-flex.2xlarge + - m6i.2xlarge + - g4dn.2xlarge + - m7i.2xlarge + - r5n.2xlarge + - c6in.2xlarge + - r7gd.2xlarge + - t4g.2xlarge + - m6in.2xlarge + - r7i.2xlarge + - r7g.2xlarge + - c6i.2xlarge + - r5dn.2xlarge + - c7i.2xlarge + - m6idn.2xlarge + - m7g.2xlarge + - m7gd.2xlarge + - i3.2xlarge + - x2iedn.2xlarge + - c6gn.2xlarge + - m5.2xlarge + - r7a.2xlarge + - c7gd.2xlarge + - m6g.2xlarge + - c7a.2xlarge + - c5a.2xlarge + - c5n.2xlarge + - g5.2xlarge + - g6.2xlarge + - i4i.2xlarge + - inf1.2xlarge + - r6gd.2xlarge + - r6g.2xlarge + - d2.2xlarge + - r6in.2xlarge + - m7i-flex.2xlarge + - c6g.2xlarge + - t3.2xlarge + - i3en.2xlarge + - m7a.2xlarge + - r5.2xlarge + - m6gd.2xlarge + - r6idn.2xlarge + - c5.2xlarge + - g4dn.xlarge + - r6idn.xlarge + - c5n.xlarge + - r6in.xlarge + - c5.xlarge + - c7i-flex.xlarge + - m7a.xlarge + - i4i.xlarge + - r6gd.xlarge + - m7g.xlarge + - t3.xlarge + - r5b.xlarge + - m6idn.xlarge + - c6gd.xlarge + - c6in.xlarge + - r7a.xlarge + - c7i.xlarge + - d2.xlarge + - r5.xlarge + - c6g.xlarge + - r7i.xlarge + - x2iedn.xlarge + - i3.xlarge + - c7gd.xlarge + - r6g.xlarge + - m6i.xlarge + - t4g.xlarge + - c5a.xlarge + - c7a.xlarge + - r5d.xlarge + - c6gn.xlarge + - g5.xlarge + - m7gd.xlarge + - m5d.xlarge + - c5d.xlarge + - m6gd.xlarge + - m7i-flex.xlarge + - m6in.xlarge + - m7i.xlarge + - g6.xlarge + - r6i.xlarge + - c7g.xlarge + - r7g.xlarge + - m5.xlarge + - m6g.xlarge + - r5dn.xlarge + - c6i.xlarge + - r7gd.xlarge + - i3en.xlarge + - inf2.xlarge + - r5n.xlarge + - inf1.xlarge + - t3.nano + - m5d.large + - r7g.large + - c7g.large + - c5n.large + - m6in.large + - t3.medium + - m7gd.large + - r5b.large + - r6idn.large + - c7i-flex.large + - r6gd.large + - m6i.large + - c6gd.large + - r5.large + - m7i-flex.large + - c6gn.large + - m6idn.large + - m6gd.large + - r5d.large + - c7i.large + - c5.large + - t4g.medium + - c7a.large + - r6g.large + - m7a.large + - r5n.large + - m5.large + - c6g.large + - t4g.nano + - r7gd.large + - c6in.large + - t3.micro + - i4i.large + - r7i.large + - m7g.large + - c5d.large + - r6in.large + - c7gd.large + - c5a.large + - c6i.large + - r6i.large + - t4g.small + - t3.small + - t3.large + - t4g.large + - m7i.large + - t4g.micro + - r5dn.large + - i3en.large + - m6g.large + - i3.large + - r7a.large + - m7g.medium + - m7gd.medium + - m6gd.medium + - r7a.medium + - c6g.medium + - m6g.medium + - c6gn.medium + - r6g.medium + - c7g.medium + - m7a.medium + - c7gd.medium + - r7gd.medium + - r7g.medium + - c6gd.medium + - r6gd.medium + - c7a.medium eu-west-1: - - u-6tb1.112xlarge - - u-12tb1.112xlarge - - u-9tb1.112xlarge - - u-18tb1.112xlarge - - u-6tb1.56xlarge - - u-3tb1.56xlarge - - r7i.48xlarge - - r6a.metal - - r7a.48xlarge - - m7a.metal-48xl - - c7i.48xlarge - - g5.48xlarge - - c6a.metal - - inf2.48xlarge - - hpc7a.96xlarge - - r7a.metal-48xl - - c7a.metal-48xl - - r7i.metal-48xl - - c7i.metal-48xl - - m6a.metal - - m7a.48xlarge - - r6a.48xlarge - - m7i.metal-48xl - - m6a.48xlarge - - c6a.48xlarge - - c7a.48xlarge - - m7i.48xlarge - - m6id.metal - - c6in.32xlarge - - m6a.32xlarge - - c6id.32xlarge - - x2iedn.32xlarge - - m6i.metal - - i4i.32xlarge - - r7iz.32xlarge - - x1e.32xlarge - - r6in.metal - - c6a.32xlarge - - m6id.32xlarge - - m6idn.32xlarge - - c6i.metal - - r7iz.metal-32xl - - x1.32xlarge - - x2idn.32xlarge - - r6id.32xlarge - - c7a.32xlarge - - r6i.32xlarge - - r6a.32xlarge - - r6i.metal - - i4i.metal - - m6idn.metal - - r6in.32xlarge - - m6i.32xlarge - - m7a.32xlarge - - m6in.32xlarge - - r6idn.metal - - x2iedn.metal - - c6i.32xlarge - - c6id.metal - - m6in.metal - - c6in.metal - - x2idn.metal - - r6id.metal - - r6idn.32xlarge - - r7a.32xlarge - - r5.metal - - vt1.24xlarge - - c5a.24xlarge - - hpc7a.48xlarge - - c5d.24xlarge - - c6in.24xlarge - - i3en.metal - - m7i.metal-24xl - - m5dn.metal - - m5ad.24xlarge - - r5dn.24xlarge - - inf2.24xlarge - - x2idn.24xlarge - - r5dn.metal - - r5b.24xlarge - - r5d.metal - - c5d.metal - - c5.metal - - r6a.24xlarge - - m6a.24xlarge - - g5.24xlarge - - r6i.24xlarge - - i3en.24xlarge - - r6id.24xlarge - - m5.metal - - r6in.24xlarge - - r7i.metal-24xl - - p4d.24xlarge - - c7i.24xlarge - - r5b.metal - - r5a.24xlarge - - c7i.metal-24xl - - p3dn.24xlarge - - c5.24xlarge - - r5n.metal - - c5ad.24xlarge - - m7a.24xlarge - - m5.24xlarge - - c7a.24xlarge - - i4i.24xlarge - - r7i.24xlarge - - c6i.24xlarge - - r7a.24xlarge - - m6idn.24xlarge - - m5n.24xlarge - - g4dn.metal - - c6id.24xlarge - - m6id.24xlarge - - r6idn.24xlarge - - m5d.24xlarge - - r5.24xlarge - - r5ad.24xlarge - - m7i.24xlarge - - m5dn.24xlarge - - r5d.24xlarge - - m5d.metal - - c6a.24xlarge - - r5n.24xlarge - - m5a.24xlarge - - m6in.24xlarge - - m6i.24xlarge - - x2iedn.24xlarge - - inf1.24xlarge - - c5d.18xlarge - - c5n.metal - - c5.18xlarge - - c5n.18xlarge - - i3.metal - - r7a.16xlarge - - x2iedn.16xlarge - - r7i.16xlarge - - r7gd.metal - - x1.16xlarge - - x2idn.16xlarge - - c6g.metal - - r6i.16xlarge - - g5.16xlarge - - r7iz.16xlarge - - r4.16xlarge - - r5d.16xlarge - - f1.16xlarge - - c7a.16xlarge - - r5ad.16xlarge - - m6id.16xlarge - - m6a.16xlarge - - m6g.metal - - m4.16xlarge - - r6idn.16xlarge - - h1.16xlarge - - r6g.16xlarge - - r5n.16xlarge - - c5a.16xlarge - - c6g.16xlarge - - m6idn.16xlarge - - c7g.metal - - c6gd.16xlarge - - m6i.16xlarge - - c7g.16xlarge - - g4dn.16xlarge - - m5.16xlarge - - i4g.16xlarge - - r5dn.16xlarge - - c7gn.16xlarge - - m5a.16xlarge - - r6a.16xlarge - - g4ad.16xlarge - - i3.16xlarge - - m7gd.16xlarge - - c7gn.metal - - m7i.16xlarge - - r6id.16xlarge - - hpc7g.16xlarge - - r6gd.16xlarge - - m5dn.16xlarge - - r7g.16xlarge - - c7i.16xlarge - - m6g.16xlarge - - im4gn.16xlarge - - m7gd.metal - - m5n.16xlarge - - r5.16xlarge - - r5b.16xlarge - - g3.16xlarge - - m6in.16xlarge - - c6id.16xlarge - - c7gd.metal - - x2gd.16xlarge - - r6in.16xlarge - - m7g.16xlarge - - r6g.metal - - r5a.16xlarge - - p2.16xlarge - - r7iz.metal-16xl - - m6gd.16xlarge - - c6a.16xlarge - - p3.16xlarge - - m5d.16xlarge - - x2gd.metal - - c5ad.16xlarge - - m7g.metal - - i4i.16xlarge - - c6i.16xlarge - - c6in.16xlarge - - m6gd.metal - - m7a.16xlarge - - r7g.metal - - c6gn.16xlarge - - c7gd.16xlarge - - r6gd.metal - - m5ad.16xlarge - - r7gd.16xlarge - - x1e.16xlarge - - c6gd.metal - - m6i.12xlarge - - r6idn.12xlarge - - r5a.12xlarge - - r6in.12xlarge - - c6i.12xlarge - - r5dn.12xlarge - - r6id.12xlarge - - r7a.12xlarge - - g4dn.12xlarge - - m7i.12xlarge - - m5ad.12xlarge - - m5dn.12xlarge - - m5zn.12xlarge - - z1d.metal - - m5.12xlarge - - x2gd.12xlarge - - c6id.12xlarge - - m6gd.12xlarge - - m7g.12xlarge - - r5ad.12xlarge - - x2iezn.12xlarge - - m6id.12xlarge - - m5zn.metal - - m6g.12xlarge - - m5a.12xlarge - - c6g.12xlarge - - r6a.12xlarge - - z1d.12xlarge - - r5b.12xlarge - - m6in.12xlarge - - g5.12xlarge - - i4i.12xlarge - - c6gd.12xlarge - - c5.12xlarge - - c7gn.12xlarge - - m5n.12xlarge - - m7a.12xlarge - - c5ad.12xlarge - - m6a.12xlarge - - r7iz.12xlarge - - r6gd.12xlarge - - r7i.12xlarge - - m6idn.12xlarge - - c5a.12xlarge - - r5.12xlarge - - c5d.12xlarge - - i3en.12xlarge - - hpc7a.24xlarge - - m7gd.12xlarge - - c6gn.12xlarge - - c6a.12xlarge - - c6in.12xlarge - - r7g.12xlarge - - c7g.12xlarge - - r5n.12xlarge - - r5d.12xlarge - - x2iezn.metal - - c7i.12xlarge - - c7gd.12xlarge - - r7gd.12xlarge - - r6i.12xlarge - - d3en.12xlarge - - m5d.12xlarge - - r6g.12xlarge - - c7a.12xlarge - - m4.10xlarge - - c5n.9xlarge - - d2.8xlarge - - c4.8xlarge - - c5.9xlarge - - c5d.9xlarge - - m5.8xlarge - - m7gd.8xlarge - - c6gn.8xlarge - - r7iz.8xlarge - - h1.8xlarge - - m6idn.8xlarge - - r3.8xlarge - - g4ad.8xlarge - - c7g.8xlarge - - m5n.8xlarge - - m7i.8xlarge - - m6a.8xlarge - - c7a.8xlarge - - g5.8xlarge - - r5a.8xlarge - - c5a.8xlarge - - m6in.8xlarge - - c7i.8xlarge - - r6g.8xlarge - - p2.8xlarge - - r4.8xlarge - - r5ad.8xlarge - - c7i-flex.8xlarge - - r7gd.8xlarge - - m7a.8xlarge - - c7gd.8xlarge - - m6i.8xlarge - - m7g.8xlarge - - r5d.8xlarge - - m5a.8xlarge - - r5.8xlarge - - c6i.8xlarge - - g4dn.8xlarge - - i3.8xlarge - - m6gd.8xlarge - - r5n.8xlarge - - m7i-flex.8xlarge - - i2.8xlarge - - r5dn.8xlarge - - r6gd.8xlarge - - r6idn.8xlarge - - g3.8xlarge - - inf2.8xlarge - - m6g.8xlarge - - x2gd.8xlarge - - d3.8xlarge - - hpc7g.8xlarge - - r7g.8xlarge - - im4gn.8xlarge - - m6id.8xlarge - - m5dn.8xlarge - - m5ad.8xlarge - - x2iedn.8xlarge - - x1e.8xlarge - - c6id.8xlarge - - r6a.8xlarge - - c6gd.8xlarge - - x2iezn.8xlarge - - m5d.8xlarge - - c3.8xlarge - - c7gn.8xlarge - - i4g.8xlarge - - r5b.8xlarge - - c6a.8xlarge - - r6id.8xlarge - - d3en.8xlarge - - c5ad.8xlarge - - r6in.8xlarge - - r6i.8xlarge - - i4i.8xlarge - - r7a.8xlarge - - p3.8xlarge - - is4gen.8xlarge - - c6g.8xlarge - - c6in.8xlarge - - r7i.8xlarge - - i3en.6xlarge - - d3en.6xlarge - - inf1.6xlarge - - x2iezn.6xlarge - - hpc7a.12xlarge - - m5zn.6xlarge - - z1d.6xlarge - - vt1.6xlarge - - c6in.4xlarge - - m6in.4xlarge - - m4.4xlarge - - r6gd.4xlarge - - m6idn.4xlarge - - x1e.4xlarge - - c5.4xlarge - - m5d.4xlarge - - m6a.4xlarge - - c6id.4xlarge - - r5a.4xlarge - - m5a.4xlarge - - c7gn.4xlarge - - m5ad.4xlarge - - g5.4xlarge - - c6i.4xlarge - - i3.4xlarge - - r5ad.4xlarge - - r5d.4xlarge - - r6id.4xlarge - - r4.4xlarge - - r5n.4xlarge - - m7a.4xlarge - - g3.4xlarge - - d3.4xlarge - - c5ad.4xlarge - - r5.4xlarge - - c7gd.4xlarge - - m7i-flex.4xlarge - - g4ad.4xlarge - - m5n.4xlarge - - m5.4xlarge - - g4dn.4xlarge - - r5dn.4xlarge - - c7i-flex.4xlarge - - m6i.4xlarge - - c5d.4xlarge - - f1.4xlarge - - c6a.4xlarge - - r3.4xlarge - - c7i.4xlarge - - a1.metal - - h1.4xlarge - - x2gd.4xlarge - - m7i.4xlarge - - r6i.4xlarge - - m5dn.4xlarge - - m6g.4xlarge - - c5a.4xlarge - - i4i.4xlarge - - d2.4xlarge - - m7g.4xlarge - - i2.4xlarge - - r7g.4xlarge - - r5b.4xlarge - - r7iz.4xlarge - - r6g.4xlarge - - c6gn.4xlarge - - m6id.4xlarge - - m7gd.4xlarge - - c5n.4xlarge - - x2iedn.4xlarge - - r7gd.4xlarge - - m6gd.4xlarge - - r6a.4xlarge - - i4g.4xlarge - - c6gd.4xlarge - - hpc7g.4xlarge - - im4gn.4xlarge - - c4.4xlarge - - c3.4xlarge - - a1.4xlarge - - d3en.4xlarge - - r7a.4xlarge - - c7g.4xlarge - - c7a.4xlarge - - r7i.4xlarge - - r6in.4xlarge - - x2iezn.4xlarge - - is4gen.4xlarge - - r6idn.4xlarge - - c6g.4xlarge - - m5zn.3xlarge - - z1d.3xlarge - - mac1.metal - - vt1.3xlarge - - i3en.3xlarge - - r5.2xlarge - - m5zn.2xlarge - - c7g.2xlarge - - c7i-flex.2xlarge - - r5dn.2xlarge - - m6a.2xlarge - - r7a.2xlarge - - r6g.2xlarge - - m7i.2xlarge - - r5n.2xlarge - - z1d.2xlarge - - r6id.2xlarge - - i3.2xlarge - - c5n.2xlarge - - r5d.2xlarge - - m7gd.2xlarge - - c5ad.2xlarge - - r7g.2xlarge - - c4.2xlarge - - c7i.2xlarge - - c7gd.2xlarge - - c6gd.2xlarge - - m6gd.2xlarge - - m6in.2xlarge - - c1.xlarge - - r4.2xlarge - - r5ad.2xlarge - - a1.2xlarge - - m7a.2xlarge - - mac2.metal - - m6idn.2xlarge - - r6i.2xlarge - - r5a.2xlarge - - r7gd.2xlarge - - c5d.2xlarge - - d2.2xlarge - - m6id.2xlarge - - t3a.2xlarge - - x2gd.2xlarge - - r6idn.2xlarge - - m7g.2xlarge - - h1.2xlarge - - c7gn.2xlarge - - c6i.2xlarge - - inf1.2xlarge - - m5a.2xlarge - - g5.2xlarge - - c6in.2xlarge - - g4ad.2xlarge - - c5a.2xlarge - - i2.2xlarge - - m5ad.2xlarge - - x2iezn.2xlarge - - c6gn.2xlarge - - p3.2xlarge - - c7a.2xlarge - - t3.2xlarge - - c6id.2xlarge - - r7iz.2xlarge - - t4g.2xlarge - - m3.2xlarge - - m5dn.2xlarge - - c6g.2xlarge - - r6a.2xlarge - - c6a.2xlarge - - m2.4xlarge - - m6i.2xlarge - - m5n.2xlarge - - m5d.2xlarge - - r5b.2xlarge - - t2.2xlarge - - m5.2xlarge - - x2iedn.2xlarge - - r6gd.2xlarge - - m6g.2xlarge - - is4gen.2xlarge - - f1.2xlarge - - c3.2xlarge - - m4.2xlarge - - i3en.2xlarge - - i4g.2xlarge - - x1e.2xlarge - - g4dn.2xlarge - - r3.2xlarge - - c5.2xlarge - - im4gn.2xlarge - - r7i.2xlarge - - i4i.2xlarge - - r6in.2xlarge - - d3en.2xlarge - - m7i-flex.2xlarge - - d3.2xlarge - - c5d.xlarge - - r6i.xlarge - - r5b.xlarge - - c7i-flex.xlarge - - m7gd.xlarge - - x2gd.xlarge - - t3a.xlarge - - m6i.xlarge - - m6idn.xlarge - - d3.xlarge - - c6in.xlarge - - r5a.xlarge - - r5d.xlarge - - r7a.xlarge - - r5dn.xlarge - - c6gd.xlarge - - r5ad.xlarge - - m7i.xlarge - - r5n.xlarge - - r6a.xlarge - - t3.xlarge - - m5n.xlarge - - m6g.xlarge - - c7gd.xlarge - - z1d.xlarge - - m6in.xlarge - - m5.xlarge - - g5.xlarge - - c5ad.xlarge - - m6id.xlarge - - is4gen.xlarge - - m4.xlarge - - m5zn.xlarge - - m3.xlarge - - g4ad.xlarge - - c5.xlarge - - x2iedn.xlarge - - m7i-flex.xlarge - - d3en.xlarge - - c6g.xlarge - - r7g.xlarge - - c3.xlarge - - m6gd.xlarge - - t2.xlarge - - r6g.xlarge - - inf2.xlarge - - m1.xlarge - - c7g.xlarge - - x1e.xlarge - - a1.xlarge - - m2.2xlarge - - i3en.xlarge - - c7a.xlarge - - r6in.xlarge - - c7i.xlarge - - g4dn.xlarge - - c6id.xlarge - - im4gn.xlarge - - c5a.xlarge - - i4i.xlarge - - m5ad.xlarge - - m5a.xlarge - - m5d.xlarge - - c7gn.xlarge - - t4g.xlarge - - m7a.xlarge - - r5.xlarge - - c5n.xlarge - - m6a.xlarge - - c4.xlarge - - r6id.xlarge - - c6a.xlarge - - r4.xlarge - - i2.xlarge - - r6gd.xlarge - - r7i.xlarge - - c6i.xlarge - - d2.xlarge - - i4g.xlarge - - m5dn.xlarge - - r7iz.xlarge - - i3.xlarge - - m7g.xlarge - - p2.xlarge - - r3.xlarge - - g3s.xlarge - - r7gd.xlarge - - inf1.xlarge - - r6idn.xlarge - - c6gn.xlarge - - c7g.large - - r4.large - - m7i-flex.large - - m5ad.large - - t3.small - - m5zn.large - - c5ad.large - - i3en.large - - m3.large - - c7gn.large - - r5a.large - - m7g.large - - r5.large - - c7a.large - - t4g.small - - m6gd.large - - t2.large - - i4i.large - - m1.large - - r7gd.large - - r6a.large - - t3.nano - - a1.large - - c5a.large - - r5b.large - - r6idn.large - - t4g.medium - - m2.xlarge - - m5d.large - - is4gen.large - - t3a.small - - m6a.large - - r7g.large - - t3.large - - c5n.large - - c6in.large - - t3.micro - - m6i.large - - c6i.large - - r6in.large - - t4g.micro - - r6i.large - - r7a.large - - c6id.large - - m5.large - - c3.large - - c1.medium - - m7gd.large - - t3.medium - - i4g.large - - x2gd.large - - c4.large - - t3a.large - - m6id.large - - t3a.nano - - r7i.large - - c5d.large - - r5ad.large - - i3.large - - r6gd.large - - im4gn.large - - c6gd.large - - r3.large - - c6a.large - - r5dn.large - - z1d.large - - t2.medium - - c7i-flex.large - - m5a.large - - r7iz.large - - r5n.large - - c6g.large - - m6idn.large - - t3a.medium - - c7i.large - - r6g.large - - r6id.large - - m5dn.large - - t3a.micro - - r5d.large - - m5n.large - - t4g.large - - c7gd.large - - m7i.large - - c6gn.large - - m7a.large - - t4g.nano - - m6g.large - - c5.large - - m4.large - - m6in.large - - r7gd.medium - - t2.micro - - m7a.medium - - m6g.medium - - m7g.medium - - c7gd.medium - - c7a.medium - - t1.micro - - m7gd.medium - - m1.small - - m1.medium - - c6gn.medium - - r6gd.medium - - r6g.medium - - c7gn.medium - - r7g.medium - - c6g.medium - - t2.nano - - r7a.medium - - m6gd.medium - - is4gen.medium - - c7g.medium - - x2gd.medium - - m3.medium - - c6gd.medium - - a1.medium - - t2.small + - u-6tb1.112xlarge + - u-12tb1.112xlarge + - u-9tb1.112xlarge + - u-18tb1.112xlarge + - u-6tb1.56xlarge + - u-3tb1.56xlarge + - r7i.48xlarge + - r6a.metal + - r7a.48xlarge + - m7a.metal-48xl + - c7i.48xlarge + - g5.48xlarge + - c6a.metal + - inf2.48xlarge + - hpc7a.96xlarge + - r7a.metal-48xl + - c7a.metal-48xl + - r7i.metal-48xl + - c7i.metal-48xl + - m6a.metal + - m7a.48xlarge + - r6a.48xlarge + - m7i.metal-48xl + - m6a.48xlarge + - c6a.48xlarge + - c7a.48xlarge + - m7i.48xlarge + - m6id.metal + - c6in.32xlarge + - m6a.32xlarge + - c6id.32xlarge + - x2iedn.32xlarge + - m6i.metal + - i4i.32xlarge + - r7iz.32xlarge + - x1e.32xlarge + - r6in.metal + - c6a.32xlarge + - m6id.32xlarge + - m6idn.32xlarge + - c6i.metal + - r7iz.metal-32xl + - x1.32xlarge + - x2idn.32xlarge + - r6id.32xlarge + - c7a.32xlarge + - r6i.32xlarge + - r6a.32xlarge + - r6i.metal + - i4i.metal + - m6idn.metal + - r6in.32xlarge + - m6i.32xlarge + - m7a.32xlarge + - m6in.32xlarge + - r6idn.metal + - x2iedn.metal + - c6i.32xlarge + - c6id.metal + - m6in.metal + - c6in.metal + - x2idn.metal + - r6id.metal + - r6idn.32xlarge + - r7a.32xlarge + - r5.metal + - vt1.24xlarge + - c5a.24xlarge + - hpc7a.48xlarge + - c5d.24xlarge + - c6in.24xlarge + - i3en.metal + - m7i.metal-24xl + - m5dn.metal + - m5ad.24xlarge + - r5dn.24xlarge + - inf2.24xlarge + - x2idn.24xlarge + - r5dn.metal + - r5b.24xlarge + - r5d.metal + - c5d.metal + - c5.metal + - r6a.24xlarge + - m6a.24xlarge + - g5.24xlarge + - r6i.24xlarge + - i3en.24xlarge + - r6id.24xlarge + - m5.metal + - r6in.24xlarge + - r7i.metal-24xl + - p4d.24xlarge + - c7i.24xlarge + - r5b.metal + - r5a.24xlarge + - c7i.metal-24xl + - p3dn.24xlarge + - c5.24xlarge + - r5n.metal + - c5ad.24xlarge + - m7a.24xlarge + - m5.24xlarge + - c7a.24xlarge + - i4i.24xlarge + - r7i.24xlarge + - c6i.24xlarge + - r7a.24xlarge + - m6idn.24xlarge + - m5n.24xlarge + - g4dn.metal + - c6id.24xlarge + - m6id.24xlarge + - r6idn.24xlarge + - m5d.24xlarge + - r5.24xlarge + - r5ad.24xlarge + - m7i.24xlarge + - m5dn.24xlarge + - r5d.24xlarge + - m5d.metal + - c6a.24xlarge + - r5n.24xlarge + - m5a.24xlarge + - m6in.24xlarge + - m6i.24xlarge + - x2iedn.24xlarge + - inf1.24xlarge + - c5d.18xlarge + - c5n.metal + - c5.18xlarge + - c5n.18xlarge + - i3.metal + - r7a.16xlarge + - x2iedn.16xlarge + - r7i.16xlarge + - r7gd.metal + - x1.16xlarge + - x2idn.16xlarge + - c6g.metal + - r6i.16xlarge + - g5.16xlarge + - r7iz.16xlarge + - r4.16xlarge + - r5d.16xlarge + - f1.16xlarge + - c7a.16xlarge + - r5ad.16xlarge + - m6id.16xlarge + - m6a.16xlarge + - m6g.metal + - m4.16xlarge + - r6idn.16xlarge + - h1.16xlarge + - r6g.16xlarge + - r5n.16xlarge + - c5a.16xlarge + - c6g.16xlarge + - m6idn.16xlarge + - c7g.metal + - c6gd.16xlarge + - m6i.16xlarge + - c7g.16xlarge + - g4dn.16xlarge + - m5.16xlarge + - i4g.16xlarge + - r5dn.16xlarge + - c7gn.16xlarge + - m5a.16xlarge + - r6a.16xlarge + - g4ad.16xlarge + - i3.16xlarge + - m7gd.16xlarge + - c7gn.metal + - m7i.16xlarge + - r6id.16xlarge + - hpc7g.16xlarge + - r6gd.16xlarge + - m5dn.16xlarge + - r7g.16xlarge + - c7i.16xlarge + - m6g.16xlarge + - im4gn.16xlarge + - m7gd.metal + - m5n.16xlarge + - r5.16xlarge + - r5b.16xlarge + - g3.16xlarge + - m6in.16xlarge + - c6id.16xlarge + - c7gd.metal + - x2gd.16xlarge + - r6in.16xlarge + - m7g.16xlarge + - r6g.metal + - r5a.16xlarge + - p2.16xlarge + - r7iz.metal-16xl + - m6gd.16xlarge + - c6a.16xlarge + - p3.16xlarge + - m5d.16xlarge + - x2gd.metal + - c5ad.16xlarge + - m7g.metal + - i4i.16xlarge + - c6i.16xlarge + - c6in.16xlarge + - m6gd.metal + - m7a.16xlarge + - r7g.metal + - c6gn.16xlarge + - c7gd.16xlarge + - r6gd.metal + - m5ad.16xlarge + - r7gd.16xlarge + - x1e.16xlarge + - c6gd.metal + - m6i.12xlarge + - r6idn.12xlarge + - r5a.12xlarge + - r6in.12xlarge + - c6i.12xlarge + - r5dn.12xlarge + - r6id.12xlarge + - r7a.12xlarge + - g4dn.12xlarge + - m7i.12xlarge + - m5ad.12xlarge + - m5dn.12xlarge + - m5zn.12xlarge + - z1d.metal + - m5.12xlarge + - x2gd.12xlarge + - c6id.12xlarge + - m6gd.12xlarge + - m7g.12xlarge + - r5ad.12xlarge + - x2iezn.12xlarge + - m6id.12xlarge + - m5zn.metal + - m6g.12xlarge + - m5a.12xlarge + - c6g.12xlarge + - r6a.12xlarge + - z1d.12xlarge + - r5b.12xlarge + - m6in.12xlarge + - g5.12xlarge + - i4i.12xlarge + - c6gd.12xlarge + - c5.12xlarge + - c7gn.12xlarge + - m5n.12xlarge + - m7a.12xlarge + - c5ad.12xlarge + - m6a.12xlarge + - r7iz.12xlarge + - r6gd.12xlarge + - r7i.12xlarge + - m6idn.12xlarge + - c5a.12xlarge + - r5.12xlarge + - c5d.12xlarge + - i3en.12xlarge + - hpc7a.24xlarge + - m7gd.12xlarge + - c6gn.12xlarge + - c6a.12xlarge + - c6in.12xlarge + - r7g.12xlarge + - c7g.12xlarge + - r5n.12xlarge + - r5d.12xlarge + - x2iezn.metal + - c7i.12xlarge + - c7gd.12xlarge + - r7gd.12xlarge + - r6i.12xlarge + - d3en.12xlarge + - m5d.12xlarge + - r6g.12xlarge + - c7a.12xlarge + - m4.10xlarge + - c5n.9xlarge + - d2.8xlarge + - c4.8xlarge + - c5.9xlarge + - c5d.9xlarge + - m5.8xlarge + - m7gd.8xlarge + - c6gn.8xlarge + - r7iz.8xlarge + - h1.8xlarge + - m6idn.8xlarge + - r3.8xlarge + - g4ad.8xlarge + - c7g.8xlarge + - m5n.8xlarge + - m7i.8xlarge + - m6a.8xlarge + - c7a.8xlarge + - g5.8xlarge + - r5a.8xlarge + - c5a.8xlarge + - m6in.8xlarge + - c7i.8xlarge + - r6g.8xlarge + - p2.8xlarge + - r4.8xlarge + - r5ad.8xlarge + - c7i-flex.8xlarge + - r7gd.8xlarge + - m7a.8xlarge + - c7gd.8xlarge + - m6i.8xlarge + - m7g.8xlarge + - r5d.8xlarge + - m5a.8xlarge + - r5.8xlarge + - c6i.8xlarge + - g4dn.8xlarge + - i3.8xlarge + - m6gd.8xlarge + - r5n.8xlarge + - m7i-flex.8xlarge + - i2.8xlarge + - r5dn.8xlarge + - r6gd.8xlarge + - r6idn.8xlarge + - g3.8xlarge + - inf2.8xlarge + - m6g.8xlarge + - x2gd.8xlarge + - d3.8xlarge + - hpc7g.8xlarge + - r7g.8xlarge + - im4gn.8xlarge + - m6id.8xlarge + - m5dn.8xlarge + - m5ad.8xlarge + - x2iedn.8xlarge + - x1e.8xlarge + - c6id.8xlarge + - r6a.8xlarge + - c6gd.8xlarge + - x2iezn.8xlarge + - m5d.8xlarge + - c3.8xlarge + - c7gn.8xlarge + - i4g.8xlarge + - r5b.8xlarge + - c6a.8xlarge + - r6id.8xlarge + - d3en.8xlarge + - c5ad.8xlarge + - r6in.8xlarge + - r6i.8xlarge + - i4i.8xlarge + - r7a.8xlarge + - p3.8xlarge + - is4gen.8xlarge + - c6g.8xlarge + - c6in.8xlarge + - r7i.8xlarge + - i3en.6xlarge + - d3en.6xlarge + - inf1.6xlarge + - x2iezn.6xlarge + - hpc7a.12xlarge + - m5zn.6xlarge + - z1d.6xlarge + - vt1.6xlarge + - c6in.4xlarge + - m6in.4xlarge + - m4.4xlarge + - r6gd.4xlarge + - m6idn.4xlarge + - x1e.4xlarge + - c5.4xlarge + - m5d.4xlarge + - m6a.4xlarge + - c6id.4xlarge + - r5a.4xlarge + - m5a.4xlarge + - c7gn.4xlarge + - m5ad.4xlarge + - g5.4xlarge + - c6i.4xlarge + - i3.4xlarge + - r5ad.4xlarge + - r5d.4xlarge + - r6id.4xlarge + - r4.4xlarge + - r5n.4xlarge + - m7a.4xlarge + - g3.4xlarge + - d3.4xlarge + - c5ad.4xlarge + - r5.4xlarge + - c7gd.4xlarge + - m7i-flex.4xlarge + - g4ad.4xlarge + - m5n.4xlarge + - m5.4xlarge + - g4dn.4xlarge + - r5dn.4xlarge + - c7i-flex.4xlarge + - m6i.4xlarge + - c5d.4xlarge + - f1.4xlarge + - c6a.4xlarge + - r3.4xlarge + - c7i.4xlarge + - a1.metal + - h1.4xlarge + - x2gd.4xlarge + - m7i.4xlarge + - r6i.4xlarge + - m5dn.4xlarge + - m6g.4xlarge + - c5a.4xlarge + - i4i.4xlarge + - d2.4xlarge + - m7g.4xlarge + - i2.4xlarge + - r7g.4xlarge + - r5b.4xlarge + - r7iz.4xlarge + - r6g.4xlarge + - c6gn.4xlarge + - m6id.4xlarge + - m7gd.4xlarge + - c5n.4xlarge + - x2iedn.4xlarge + - r7gd.4xlarge + - m6gd.4xlarge + - r6a.4xlarge + - i4g.4xlarge + - c6gd.4xlarge + - hpc7g.4xlarge + - im4gn.4xlarge + - c4.4xlarge + - c3.4xlarge + - a1.4xlarge + - d3en.4xlarge + - r7a.4xlarge + - c7g.4xlarge + - c7a.4xlarge + - r7i.4xlarge + - r6in.4xlarge + - x2iezn.4xlarge + - is4gen.4xlarge + - r6idn.4xlarge + - c6g.4xlarge + - m5zn.3xlarge + - z1d.3xlarge + - mac1.metal + - vt1.3xlarge + - i3en.3xlarge + - r5.2xlarge + - m5zn.2xlarge + - c7g.2xlarge + - c7i-flex.2xlarge + - r5dn.2xlarge + - m6a.2xlarge + - r7a.2xlarge + - r6g.2xlarge + - m7i.2xlarge + - r5n.2xlarge + - z1d.2xlarge + - r6id.2xlarge + - i3.2xlarge + - c5n.2xlarge + - r5d.2xlarge + - m7gd.2xlarge + - c5ad.2xlarge + - r7g.2xlarge + - c4.2xlarge + - c7i.2xlarge + - c7gd.2xlarge + - c6gd.2xlarge + - m6gd.2xlarge + - m6in.2xlarge + - c1.xlarge + - r4.2xlarge + - r5ad.2xlarge + - a1.2xlarge + - m7a.2xlarge + - mac2.metal + - m6idn.2xlarge + - r6i.2xlarge + - r5a.2xlarge + - r7gd.2xlarge + - c5d.2xlarge + - d2.2xlarge + - m6id.2xlarge + - t3a.2xlarge + - x2gd.2xlarge + - r6idn.2xlarge + - m7g.2xlarge + - h1.2xlarge + - c7gn.2xlarge + - c6i.2xlarge + - inf1.2xlarge + - m5a.2xlarge + - g5.2xlarge + - c6in.2xlarge + - g4ad.2xlarge + - c5a.2xlarge + - i2.2xlarge + - m5ad.2xlarge + - x2iezn.2xlarge + - c6gn.2xlarge + - p3.2xlarge + - c7a.2xlarge + - t3.2xlarge + - c6id.2xlarge + - r7iz.2xlarge + - t4g.2xlarge + - m3.2xlarge + - m5dn.2xlarge + - c6g.2xlarge + - r6a.2xlarge + - c6a.2xlarge + - m2.4xlarge + - m6i.2xlarge + - m5n.2xlarge + - m5d.2xlarge + - r5b.2xlarge + - t2.2xlarge + - m5.2xlarge + - x2iedn.2xlarge + - r6gd.2xlarge + - m6g.2xlarge + - is4gen.2xlarge + - f1.2xlarge + - c3.2xlarge + - m4.2xlarge + - i3en.2xlarge + - i4g.2xlarge + - x1e.2xlarge + - g4dn.2xlarge + - r3.2xlarge + - c5.2xlarge + - im4gn.2xlarge + - r7i.2xlarge + - i4i.2xlarge + - r6in.2xlarge + - d3en.2xlarge + - m7i-flex.2xlarge + - d3.2xlarge + - c5d.xlarge + - r6i.xlarge + - r5b.xlarge + - c7i-flex.xlarge + - m7gd.xlarge + - x2gd.xlarge + - t3a.xlarge + - m6i.xlarge + - m6idn.xlarge + - d3.xlarge + - c6in.xlarge + - r5a.xlarge + - r5d.xlarge + - r7a.xlarge + - r5dn.xlarge + - c6gd.xlarge + - r5ad.xlarge + - m7i.xlarge + - r5n.xlarge + - r6a.xlarge + - t3.xlarge + - m5n.xlarge + - m6g.xlarge + - c7gd.xlarge + - z1d.xlarge + - m6in.xlarge + - m5.xlarge + - g5.xlarge + - c5ad.xlarge + - m6id.xlarge + - is4gen.xlarge + - m4.xlarge + - m5zn.xlarge + - m3.xlarge + - g4ad.xlarge + - c5.xlarge + - x2iedn.xlarge + - m7i-flex.xlarge + - d3en.xlarge + - c6g.xlarge + - r7g.xlarge + - c3.xlarge + - m6gd.xlarge + - t2.xlarge + - r6g.xlarge + - inf2.xlarge + - m1.xlarge + - c7g.xlarge + - x1e.xlarge + - a1.xlarge + - m2.2xlarge + - i3en.xlarge + - c7a.xlarge + - r6in.xlarge + - c7i.xlarge + - g4dn.xlarge + - c6id.xlarge + - im4gn.xlarge + - c5a.xlarge + - i4i.xlarge + - m5ad.xlarge + - m5a.xlarge + - m5d.xlarge + - c7gn.xlarge + - t4g.xlarge + - m7a.xlarge + - r5.xlarge + - c5n.xlarge + - m6a.xlarge + - c4.xlarge + - r6id.xlarge + - c6a.xlarge + - r4.xlarge + - i2.xlarge + - r6gd.xlarge + - r7i.xlarge + - c6i.xlarge + - d2.xlarge + - i4g.xlarge + - m5dn.xlarge + - r7iz.xlarge + - i3.xlarge + - m7g.xlarge + - p2.xlarge + - r3.xlarge + - g3s.xlarge + - r7gd.xlarge + - inf1.xlarge + - r6idn.xlarge + - c6gn.xlarge + - c7g.large + - r4.large + - m7i-flex.large + - m5ad.large + - t3.small + - m5zn.large + - c5ad.large + - i3en.large + - m3.large + - c7gn.large + - r5a.large + - m7g.large + - r5.large + - c7a.large + - t4g.small + - m6gd.large + - t2.large + - i4i.large + - m1.large + - r7gd.large + - r6a.large + - t3.nano + - a1.large + - c5a.large + - r5b.large + - r6idn.large + - t4g.medium + - m2.xlarge + - m5d.large + - is4gen.large + - t3a.small + - m6a.large + - r7g.large + - t3.large + - c5n.large + - c6in.large + - t3.micro + - m6i.large + - c6i.large + - r6in.large + - t4g.micro + - r6i.large + - r7a.large + - c6id.large + - m5.large + - c3.large + - c1.medium + - m7gd.large + - t3.medium + - i4g.large + - x2gd.large + - c4.large + - t3a.large + - m6id.large + - t3a.nano + - r7i.large + - c5d.large + - r5ad.large + - i3.large + - r6gd.large + - im4gn.large + - c6gd.large + - r3.large + - c6a.large + - r5dn.large + - z1d.large + - t2.medium + - c7i-flex.large + - m5a.large + - r7iz.large + - r5n.large + - c6g.large + - m6idn.large + - t3a.medium + - c7i.large + - r6g.large + - r6id.large + - m5dn.large + - t3a.micro + - r5d.large + - m5n.large + - t4g.large + - c7gd.large + - m7i.large + - c6gn.large + - m7a.large + - t4g.nano + - m6g.large + - c5.large + - m4.large + - m6in.large + - r7gd.medium + - t2.micro + - m7a.medium + - m6g.medium + - m7g.medium + - c7gd.medium + - c7a.medium + - t1.micro + - m7gd.medium + - m1.small + - m1.medium + - c6gn.medium + - r6gd.medium + - r6g.medium + - c7gn.medium + - r7g.medium + - c6g.medium + - t2.nano + - r7a.medium + - m6gd.medium + - is4gen.medium + - c7g.medium + - x2gd.medium + - m3.medium + - c6gd.medium + - a1.medium + - t2.small eu-west-2: - - u-9tb1.112xlarge - - u-6tb1.112xlarge - - u-6tb1.56xlarge - - c6a.metal - - m7i.48xlarge - - inf2.48xlarge - - r7i.48xlarge - - g5.48xlarge - - m6a.48xlarge - - c6a.48xlarge - - c7i.metal-48xl - - c7i.48xlarge - - m6a.metal - - m7i.metal-48xl - - r7i.metal-48xl - - g6.48xlarge - - m6i.metal - - x1.32xlarge - - c6id.32xlarge - - m6i.32xlarge - - r6i.metal - - x2iedn.32xlarge - - c6in.32xlarge - - c6i.metal - - r6id.metal - - x2idn.32xlarge - - c6a.32xlarge - - x2iedn.metal - - c6in.metal - - i4i.metal - - r6id.32xlarge - - c6id.metal - - r6i.32xlarge - - m6id.32xlarge - - x2idn.metal - - c6i.32xlarge - - m6a.32xlarge - - m6id.metal - - i4i.32xlarge - - m6id.24xlarge - - m5.metal - - x2iedn.24xlarge - - m6a.24xlarge - - g4dn.metal - - r7i.24xlarge - - i3en.metal - - i4i.24xlarge - - c7i.24xlarge - - c5.metal - - c6a.24xlarge - - g5.24xlarge - - r6id.24xlarge - - m5a.24xlarge - - r6i.24xlarge - - r5n.24xlarge - - c6id.24xlarge - - r5.metal - - g6.24xlarge - - c5d.24xlarge - - r5b.metal - - c5a.24xlarge - - m5.24xlarge - - r5b.24xlarge - - r5.24xlarge - - x2idn.24xlarge - - r5a.24xlarge - - m7i.24xlarge - - r5ad.24xlarge - - m7i.metal-24xl - - r5d.metal - - m5d.24xlarge - - m5ad.24xlarge - - r5d.24xlarge - - c6in.24xlarge - - inf2.24xlarge - - r5n.metal - - r7i.metal-24xl - - m6i.24xlarge - - m5d.metal - - c6i.24xlarge - - c5d.metal - - c5.24xlarge - - c7i.metal-24xl - - inf1.24xlarge - - i3en.24xlarge - - c5.18xlarge - - c5n.18xlarge - - i3.metal - - c5n.metal - - c5d.18xlarge - - c7g.16xlarge - - m6gd.16xlarge - - r6g.16xlarge - - r6id.16xlarge - - x2iedn.16xlarge - - r5ad.16xlarge - - im4gn.16xlarge - - r5d.16xlarge - - m6gd.metal - - m5a.16xlarge - - r7g.metal - - m5d.16xlarge - - c6i.16xlarge - - x2idn.16xlarge - - m6a.16xlarge - - c6gd.16xlarge - - r7i.16xlarge - - c6gd.metal - - x1.16xlarge - - m6g.16xlarge - - r5n.16xlarge - - c6g.16xlarge - - m4.16xlarge - - g5.16xlarge - - r7g.16xlarge - - g4ad.16xlarge - - m7g.metal - - m6id.16xlarge - - r6gd.metal - - r6g.metal - - g6.16xlarge - - m6i.16xlarge - - i4i.16xlarge - - r6i.16xlarge - - c6in.16xlarge - - c6a.16xlarge - - c7g.metal - - m5ad.16xlarge - - m6g.metal - - c6g.metal - - g3.16xlarge - - m7i.16xlarge - - c5a.16xlarge - - r4.16xlarge - - m7g.16xlarge - - m5.16xlarge - - c7i.16xlarge - - r5a.16xlarge - - c6gn.16xlarge - - r6gd.16xlarge - - r5.16xlarge - - i3.16xlarge - - r5b.16xlarge - - p3.16xlarge - - c6id.16xlarge - - g4dn.16xlarge - - m6g.12xlarge - - c7i.12xlarge - - z1d.12xlarge - - c6a.12xlarge - - m6id.12xlarge - - c5.12xlarge - - r5ad.12xlarge - - c6i.12xlarge - - c7g.12xlarge - - m6a.12xlarge - - c6g.12xlarge - - z1d.metal - - c6gn.12xlarge - - m5d.12xlarge - - m5.12xlarge - - c5d.12xlarge - - c6in.12xlarge - - r7g.12xlarge - - i4i.12xlarge - - m5a.12xlarge - - r5a.12xlarge - - m7i.12xlarge - - c6id.12xlarge - - m6i.12xlarge - - m6gd.12xlarge - - r5b.12xlarge - - m5ad.12xlarge - - m7g.12xlarge - - r7i.12xlarge - - c5a.12xlarge - - g5.12xlarge - - g4dn.12xlarge - - c6gd.12xlarge - - r5n.12xlarge - - r6id.12xlarge - - r5d.12xlarge - - r6g.12xlarge - - r5.12xlarge - - g6.12xlarge - - i3en.12xlarge - - r6gd.12xlarge - - r6i.12xlarge - - m4.10xlarge - - c5.9xlarge - - c5n.9xlarge - - d2.8xlarge - - c4.8xlarge - - c5d.9xlarge - - c7g.8xlarge - - r5d.8xlarge - - i3.8xlarge - - m6gd.8xlarge - - m6i.8xlarge - - r5.8xlarge - - g6.8xlarge - - c5a.8xlarge - - r5n.8xlarge - - r6gd.8xlarge - - c6gn.8xlarge - - r7i.8xlarge - - m7g.8xlarge - - m5a.8xlarge - - m7i-flex.8xlarge - - r5ad.8xlarge - - r6id.8xlarge - - c6in.8xlarge - - m5ad.8xlarge - - g3.8xlarge - - r4.8xlarge - - g4ad.8xlarge - - d3.8xlarge - - i4i.8xlarge - - c7i-flex.8xlarge - - m6g.8xlarge - - m5d.8xlarge - - r5b.8xlarge - - inf2.8xlarge - - m6a.8xlarge - - r6i.8xlarge - - g4dn.8xlarge - - c6id.8xlarge - - c6g.8xlarge - - c7i.8xlarge - - is4gen.8xlarge - - m7i.8xlarge - - gr6.8xlarge - - g5.8xlarge - - r6g.8xlarge - - c6gd.8xlarge - - x2iedn.8xlarge - - c6i.8xlarge - - m6id.8xlarge - - r5a.8xlarge - - p3.8xlarge - - m5.8xlarge - - im4gn.8xlarge - - r7g.8xlarge - - c6a.8xlarge - - inf1.6xlarge - - z1d.6xlarge - - i3en.6xlarge - - c5a.4xlarge - - is4gen.4xlarge - - r6g.4xlarge - - m5.4xlarge - - r5.4xlarge - - r7g.4xlarge - - c5.4xlarge - - c5n.4xlarge - - r5d.4xlarge - - m7g.4xlarge - - im4gn.4xlarge - - c6id.4xlarge - - c6gn.4xlarge - - m6id.4xlarge - - d3.4xlarge - - g3.4xlarge - - m7i-flex.4xlarge - - m6gd.4xlarge - - c7i.4xlarge - - d2.4xlarge - - c5d.4xlarge - - r6i.4xlarge - - g6.4xlarge - - c6in.4xlarge - - i4i.4xlarge - - c7g.4xlarge - - m6a.4xlarge - - gr6.4xlarge - - f1.4xlarge - - g4ad.4xlarge - - r5a.4xlarge - - c6gd.4xlarge - - r5n.4xlarge - - r5ad.4xlarge - - m7i.4xlarge - - r6gd.4xlarge - - g4dn.4xlarge - - r6id.4xlarge - - m6g.4xlarge - - r5b.4xlarge - - m5d.4xlarge - - r4.4xlarge - - c6g.4xlarge - - i3.4xlarge - - c4.4xlarge - - m5a.4xlarge - - c6i.4xlarge - - x2iedn.4xlarge - - m4.4xlarge - - g5.4xlarge - - r7i.4xlarge - - c7i-flex.4xlarge - - m6i.4xlarge - - c6a.4xlarge - - m5ad.4xlarge - - i3en.3xlarge - - mac1.metal - - z1d.3xlarge - - g6.2xlarge - - m7i.2xlarge - - z1d.2xlarge - - c6id.2xlarge - - m5a.2xlarge - - m6gd.2xlarge - - c6gd.2xlarge - - im4gn.2xlarge - - c7g.2xlarge - - inf1.2xlarge - - x2iedn.2xlarge - - g5.2xlarge - - c6g.2xlarge - - c6gn.2xlarge - - c7i-flex.2xlarge - - r5ad.2xlarge - - i3.2xlarge - - is4gen.2xlarge - - d2.2xlarge - - m6i.2xlarge - - r6id.2xlarge - - m6a.2xlarge - - c4.2xlarge - - m6g.2xlarge - - c6i.2xlarge - - f1.2xlarge - - r5b.2xlarge - - c5n.2xlarge - - m6id.2xlarge - - r5d.2xlarge - - c6in.2xlarge - - m5ad.2xlarge - - c5.2xlarge - - m7g.2xlarge - - t2.2xlarge - - c7i.2xlarge - - g4ad.2xlarge - - d3.2xlarge - - i4i.2xlarge - - r4.2xlarge - - r7i.2xlarge - - r5n.2xlarge - - r5.2xlarge - - m5.2xlarge - - r7g.2xlarge - - r6i.2xlarge - - c5d.2xlarge - - m4.2xlarge - - r6g.2xlarge - - c6a.2xlarge - - m7i-flex.2xlarge - - r6gd.2xlarge - - t3a.2xlarge - - c5a.2xlarge - - g4dn.2xlarge - - r5a.2xlarge - - m5d.2xlarge - - t4g.2xlarge - - t3.2xlarge - - i3en.2xlarge - - p3.2xlarge - - r6gd.xlarge - - c5n.xlarge - - i3.xlarge - - t3a.xlarge - - m7g.xlarge - - inf1.xlarge - - r7g.xlarge - - d3.xlarge - - m7i-flex.xlarge - - i3en.xlarge - - c7i.xlarge - - c4.xlarge - - d2.xlarge - - m5ad.xlarge - - t3.xlarge - - r5b.xlarge - - x2iedn.xlarge - - t2.xlarge - - m5d.xlarge - - r6id.xlarge - - m4.xlarge - - c5d.xlarge - - m7i.xlarge - - m5.xlarge - - g5.xlarge - - im4gn.xlarge - - c6a.xlarge - - c6gd.xlarge - - r5ad.xlarge - - is4gen.xlarge - - m6gd.xlarge - - z1d.xlarge - - r5d.xlarge - - c7i-flex.xlarge - - r7i.xlarge - - c6g.xlarge - - c5a.xlarge - - m5a.xlarge - - m6a.xlarge - - r5n.xlarge - - r4.xlarge - - g3s.xlarge - - g4dn.xlarge - - m6id.xlarge - - c6i.xlarge - - r5.xlarge - - g4ad.xlarge - - r6i.xlarge - - m6g.xlarge - - c5.xlarge - - c7g.xlarge - - r5a.xlarge - - i4i.xlarge - - g6.xlarge - - c6in.xlarge - - c6id.xlarge - - inf2.xlarge - - c6gn.xlarge - - t4g.xlarge - - r6g.xlarge - - m6i.xlarge - - m6gd.large - - c7g.large - - t3.medium - - r5ad.large - - r5a.large - - t4g.micro - - i3.large - - m5.large - - t3.large - - r5.large - - m7i-flex.large - - m5a.large - - c6id.large - - r7g.large - - z1d.large - - c6gd.large - - r7i.large - - c7i.large - - r6id.large - - c5n.large - - m5ad.large - - t3a.micro - - i4i.large - - t3a.nano - - r6i.large - - c6i.large - - m7g.large - - c5d.large - - t2.medium - - c7i-flex.large - - r6g.large - - t2.large - - t3a.medium - - t4g.small - - r6gd.large - - r5b.large - - c6in.large - - r4.large - - t4g.nano - - t3.nano - - m5d.large - - c5.large - - c5a.large - - m6a.large - - t3.micro - - t4g.large - - c4.large - - r5d.large - - m6id.large - - t3a.large - - t3.small - - m6i.large - - i3en.large - - m4.large - - is4gen.large - - m7i.large - - r5n.large - - t3a.small - - c6gn.large - - t4g.medium - - m6g.large - - c6a.large - - im4gn.large - - c6g.large - - m7g.medium - - m6g.medium - - r6g.medium - - is4gen.medium - - m6gd.medium - - t2.nano - - c7g.medium - - t2.micro - - t2.small - - c6gn.medium - - r6gd.medium - - c6g.medium - - r7g.medium - - c6gd.medium + - u-9tb1.112xlarge + - u-6tb1.112xlarge + - u-6tb1.56xlarge + - c6a.metal + - m7i.48xlarge + - inf2.48xlarge + - r7i.48xlarge + - g5.48xlarge + - m6a.48xlarge + - c6a.48xlarge + - c7i.metal-48xl + - c7i.48xlarge + - m6a.metal + - m7i.metal-48xl + - r7i.metal-48xl + - g6.48xlarge + - m6i.metal + - x1.32xlarge + - c6id.32xlarge + - m6i.32xlarge + - r6i.metal + - x2iedn.32xlarge + - c6in.32xlarge + - c6i.metal + - r6id.metal + - x2idn.32xlarge + - c6a.32xlarge + - x2iedn.metal + - c6in.metal + - i4i.metal + - r6id.32xlarge + - c6id.metal + - r6i.32xlarge + - m6id.32xlarge + - x2idn.metal + - c6i.32xlarge + - m6a.32xlarge + - m6id.metal + - i4i.32xlarge + - m6id.24xlarge + - m5.metal + - x2iedn.24xlarge + - m6a.24xlarge + - g4dn.metal + - r7i.24xlarge + - i3en.metal + - i4i.24xlarge + - c7i.24xlarge + - c5.metal + - c6a.24xlarge + - g5.24xlarge + - r6id.24xlarge + - m5a.24xlarge + - r6i.24xlarge + - r5n.24xlarge + - c6id.24xlarge + - r5.metal + - g6.24xlarge + - c5d.24xlarge + - r5b.metal + - c5a.24xlarge + - m5.24xlarge + - r5b.24xlarge + - r5.24xlarge + - x2idn.24xlarge + - r5a.24xlarge + - m7i.24xlarge + - r5ad.24xlarge + - m7i.metal-24xl + - r5d.metal + - m5d.24xlarge + - m5ad.24xlarge + - r5d.24xlarge + - c6in.24xlarge + - inf2.24xlarge + - r5n.metal + - r7i.metal-24xl + - m6i.24xlarge + - m5d.metal + - c6i.24xlarge + - c5d.metal + - c5.24xlarge + - c7i.metal-24xl + - inf1.24xlarge + - i3en.24xlarge + - c5.18xlarge + - c5n.18xlarge + - i3.metal + - c5n.metal + - c5d.18xlarge + - c7g.16xlarge + - m6gd.16xlarge + - r6g.16xlarge + - r6id.16xlarge + - x2iedn.16xlarge + - r5ad.16xlarge + - im4gn.16xlarge + - r5d.16xlarge + - m6gd.metal + - m5a.16xlarge + - r7g.metal + - m5d.16xlarge + - c6i.16xlarge + - x2idn.16xlarge + - m6a.16xlarge + - c6gd.16xlarge + - r7i.16xlarge + - c6gd.metal + - x1.16xlarge + - m6g.16xlarge + - r5n.16xlarge + - c6g.16xlarge + - m4.16xlarge + - g5.16xlarge + - r7g.16xlarge + - g4ad.16xlarge + - m7g.metal + - m6id.16xlarge + - r6gd.metal + - r6g.metal + - g6.16xlarge + - m6i.16xlarge + - i4i.16xlarge + - r6i.16xlarge + - c6in.16xlarge + - c6a.16xlarge + - c7g.metal + - m5ad.16xlarge + - m6g.metal + - c6g.metal + - g3.16xlarge + - m7i.16xlarge + - c5a.16xlarge + - r4.16xlarge + - m7g.16xlarge + - m5.16xlarge + - c7i.16xlarge + - r5a.16xlarge + - c6gn.16xlarge + - r6gd.16xlarge + - r5.16xlarge + - i3.16xlarge + - r5b.16xlarge + - p3.16xlarge + - c6id.16xlarge + - g4dn.16xlarge + - m6g.12xlarge + - c7i.12xlarge + - z1d.12xlarge + - c6a.12xlarge + - m6id.12xlarge + - c5.12xlarge + - r5ad.12xlarge + - c6i.12xlarge + - c7g.12xlarge + - m6a.12xlarge + - c6g.12xlarge + - z1d.metal + - c6gn.12xlarge + - m5d.12xlarge + - m5.12xlarge + - c5d.12xlarge + - c6in.12xlarge + - r7g.12xlarge + - i4i.12xlarge + - m5a.12xlarge + - r5a.12xlarge + - m7i.12xlarge + - c6id.12xlarge + - m6i.12xlarge + - m6gd.12xlarge + - r5b.12xlarge + - m5ad.12xlarge + - m7g.12xlarge + - r7i.12xlarge + - c5a.12xlarge + - g5.12xlarge + - g4dn.12xlarge + - c6gd.12xlarge + - r5n.12xlarge + - r6id.12xlarge + - r5d.12xlarge + - r6g.12xlarge + - r5.12xlarge + - g6.12xlarge + - i3en.12xlarge + - r6gd.12xlarge + - r6i.12xlarge + - m4.10xlarge + - c5.9xlarge + - c5n.9xlarge + - d2.8xlarge + - c4.8xlarge + - c5d.9xlarge + - c7g.8xlarge + - r5d.8xlarge + - i3.8xlarge + - m6gd.8xlarge + - m6i.8xlarge + - r5.8xlarge + - g6.8xlarge + - c5a.8xlarge + - r5n.8xlarge + - r6gd.8xlarge + - c6gn.8xlarge + - r7i.8xlarge + - m7g.8xlarge + - m5a.8xlarge + - m7i-flex.8xlarge + - r5ad.8xlarge + - r6id.8xlarge + - c6in.8xlarge + - m5ad.8xlarge + - g3.8xlarge + - r4.8xlarge + - g4ad.8xlarge + - d3.8xlarge + - i4i.8xlarge + - c7i-flex.8xlarge + - m6g.8xlarge + - m5d.8xlarge + - r5b.8xlarge + - inf2.8xlarge + - m6a.8xlarge + - r6i.8xlarge + - g4dn.8xlarge + - c6id.8xlarge + - c6g.8xlarge + - c7i.8xlarge + - is4gen.8xlarge + - m7i.8xlarge + - gr6.8xlarge + - g5.8xlarge + - r6g.8xlarge + - c6gd.8xlarge + - x2iedn.8xlarge + - c6i.8xlarge + - m6id.8xlarge + - r5a.8xlarge + - p3.8xlarge + - m5.8xlarge + - im4gn.8xlarge + - r7g.8xlarge + - c6a.8xlarge + - inf1.6xlarge + - z1d.6xlarge + - i3en.6xlarge + - c5a.4xlarge + - is4gen.4xlarge + - r6g.4xlarge + - m5.4xlarge + - r5.4xlarge + - r7g.4xlarge + - c5.4xlarge + - c5n.4xlarge + - r5d.4xlarge + - m7g.4xlarge + - im4gn.4xlarge + - c6id.4xlarge + - c6gn.4xlarge + - m6id.4xlarge + - d3.4xlarge + - g3.4xlarge + - m7i-flex.4xlarge + - m6gd.4xlarge + - c7i.4xlarge + - d2.4xlarge + - c5d.4xlarge + - r6i.4xlarge + - g6.4xlarge + - c6in.4xlarge + - i4i.4xlarge + - c7g.4xlarge + - m6a.4xlarge + - gr6.4xlarge + - f1.4xlarge + - g4ad.4xlarge + - r5a.4xlarge + - c6gd.4xlarge + - r5n.4xlarge + - r5ad.4xlarge + - m7i.4xlarge + - r6gd.4xlarge + - g4dn.4xlarge + - r6id.4xlarge + - m6g.4xlarge + - r5b.4xlarge + - m5d.4xlarge + - r4.4xlarge + - c6g.4xlarge + - i3.4xlarge + - c4.4xlarge + - m5a.4xlarge + - c6i.4xlarge + - x2iedn.4xlarge + - m4.4xlarge + - g5.4xlarge + - r7i.4xlarge + - c7i-flex.4xlarge + - m6i.4xlarge + - c6a.4xlarge + - m5ad.4xlarge + - i3en.3xlarge + - mac1.metal + - z1d.3xlarge + - g6.2xlarge + - m7i.2xlarge + - z1d.2xlarge + - c6id.2xlarge + - m5a.2xlarge + - m6gd.2xlarge + - c6gd.2xlarge + - im4gn.2xlarge + - c7g.2xlarge + - inf1.2xlarge + - x2iedn.2xlarge + - g5.2xlarge + - c6g.2xlarge + - c6gn.2xlarge + - c7i-flex.2xlarge + - r5ad.2xlarge + - i3.2xlarge + - is4gen.2xlarge + - d2.2xlarge + - m6i.2xlarge + - r6id.2xlarge + - m6a.2xlarge + - c4.2xlarge + - m6g.2xlarge + - c6i.2xlarge + - f1.2xlarge + - r5b.2xlarge + - c5n.2xlarge + - m6id.2xlarge + - r5d.2xlarge + - c6in.2xlarge + - m5ad.2xlarge + - c5.2xlarge + - m7g.2xlarge + - t2.2xlarge + - c7i.2xlarge + - g4ad.2xlarge + - d3.2xlarge + - i4i.2xlarge + - r4.2xlarge + - r7i.2xlarge + - r5n.2xlarge + - r5.2xlarge + - m5.2xlarge + - r7g.2xlarge + - r6i.2xlarge + - c5d.2xlarge + - m4.2xlarge + - r6g.2xlarge + - c6a.2xlarge + - m7i-flex.2xlarge + - r6gd.2xlarge + - t3a.2xlarge + - c5a.2xlarge + - g4dn.2xlarge + - r5a.2xlarge + - m5d.2xlarge + - t4g.2xlarge + - t3.2xlarge + - i3en.2xlarge + - p3.2xlarge + - r6gd.xlarge + - c5n.xlarge + - i3.xlarge + - t3a.xlarge + - m7g.xlarge + - inf1.xlarge + - r7g.xlarge + - d3.xlarge + - m7i-flex.xlarge + - i3en.xlarge + - c7i.xlarge + - c4.xlarge + - d2.xlarge + - m5ad.xlarge + - t3.xlarge + - r5b.xlarge + - x2iedn.xlarge + - t2.xlarge + - m5d.xlarge + - r6id.xlarge + - m4.xlarge + - c5d.xlarge + - m7i.xlarge + - m5.xlarge + - g5.xlarge + - im4gn.xlarge + - c6a.xlarge + - c6gd.xlarge + - r5ad.xlarge + - is4gen.xlarge + - m6gd.xlarge + - z1d.xlarge + - r5d.xlarge + - c7i-flex.xlarge + - r7i.xlarge + - c6g.xlarge + - c5a.xlarge + - m5a.xlarge + - m6a.xlarge + - r5n.xlarge + - r4.xlarge + - g3s.xlarge + - g4dn.xlarge + - m6id.xlarge + - c6i.xlarge + - r5.xlarge + - g4ad.xlarge + - r6i.xlarge + - m6g.xlarge + - c5.xlarge + - c7g.xlarge + - r5a.xlarge + - i4i.xlarge + - g6.xlarge + - c6in.xlarge + - c6id.xlarge + - inf2.xlarge + - c6gn.xlarge + - t4g.xlarge + - r6g.xlarge + - m6i.xlarge + - m6gd.large + - c7g.large + - t3.medium + - r5ad.large + - r5a.large + - t4g.micro + - i3.large + - m5.large + - t3.large + - r5.large + - m7i-flex.large + - m5a.large + - c6id.large + - r7g.large + - z1d.large + - c6gd.large + - r7i.large + - c7i.large + - r6id.large + - c5n.large + - m5ad.large + - t3a.micro + - i4i.large + - t3a.nano + - r6i.large + - c6i.large + - m7g.large + - c5d.large + - t2.medium + - c7i-flex.large + - r6g.large + - t2.large + - t3a.medium + - t4g.small + - r6gd.large + - r5b.large + - c6in.large + - r4.large + - t4g.nano + - t3.nano + - m5d.large + - c5.large + - c5a.large + - m6a.large + - t3.micro + - t4g.large + - c4.large + - r5d.large + - m6id.large + - t3a.large + - t3.small + - m6i.large + - i3en.large + - m4.large + - is4gen.large + - m7i.large + - r5n.large + - t3a.small + - c6gn.large + - t4g.medium + - m6g.large + - c6a.large + - im4gn.large + - c6g.large + - m7g.medium + - m6g.medium + - r6g.medium + - is4gen.medium + - m6gd.medium + - t2.nano + - c7g.medium + - t2.micro + - t2.small + - c6gn.medium + - r6gd.medium + - c6g.medium + - r7g.medium + - c6gd.medium eu-west-3: - - u-6tb1.112xlarge - - u-9tb1.112xlarge - - u-6tb1.56xlarge - - c7i.48xlarge - - c7i.metal-48xl - - m7i.48xlarge - - r7i.metal-48xl - - m7i.metal-48xl - - inf2.48xlarge - - r7i.48xlarge - - r6i.metal - - x2iedn.32xlarge - - c6i.metal - - x2idn.metal - - c6i.32xlarge - - c6in.32xlarge - - x2idn.32xlarge - - m6i.32xlarge - - c6in.metal - - i4i.metal - - x2iedn.metal - - m6i.metal - - x1.32xlarge - - i4i.32xlarge - - r6i.32xlarge - - inf2.24xlarge - - r5.24xlarge - - r5dn.metal - - g4dn.metal - - c7i.24xlarge - - r5a.24xlarge - - m5d.24xlarge - - m5.24xlarge - - r5n.24xlarge - - r7i.24xlarge - - c7i.metal-24xl - - r7i.metal-24xl - - c6i.24xlarge - - r5n.metal - - i3en.24xlarge - - c5a.24xlarge - - i4i.24xlarge - - m5.metal - - c5.24xlarge - - r5d.24xlarge - - c5.metal - - m5a.24xlarge - - r6i.24xlarge - - m5ad.24xlarge - - i3en.metal - - r5dn.24xlarge - - c6in.24xlarge - - m6i.24xlarge - - r5ad.24xlarge - - m5d.metal - - m7i.metal-24xl - - x2idn.24xlarge - - inf1.24xlarge - - r5.metal - - r5d.metal - - m7i.24xlarge - - x2iedn.24xlarge - - c5.18xlarge - - i3.metal - - c5n.18xlarge - - c5d.18xlarge - - c5n.metal - - c6g.16xlarge - - c6i.16xlarge - - c6g.metal - - r5n.16xlarge - - m6i.16xlarge - - c6in.16xlarge - - m6g.16xlarge - - x1.16xlarge - - c6gd.16xlarge - - r5.16xlarge - - r6gd.16xlarge - - m6gd.metal - - r7i.16xlarge - - c7i.16xlarge - - r6g.16xlarge - - m6gd.16xlarge - - r6g.metal - - x2iedn.16xlarge - - r5a.16xlarge - - im4gn.16xlarge - - c6gd.metal - - i4i.16xlarge - - r4.16xlarge - - m5a.16xlarge - - m7g.16xlarge - - g4dn.16xlarge - - m7g.metal - - r5ad.16xlarge - - c6gn.16xlarge - - m5ad.16xlarge - - x2idn.16xlarge - - r5dn.16xlarge - - r6gd.metal - - m5d.16xlarge - - m6g.metal - - i3.16xlarge - - m7gd.16xlarge - - m7gd.metal - - c5a.16xlarge - - m7i.16xlarge - - r5d.16xlarge - - r6i.16xlarge - - m5.16xlarge - - g4dn.12xlarge - - c5a.12xlarge - - c6gn.12xlarge - - i4i.12xlarge - - c7i.12xlarge - - r5dn.12xlarge - - c6i.12xlarge - - c6g.12xlarge - - m7i.12xlarge - - r5.12xlarge - - m6g.12xlarge - - m5d.12xlarge - - m6i.12xlarge - - i3en.12xlarge - - r6g.12xlarge - - r5ad.12xlarge - - r6i.12xlarge - - m7gd.12xlarge - - c5.12xlarge - - r5n.12xlarge - - c6gd.12xlarge - - r6gd.12xlarge - - c6in.12xlarge - - m7g.12xlarge - - m6gd.12xlarge - - r7i.12xlarge - - r5a.12xlarge - - m5a.12xlarge - - m5ad.12xlarge - - r5d.12xlarge - - m5.12xlarge - - d2.8xlarge - - c5n.9xlarge - - c5.9xlarge - - c5d.9xlarge - - r4.8xlarge - - is4gen.8xlarge - - r6i.8xlarge - - i4i.8xlarge - - d3.8xlarge - - m7i-flex.8xlarge - - i3.8xlarge - - m6g.8xlarge - - r5.8xlarge - - r5n.8xlarge - - im4gn.8xlarge - - c6gn.8xlarge - - r7i.8xlarge - - c6in.8xlarge - - r5ad.8xlarge - - r5a.8xlarge - - r5d.8xlarge - - m5d.8xlarge - - m7g.8xlarge - - m5ad.8xlarge - - r6g.8xlarge - - r6gd.8xlarge - - m5a.8xlarge - - m6i.8xlarge - - x2iedn.8xlarge - - c7i-flex.8xlarge - - c6i.8xlarge - - r5dn.8xlarge - - c6gd.8xlarge - - g4dn.8xlarge - - m5.8xlarge - - inf2.8xlarge - - c6g.8xlarge - - m7gd.8xlarge - - m6gd.8xlarge - - m7i.8xlarge - - c5a.8xlarge - - c7i.8xlarge - - i3en.6xlarge - - inf1.6xlarge - - x2iedn.4xlarge - - c7i.4xlarge - - r5n.4xlarge - - c6in.4xlarge - - m6i.4xlarge - - r5a.4xlarge - - r5d.4xlarge - - c6i.4xlarge - - r5ad.4xlarge - - r4.4xlarge - - c7i-flex.4xlarge - - c5.4xlarge - - c5a.4xlarge - - r5.4xlarge - - m7g.4xlarge - - m5.4xlarge - - g4dn.4xlarge - - d3.4xlarge - - m5a.4xlarge - - is4gen.4xlarge - - c6g.4xlarge - - d2.4xlarge - - c6gn.4xlarge - - m7gd.4xlarge - - m5ad.4xlarge - - c5d.4xlarge - - c5n.4xlarge - - i3.4xlarge - - r6gd.4xlarge - - im4gn.4xlarge - - r6g.4xlarge - - i4i.4xlarge - - r7i.4xlarge - - m6g.4xlarge - - m6gd.4xlarge - - r6i.4xlarge - - c6gd.4xlarge - - r5dn.4xlarge - - m7i-flex.4xlarge - - m5d.4xlarge - - m7i.4xlarge - - i3en.3xlarge - - r6gd.2xlarge - - m5a.2xlarge - - c5d.2xlarge - - i3en.2xlarge - - r5dn.2xlarge - - m7i.2xlarge - - r5a.2xlarge - - m6i.2xlarge - - c6gn.2xlarge - - r6g.2xlarge - - r5n.2xlarge - - c5n.2xlarge - - r5d.2xlarge - - t3.2xlarge - - i3.2xlarge - - c7i.2xlarge - - i4i.2xlarge - - m5ad.2xlarge - - m6g.2xlarge - - is4gen.2xlarge - - inf1.2xlarge - - r6i.2xlarge - - r5.2xlarge - - m7gd.2xlarge - - m6gd.2xlarge - - g4dn.2xlarge - - m5.2xlarge - - d2.2xlarge - - d3.2xlarge - - r7i.2xlarge - - r5ad.2xlarge - - r4.2xlarge - - m7i-flex.2xlarge - - c7i-flex.2xlarge - - x2iedn.2xlarge - - c5a.2xlarge - - m7g.2xlarge - - t3a.2xlarge - - im4gn.2xlarge - - t2.2xlarge - - c5.2xlarge - - c6in.2xlarge - - t4g.2xlarge - - c6gd.2xlarge - - c6i.2xlarge - - m5d.2xlarge - - c6g.2xlarge - - m6gd.xlarge - - c7i.xlarge - - c6g.xlarge - - m7gd.xlarge - - m5a.xlarge - - i4i.xlarge - - c5n.xlarge - - r5.xlarge - - t2.xlarge - - m7g.xlarge - - r4.xlarge - - c6gd.xlarge - - i3en.xlarge - - g4dn.xlarge - - r6g.xlarge - - im4gn.xlarge - - c6gn.xlarge - - d3.xlarge - - i3.xlarge - - r7i.xlarge - - t4g.xlarge - - c5a.xlarge - - r6i.xlarge - - c6in.xlarge - - inf1.xlarge - - m6g.xlarge - - r5n.xlarge - - t3a.xlarge - - m7i-flex.xlarge - - r5d.xlarge - - inf2.xlarge - - is4gen.xlarge - - r5a.xlarge - - c5d.xlarge - - r6gd.xlarge - - m5ad.xlarge - - m5d.xlarge - - x2iedn.xlarge - - r5ad.xlarge - - r5dn.xlarge - - c6i.xlarge - - c5.xlarge - - m5.xlarge - - m7i.xlarge - - d2.xlarge - - c7i-flex.xlarge - - t3.xlarge - - m6i.xlarge - - t3a.nano - - c5.large - - r6i.large - - r5ad.large - - t4g.large - - m7g.large - - t3.medium - - t2.large - - c6in.large - - i3en.large - - is4gen.large - - t4g.nano - - t3.small - - i4i.large - - c7i-flex.large - - r5n.large - - t3a.micro - - r7i.large - - m6gd.large - - m7i-flex.large - - c6gn.large - - t4g.micro - - r5.large - - m5a.large - - m7gd.large - - m5d.large - - t3.nano - - c6g.large - - c5a.large - - r5d.large - - i3.large - - m5.large - - r6gd.large - - c6gd.large - - r5a.large - - t3a.small - - im4gn.large - - t3.micro - - c7i.large - - m7i.large - - m6g.large - - r4.large - - t3a.large - - t4g.small - - r6g.large - - c5n.large - - t3a.medium - - t2.medium - - t3.large - - m6i.large - - m5ad.large - - t4g.medium - - r5dn.large - - c5d.large - - c6i.large - - c6g.medium - - m6gd.medium - - m7gd.medium - - m7g.medium - - r6gd.medium - - r6g.medium - - t2.nano - - m6g.medium - - t2.small - - t2.micro - - is4gen.medium - - c6gd.medium - - c6gn.medium + - u-6tb1.112xlarge + - u-9tb1.112xlarge + - u-6tb1.56xlarge + - c7i.48xlarge + - c7i.metal-48xl + - m7i.48xlarge + - r7i.metal-48xl + - m7i.metal-48xl + - inf2.48xlarge + - r7i.48xlarge + - r6i.metal + - x2iedn.32xlarge + - c6i.metal + - x2idn.metal + - c6i.32xlarge + - c6in.32xlarge + - x2idn.32xlarge + - m6i.32xlarge + - c6in.metal + - i4i.metal + - x2iedn.metal + - m6i.metal + - x1.32xlarge + - i4i.32xlarge + - r6i.32xlarge + - inf2.24xlarge + - r5.24xlarge + - r5dn.metal + - g4dn.metal + - c7i.24xlarge + - r5a.24xlarge + - m5d.24xlarge + - m5.24xlarge + - r5n.24xlarge + - r7i.24xlarge + - c7i.metal-24xl + - r7i.metal-24xl + - c6i.24xlarge + - r5n.metal + - i3en.24xlarge + - c5a.24xlarge + - i4i.24xlarge + - m5.metal + - c5.24xlarge + - r5d.24xlarge + - c5.metal + - m5a.24xlarge + - r6i.24xlarge + - m5ad.24xlarge + - i3en.metal + - r5dn.24xlarge + - c6in.24xlarge + - m6i.24xlarge + - r5ad.24xlarge + - m5d.metal + - m7i.metal-24xl + - x2idn.24xlarge + - inf1.24xlarge + - r5.metal + - r5d.metal + - m7i.24xlarge + - x2iedn.24xlarge + - c5.18xlarge + - i3.metal + - c5n.18xlarge + - c5d.18xlarge + - c5n.metal + - c6g.16xlarge + - c6i.16xlarge + - c6g.metal + - r5n.16xlarge + - m6i.16xlarge + - c6in.16xlarge + - m6g.16xlarge + - x1.16xlarge + - c6gd.16xlarge + - r5.16xlarge + - r6gd.16xlarge + - m6gd.metal + - r7i.16xlarge + - c7i.16xlarge + - r6g.16xlarge + - m6gd.16xlarge + - r6g.metal + - x2iedn.16xlarge + - r5a.16xlarge + - im4gn.16xlarge + - c6gd.metal + - i4i.16xlarge + - r4.16xlarge + - m5a.16xlarge + - m7g.16xlarge + - g4dn.16xlarge + - m7g.metal + - r5ad.16xlarge + - c6gn.16xlarge + - m5ad.16xlarge + - x2idn.16xlarge + - r5dn.16xlarge + - r6gd.metal + - m5d.16xlarge + - m6g.metal + - i3.16xlarge + - m7gd.16xlarge + - m7gd.metal + - c5a.16xlarge + - m7i.16xlarge + - r5d.16xlarge + - r6i.16xlarge + - m5.16xlarge + - g4dn.12xlarge + - c5a.12xlarge + - c6gn.12xlarge + - i4i.12xlarge + - c7i.12xlarge + - r5dn.12xlarge + - c6i.12xlarge + - c6g.12xlarge + - m7i.12xlarge + - r5.12xlarge + - m6g.12xlarge + - m5d.12xlarge + - m6i.12xlarge + - i3en.12xlarge + - r6g.12xlarge + - r5ad.12xlarge + - r6i.12xlarge + - m7gd.12xlarge + - c5.12xlarge + - r5n.12xlarge + - c6gd.12xlarge + - r6gd.12xlarge + - c6in.12xlarge + - m7g.12xlarge + - m6gd.12xlarge + - r7i.12xlarge + - r5a.12xlarge + - m5a.12xlarge + - m5ad.12xlarge + - r5d.12xlarge + - m5.12xlarge + - d2.8xlarge + - c5n.9xlarge + - c5.9xlarge + - c5d.9xlarge + - r4.8xlarge + - is4gen.8xlarge + - r6i.8xlarge + - i4i.8xlarge + - d3.8xlarge + - m7i-flex.8xlarge + - i3.8xlarge + - m6g.8xlarge + - r5.8xlarge + - r5n.8xlarge + - im4gn.8xlarge + - c6gn.8xlarge + - r7i.8xlarge + - c6in.8xlarge + - r5ad.8xlarge + - r5a.8xlarge + - r5d.8xlarge + - m5d.8xlarge + - m7g.8xlarge + - m5ad.8xlarge + - r6g.8xlarge + - r6gd.8xlarge + - m5a.8xlarge + - m6i.8xlarge + - x2iedn.8xlarge + - c7i-flex.8xlarge + - c6i.8xlarge + - r5dn.8xlarge + - c6gd.8xlarge + - g4dn.8xlarge + - m5.8xlarge + - inf2.8xlarge + - c6g.8xlarge + - m7gd.8xlarge + - m6gd.8xlarge + - m7i.8xlarge + - c5a.8xlarge + - c7i.8xlarge + - i3en.6xlarge + - inf1.6xlarge + - x2iedn.4xlarge + - c7i.4xlarge + - r5n.4xlarge + - c6in.4xlarge + - m6i.4xlarge + - r5a.4xlarge + - r5d.4xlarge + - c6i.4xlarge + - r5ad.4xlarge + - r4.4xlarge + - c7i-flex.4xlarge + - c5.4xlarge + - c5a.4xlarge + - r5.4xlarge + - m7g.4xlarge + - m5.4xlarge + - g4dn.4xlarge + - d3.4xlarge + - m5a.4xlarge + - is4gen.4xlarge + - c6g.4xlarge + - d2.4xlarge + - c6gn.4xlarge + - m7gd.4xlarge + - m5ad.4xlarge + - c5d.4xlarge + - c5n.4xlarge + - i3.4xlarge + - r6gd.4xlarge + - im4gn.4xlarge + - r6g.4xlarge + - i4i.4xlarge + - r7i.4xlarge + - m6g.4xlarge + - m6gd.4xlarge + - r6i.4xlarge + - c6gd.4xlarge + - r5dn.4xlarge + - m7i-flex.4xlarge + - m5d.4xlarge + - m7i.4xlarge + - i3en.3xlarge + - r6gd.2xlarge + - m5a.2xlarge + - c5d.2xlarge + - i3en.2xlarge + - r5dn.2xlarge + - m7i.2xlarge + - r5a.2xlarge + - m6i.2xlarge + - c6gn.2xlarge + - r6g.2xlarge + - r5n.2xlarge + - c5n.2xlarge + - r5d.2xlarge + - t3.2xlarge + - i3.2xlarge + - c7i.2xlarge + - i4i.2xlarge + - m5ad.2xlarge + - m6g.2xlarge + - is4gen.2xlarge + - inf1.2xlarge + - r6i.2xlarge + - r5.2xlarge + - m7gd.2xlarge + - m6gd.2xlarge + - g4dn.2xlarge + - m5.2xlarge + - d2.2xlarge + - d3.2xlarge + - r7i.2xlarge + - r5ad.2xlarge + - r4.2xlarge + - m7i-flex.2xlarge + - c7i-flex.2xlarge + - x2iedn.2xlarge + - c5a.2xlarge + - m7g.2xlarge + - t3a.2xlarge + - im4gn.2xlarge + - t2.2xlarge + - c5.2xlarge + - c6in.2xlarge + - t4g.2xlarge + - c6gd.2xlarge + - c6i.2xlarge + - m5d.2xlarge + - c6g.2xlarge + - m6gd.xlarge + - c7i.xlarge + - c6g.xlarge + - m7gd.xlarge + - m5a.xlarge + - i4i.xlarge + - c5n.xlarge + - r5.xlarge + - t2.xlarge + - m7g.xlarge + - r4.xlarge + - c6gd.xlarge + - i3en.xlarge + - g4dn.xlarge + - r6g.xlarge + - im4gn.xlarge + - c6gn.xlarge + - d3.xlarge + - i3.xlarge + - r7i.xlarge + - t4g.xlarge + - c5a.xlarge + - r6i.xlarge + - c6in.xlarge + - inf1.xlarge + - m6g.xlarge + - r5n.xlarge + - t3a.xlarge + - m7i-flex.xlarge + - r5d.xlarge + - inf2.xlarge + - is4gen.xlarge + - r5a.xlarge + - c5d.xlarge + - r6gd.xlarge + - m5ad.xlarge + - m5d.xlarge + - x2iedn.xlarge + - r5ad.xlarge + - r5dn.xlarge + - c6i.xlarge + - c5.xlarge + - m5.xlarge + - m7i.xlarge + - d2.xlarge + - c7i-flex.xlarge + - t3.xlarge + - m6i.xlarge + - t3a.nano + - c5.large + - r6i.large + - r5ad.large + - t4g.large + - m7g.large + - t3.medium + - t2.large + - c6in.large + - i3en.large + - is4gen.large + - t4g.nano + - t3.small + - i4i.large + - c7i-flex.large + - r5n.large + - t3a.micro + - r7i.large + - m6gd.large + - m7i-flex.large + - c6gn.large + - t4g.micro + - r5.large + - m5a.large + - m7gd.large + - m5d.large + - t3.nano + - c6g.large + - c5a.large + - r5d.large + - i3.large + - m5.large + - r6gd.large + - c6gd.large + - r5a.large + - t3a.small + - im4gn.large + - t3.micro + - c7i.large + - m7i.large + - m6g.large + - r4.large + - t3a.large + - t4g.small + - r6g.large + - c5n.large + - t3a.medium + - t2.medium + - t3.large + - m6i.large + - m5ad.large + - t4g.medium + - r5dn.large + - c5d.large + - c6i.large + - c6g.medium + - m6gd.medium + - m7gd.medium + - m7g.medium + - r6gd.medium + - r6g.medium + - t2.nano + - m6g.medium + - t2.small + - t2.micro + - is4gen.medium + - c6gd.medium + - c6gn.medium sa-east-1: - - u-12tb1.112xlarge - - u-6tb1.112xlarge - - u-3tb1.56xlarge - - u-6tb1.56xlarge - - g5.48xlarge - - c6a.metal - - inf2.48xlarge - - m6a.48xlarge - - c7i.metal-48xl - - m7i.48xlarge - - m7i.metal-48xl - - m6a.metal - - r7i.metal-48xl - - c7i.48xlarge - - r7i.48xlarge - - c6a.48xlarge - - g6.48xlarge - - i4i.metal - - c6in.32xlarge - - m6i.metal - - x2idn.32xlarge - - c6in.metal - - i4i.32xlarge - - x2idn.metal - - x2iedn.32xlarge - - m6i.32xlarge - - r6i.32xlarge - - c6a.32xlarge - - m6id.metal - - c6id.metal - - c6i.metal - - r6i.metal - - c6i.32xlarge - - x1e.32xlarge - - m6id.32xlarge - - x1.32xlarge - - m6a.32xlarge - - c6id.32xlarge - - x2iedn.metal - - g5.24xlarge - - i4i.24xlarge - - inf2.24xlarge - - c6id.24xlarge - - g6.24xlarge - - r7i.24xlarge - - r5d.24xlarge - - m6a.24xlarge - - c7i.24xlarge - - c6a.24xlarge - - c6in.24xlarge - - m5.24xlarge - - r5n.metal - - r5b.metal - - i3en.metal - - m5.metal - - inf1.24xlarge - - g4dn.metal - - c6i.24xlarge - - r5d.metal - - r6i.24xlarge - - m5d.24xlarge - - m6i.24xlarge - - r5n.24xlarge - - r5ad.24xlarge - - c5.metal - - m7i.metal-24xl - - c5d.metal - - m5ad.24xlarge - - r5b.24xlarge - - m5d.metal - - x2iedn.24xlarge - - c5ad.24xlarge - - i3en.24xlarge - - c5.24xlarge - - r7i.metal-24xl - - m7i.24xlarge - - m6id.24xlarge - - c5d.24xlarge - - x2idn.24xlarge - - c7i.metal-24xl - - r5a.24xlarge - - r5.24xlarge - - c5a.24xlarge - - r5.metal - - m5a.24xlarge - - c5d.18xlarge - - c5n.18xlarge - - i3.metal - - c5n.metal - - c5.18xlarge - - r6g.16xlarge - - m6gd.metal - - i4i.16xlarge - - m7i.16xlarge - - r6g.metal - - r5ad.16xlarge - - c7i.16xlarge - - c7g.16xlarge - - c6g.16xlarge - - r5b.16xlarge - - g5.16xlarge - - m6g.metal - - r6gd.16xlarge - - r4.16xlarge - - m7gd.16xlarge - - c6gd.metal - - r6gd.metal - - g4dn.16xlarge - - r5n.16xlarge - - c6gd.16xlarge - - r7i.16xlarge - - m7gd.metal - - m6a.16xlarge - - c6i.16xlarge - - r7g.16xlarge - - i3.16xlarge - - c7g.metal - - m6i.16xlarge - - r6i.16xlarge - - m7g.16xlarge - - m5d.16xlarge - - m6g.16xlarge - - c6id.16xlarge - - r7g.metal - - x1e.16xlarge - - x2iedn.16xlarge - - m5.16xlarge - - c5a.16xlarge - - g6.16xlarge - - c6in.16xlarge - - x2idn.16xlarge - - m5ad.16xlarge - - c6a.16xlarge - - m5a.16xlarge - - c6g.metal - - m6gd.16xlarge - - m6id.16xlarge - - m4.16xlarge - - m7g.metal - - r5.16xlarge - - c6gn.16xlarge - - r5a.16xlarge - - r5d.16xlarge - - x1.16xlarge - - c5ad.16xlarge - - i3en.12xlarge - - m7gd.12xlarge - - m6gd.12xlarge - - r6i.12xlarge - - r5n.12xlarge - - m5ad.12xlarge - - r7i.12xlarge - - g6.12xlarge - - m6a.12xlarge - - m5a.12xlarge - - m6i.12xlarge - - c5.12xlarge - - c6a.12xlarge - - r6gd.12xlarge - - m7g.12xlarge - - i4i.12xlarge - - g4dn.12xlarge - - c6gd.12xlarge - - m6id.12xlarge - - c6i.12xlarge - - m7i.12xlarge - - c7g.12xlarge - - r5.12xlarge - - r7g.12xlarge - - m5zn.12xlarge - - r5a.12xlarge - - r6g.12xlarge - - m5.12xlarge - - c6g.12xlarge - - m5d.12xlarge - - c6gn.12xlarge - - c5ad.12xlarge - - r5b.12xlarge - - c5d.12xlarge - - r5ad.12xlarge - - c7i.12xlarge - - c6in.12xlarge - - g5.12xlarge - - m6g.12xlarge - - c6id.12xlarge - - m5zn.metal - - c5a.12xlarge - - r5d.12xlarge - - m4.10xlarge - - c5d.9xlarge - - c5.9xlarge - - c4.8xlarge - - c5n.9xlarge - - c6a.8xlarge - - m7g.8xlarge - - c7g.8xlarge - - c5ad.8xlarge - - m5d.8xlarge - - m5.8xlarge - - r6g.8xlarge - - c3.8xlarge - - g6.8xlarge - - r5ad.8xlarge - - r6gd.8xlarge - - c6id.8xlarge - - c6gd.8xlarge - - m6g.8xlarge - - m6a.8xlarge - - r7i.8xlarge - - c6gn.8xlarge - - i3.8xlarge - - c7i-flex.8xlarge - - g5.8xlarge - - r5n.8xlarge - - inf2.8xlarge - - c6in.8xlarge - - i4i.8xlarge - - r4.8xlarge - - c7i.8xlarge - - gr6.8xlarge - - m7i-flex.8xlarge - - m5ad.8xlarge - - c6g.8xlarge - - x2iedn.8xlarge - - x1e.8xlarge - - g4dn.8xlarge - - c5a.8xlarge - - m7i.8xlarge - - r6i.8xlarge - - r3.8xlarge - - r7g.8xlarge - - r5b.8xlarge - - m6i.8xlarge - - r5a.8xlarge - - m5a.8xlarge - - m7gd.8xlarge - - r5.8xlarge - - r5d.8xlarge - - m6gd.8xlarge - - c6i.8xlarge - - m6id.8xlarge - - inf1.6xlarge - - i3en.6xlarge - - m5zn.6xlarge - - g5.4xlarge - - m6gd.4xlarge - - c6i.4xlarge - - r5d.4xlarge - - m5.4xlarge - - c6in.4xlarge - - m5d.4xlarge - - c6g.4xlarge - - m6a.4xlarge - - x2iedn.4xlarge - - c5d.4xlarge - - r6g.4xlarge - - i3.4xlarge - - r5b.4xlarge - - c6id.4xlarge - - r6i.4xlarge - - r6gd.4xlarge - - r7i.4xlarge - - x1e.4xlarge - - m7i.4xlarge - - c5.4xlarge - - m5ad.4xlarge - - m7g.4xlarge - - c6gd.4xlarge - - c7g.4xlarge - - c6gn.4xlarge - - m6g.4xlarge - - g4dn.4xlarge - - r5.4xlarge - - r5ad.4xlarge - - m7gd.4xlarge - - m4.4xlarge - - r5a.4xlarge - - c5ad.4xlarge - - gr6.4xlarge - - m6i.4xlarge - - c7i.4xlarge - - r4.4xlarge - - g6.4xlarge - - m5a.4xlarge - - m6id.4xlarge - - c6a.4xlarge - - c7i-flex.4xlarge - - r7g.4xlarge - - r5n.4xlarge - - r3.4xlarge - - c5n.4xlarge - - c4.4xlarge - - c5a.4xlarge - - c3.4xlarge - - m7i-flex.4xlarge - - i4i.4xlarge - - i3en.3xlarge - - m5zn.3xlarge - - r7g.2xlarge - - g6.2xlarge - - m6a.2xlarge - - c7g.2xlarge - - g4dn.2xlarge - - m6i.2xlarge - - t2.2xlarge - - c5n.2xlarge - - m5a.2xlarge - - r5b.2xlarge - - c6i.2xlarge - - c5ad.2xlarge - - m5zn.2xlarge - - c4.2xlarge - - r5n.2xlarge - - r5a.2xlarge - - r6gd.2xlarge - - m6id.2xlarge - - x2iedn.2xlarge - - m6gd.2xlarge - - m5d.2xlarge - - i4i.2xlarge - - c6g.2xlarge - - m2.4xlarge - - r6i.2xlarge - - c6gd.2xlarge - - c7i.2xlarge - - g5.2xlarge - - x1e.2xlarge - - m7i-flex.2xlarge - - c6a.2xlarge - - i3.2xlarge - - c6id.2xlarge - - m7i.2xlarge - - r5d.2xlarge - - r6g.2xlarge - - m7gd.2xlarge - - inf1.2xlarge - - c1.xlarge - - c5d.2xlarge - - m6g.2xlarge - - t3a.2xlarge - - t4g.2xlarge - - r5.2xlarge - - m5ad.2xlarge - - i3en.2xlarge - - c7i-flex.2xlarge - - t3.2xlarge - - m7g.2xlarge - - c5.2xlarge - - m4.2xlarge - - r3.2xlarge - - c5a.2xlarge - - m3.2xlarge - - c6in.2xlarge - - c3.2xlarge - - r4.2xlarge - - r5ad.2xlarge - - r7i.2xlarge - - c6gn.2xlarge - - m5.2xlarge - - m5ad.xlarge - - m4.xlarge - - t2.xlarge - - c6gd.xlarge - - r6gd.xlarge - - t3a.xlarge - - c3.xlarge - - m6gd.xlarge - - m6id.xlarge - - m7g.xlarge - - r5a.xlarge - - x2iedn.xlarge - - c7i.xlarge - - r6i.xlarge - - r5d.xlarge - - i4i.xlarge - - m3.xlarge - - m7i-flex.xlarge - - r4.xlarge - - i3.xlarge - - m5a.xlarge - - m2.2xlarge - - r7i.xlarge - - m6a.xlarge - - m7gd.xlarge - - m5zn.xlarge - - t4g.xlarge - - g4dn.xlarge - - r7g.xlarge - - c4.xlarge - - c6in.xlarge - - c6gn.xlarge - - inf2.xlarge - - c6i.xlarge - - r5b.xlarge - - c5.xlarge - - r5n.xlarge - - c7g.xlarge - - r5ad.xlarge - - m6i.xlarge - - r3.xlarge - - r5.xlarge - - m5.xlarge - - c5ad.xlarge - - c5a.xlarge - - m5d.xlarge - - c6g.xlarge - - g5.xlarge - - i3en.xlarge - - m7i.xlarge - - inf1.xlarge - - r6g.xlarge - - c6id.xlarge - - g6.xlarge - - c7i-flex.xlarge - - c6a.xlarge - - x1e.xlarge - - t3.xlarge - - m1.xlarge - - c5d.xlarge - - m6g.xlarge - - c5n.xlarge - - t3.large - - m5d.large - - t3a.micro - - i3en.large - - c3.large - - m5ad.large - - t2.medium - - r7g.large - - r5b.large - - r6g.large - - c6id.large - - t3.micro - - r6gd.large - - c7g.large - - t3a.small - - c4.large - - t2.large - - r5ad.large - - m1.large - - r5.large - - m4.large - - t3a.large - - t4g.nano - - c6a.large - - t3a.nano - - r6i.large - - m6gd.large - - r4.large - - c5ad.large - - m6id.large - - r7i.large - - t3.nano - - t4g.micro - - c1.medium - - c6gn.large - - m5.large - - t3a.medium - - c5.large - - m6i.large - - c7i.large - - t4g.medium - - r5a.large - - c5n.large - - r5n.large - - m7g.large - - t4g.small - - m7i-flex.large - - c6i.large - - m2.xlarge - - m6a.large - - r5d.large - - m7i.large - - c6g.large - - t3.medium - - c5d.large - - c5a.large - - c6in.large - - t3.small - - m3.large - - c6gd.large - - c7i-flex.large - - i4i.large - - r3.large - - m7gd.large - - m5a.large - - t4g.large - - m5zn.large - - i3.large - - m6g.large - - c6g.medium - - m7gd.medium - - t2.small - - m1.medium - - m6g.medium - - m1.small - - m6gd.medium - - t1.micro - - r7g.medium - - t2.micro - - m7g.medium - - m3.medium - - r6g.medium - - c6gd.medium - - c7g.medium - - t2.nano - - c6gn.medium - - r6gd.medium + - u-12tb1.112xlarge + - u-6tb1.112xlarge + - u-3tb1.56xlarge + - u-6tb1.56xlarge + - g5.48xlarge + - c6a.metal + - inf2.48xlarge + - m6a.48xlarge + - c7i.metal-48xl + - m7i.48xlarge + - m7i.metal-48xl + - m6a.metal + - r7i.metal-48xl + - c7i.48xlarge + - r7i.48xlarge + - c6a.48xlarge + - g6.48xlarge + - i4i.metal + - c6in.32xlarge + - m6i.metal + - x2idn.32xlarge + - c6in.metal + - i4i.32xlarge + - x2idn.metal + - x2iedn.32xlarge + - m6i.32xlarge + - r6i.32xlarge + - c6a.32xlarge + - m6id.metal + - c6id.metal + - c6i.metal + - r6i.metal + - c6i.32xlarge + - x1e.32xlarge + - m6id.32xlarge + - x1.32xlarge + - m6a.32xlarge + - c6id.32xlarge + - x2iedn.metal + - g5.24xlarge + - i4i.24xlarge + - inf2.24xlarge + - c6id.24xlarge + - g6.24xlarge + - r7i.24xlarge + - r5d.24xlarge + - m6a.24xlarge + - c7i.24xlarge + - c6a.24xlarge + - c6in.24xlarge + - m5.24xlarge + - r5n.metal + - r5b.metal + - i3en.metal + - m5.metal + - inf1.24xlarge + - g4dn.metal + - c6i.24xlarge + - r5d.metal + - r6i.24xlarge + - m5d.24xlarge + - m6i.24xlarge + - r5n.24xlarge + - r5ad.24xlarge + - c5.metal + - m7i.metal-24xl + - c5d.metal + - m5ad.24xlarge + - r5b.24xlarge + - m5d.metal + - x2iedn.24xlarge + - c5ad.24xlarge + - i3en.24xlarge + - c5.24xlarge + - r7i.metal-24xl + - m7i.24xlarge + - m6id.24xlarge + - c5d.24xlarge + - x2idn.24xlarge + - c7i.metal-24xl + - r5a.24xlarge + - r5.24xlarge + - c5a.24xlarge + - r5.metal + - m5a.24xlarge + - c5d.18xlarge + - c5n.18xlarge + - i3.metal + - c5n.metal + - c5.18xlarge + - r6g.16xlarge + - m6gd.metal + - i4i.16xlarge + - m7i.16xlarge + - r6g.metal + - r5ad.16xlarge + - c7i.16xlarge + - c7g.16xlarge + - c6g.16xlarge + - r5b.16xlarge + - g5.16xlarge + - m6g.metal + - r6gd.16xlarge + - r4.16xlarge + - m7gd.16xlarge + - c6gd.metal + - r6gd.metal + - g4dn.16xlarge + - r5n.16xlarge + - c6gd.16xlarge + - r7i.16xlarge + - m7gd.metal + - m6a.16xlarge + - c6i.16xlarge + - r7g.16xlarge + - i3.16xlarge + - c7g.metal + - m6i.16xlarge + - r6i.16xlarge + - m7g.16xlarge + - m5d.16xlarge + - m6g.16xlarge + - c6id.16xlarge + - r7g.metal + - x1e.16xlarge + - x2iedn.16xlarge + - m5.16xlarge + - c5a.16xlarge + - g6.16xlarge + - c6in.16xlarge + - x2idn.16xlarge + - m5ad.16xlarge + - c6a.16xlarge + - m5a.16xlarge + - c6g.metal + - m6gd.16xlarge + - m6id.16xlarge + - m4.16xlarge + - m7g.metal + - r5.16xlarge + - c6gn.16xlarge + - r5a.16xlarge + - r5d.16xlarge + - x1.16xlarge + - c5ad.16xlarge + - i3en.12xlarge + - m7gd.12xlarge + - m6gd.12xlarge + - r6i.12xlarge + - r5n.12xlarge + - m5ad.12xlarge + - r7i.12xlarge + - g6.12xlarge + - m6a.12xlarge + - m5a.12xlarge + - m6i.12xlarge + - c5.12xlarge + - c6a.12xlarge + - r6gd.12xlarge + - m7g.12xlarge + - i4i.12xlarge + - g4dn.12xlarge + - c6gd.12xlarge + - m6id.12xlarge + - c6i.12xlarge + - m7i.12xlarge + - c7g.12xlarge + - r5.12xlarge + - r7g.12xlarge + - m5zn.12xlarge + - r5a.12xlarge + - r6g.12xlarge + - m5.12xlarge + - c6g.12xlarge + - m5d.12xlarge + - c6gn.12xlarge + - c5ad.12xlarge + - r5b.12xlarge + - c5d.12xlarge + - r5ad.12xlarge + - c7i.12xlarge + - c6in.12xlarge + - g5.12xlarge + - m6g.12xlarge + - c6id.12xlarge + - m5zn.metal + - c5a.12xlarge + - r5d.12xlarge + - m4.10xlarge + - c5d.9xlarge + - c5.9xlarge + - c4.8xlarge + - c5n.9xlarge + - c6a.8xlarge + - m7g.8xlarge + - c7g.8xlarge + - c5ad.8xlarge + - m5d.8xlarge + - m5.8xlarge + - r6g.8xlarge + - c3.8xlarge + - g6.8xlarge + - r5ad.8xlarge + - r6gd.8xlarge + - c6id.8xlarge + - c6gd.8xlarge + - m6g.8xlarge + - m6a.8xlarge + - r7i.8xlarge + - c6gn.8xlarge + - i3.8xlarge + - c7i-flex.8xlarge + - g5.8xlarge + - r5n.8xlarge + - inf2.8xlarge + - c6in.8xlarge + - i4i.8xlarge + - r4.8xlarge + - c7i.8xlarge + - gr6.8xlarge + - m7i-flex.8xlarge + - m5ad.8xlarge + - c6g.8xlarge + - x2iedn.8xlarge + - x1e.8xlarge + - g4dn.8xlarge + - c5a.8xlarge + - m7i.8xlarge + - r6i.8xlarge + - r3.8xlarge + - r7g.8xlarge + - r5b.8xlarge + - m6i.8xlarge + - r5a.8xlarge + - m5a.8xlarge + - m7gd.8xlarge + - r5.8xlarge + - r5d.8xlarge + - m6gd.8xlarge + - c6i.8xlarge + - m6id.8xlarge + - inf1.6xlarge + - i3en.6xlarge + - m5zn.6xlarge + - g5.4xlarge + - m6gd.4xlarge + - c6i.4xlarge + - r5d.4xlarge + - m5.4xlarge + - c6in.4xlarge + - m5d.4xlarge + - c6g.4xlarge + - m6a.4xlarge + - x2iedn.4xlarge + - c5d.4xlarge + - r6g.4xlarge + - i3.4xlarge + - r5b.4xlarge + - c6id.4xlarge + - r6i.4xlarge + - r6gd.4xlarge + - r7i.4xlarge + - x1e.4xlarge + - m7i.4xlarge + - c5.4xlarge + - m5ad.4xlarge + - m7g.4xlarge + - c6gd.4xlarge + - c7g.4xlarge + - c6gn.4xlarge + - m6g.4xlarge + - g4dn.4xlarge + - r5.4xlarge + - r5ad.4xlarge + - m7gd.4xlarge + - m4.4xlarge + - r5a.4xlarge + - c5ad.4xlarge + - gr6.4xlarge + - m6i.4xlarge + - c7i.4xlarge + - r4.4xlarge + - g6.4xlarge + - m5a.4xlarge + - m6id.4xlarge + - c6a.4xlarge + - c7i-flex.4xlarge + - r7g.4xlarge + - r5n.4xlarge + - r3.4xlarge + - c5n.4xlarge + - c4.4xlarge + - c5a.4xlarge + - c3.4xlarge + - m7i-flex.4xlarge + - i4i.4xlarge + - i3en.3xlarge + - m5zn.3xlarge + - r7g.2xlarge + - g6.2xlarge + - m6a.2xlarge + - c7g.2xlarge + - g4dn.2xlarge + - m6i.2xlarge + - t2.2xlarge + - c5n.2xlarge + - m5a.2xlarge + - r5b.2xlarge + - c6i.2xlarge + - c5ad.2xlarge + - m5zn.2xlarge + - c4.2xlarge + - r5n.2xlarge + - r5a.2xlarge + - r6gd.2xlarge + - m6id.2xlarge + - x2iedn.2xlarge + - m6gd.2xlarge + - m5d.2xlarge + - i4i.2xlarge + - c6g.2xlarge + - m2.4xlarge + - r6i.2xlarge + - c6gd.2xlarge + - c7i.2xlarge + - g5.2xlarge + - x1e.2xlarge + - m7i-flex.2xlarge + - c6a.2xlarge + - i3.2xlarge + - c6id.2xlarge + - m7i.2xlarge + - r5d.2xlarge + - r6g.2xlarge + - m7gd.2xlarge + - inf1.2xlarge + - c1.xlarge + - c5d.2xlarge + - m6g.2xlarge + - t3a.2xlarge + - t4g.2xlarge + - r5.2xlarge + - m5ad.2xlarge + - i3en.2xlarge + - c7i-flex.2xlarge + - t3.2xlarge + - m7g.2xlarge + - c5.2xlarge + - m4.2xlarge + - r3.2xlarge + - c5a.2xlarge + - m3.2xlarge + - c6in.2xlarge + - c3.2xlarge + - r4.2xlarge + - r5ad.2xlarge + - r7i.2xlarge + - c6gn.2xlarge + - m5.2xlarge + - m5ad.xlarge + - m4.xlarge + - t2.xlarge + - c6gd.xlarge + - r6gd.xlarge + - t3a.xlarge + - c3.xlarge + - m6gd.xlarge + - m6id.xlarge + - m7g.xlarge + - r5a.xlarge + - x2iedn.xlarge + - c7i.xlarge + - r6i.xlarge + - r5d.xlarge + - i4i.xlarge + - m3.xlarge + - m7i-flex.xlarge + - r4.xlarge + - i3.xlarge + - m5a.xlarge + - m2.2xlarge + - r7i.xlarge + - m6a.xlarge + - m7gd.xlarge + - m5zn.xlarge + - t4g.xlarge + - g4dn.xlarge + - r7g.xlarge + - c4.xlarge + - c6in.xlarge + - c6gn.xlarge + - inf2.xlarge + - c6i.xlarge + - r5b.xlarge + - c5.xlarge + - r5n.xlarge + - c7g.xlarge + - r5ad.xlarge + - m6i.xlarge + - r3.xlarge + - r5.xlarge + - m5.xlarge + - c5ad.xlarge + - c5a.xlarge + - m5d.xlarge + - c6g.xlarge + - g5.xlarge + - i3en.xlarge + - m7i.xlarge + - inf1.xlarge + - r6g.xlarge + - c6id.xlarge + - g6.xlarge + - c7i-flex.xlarge + - c6a.xlarge + - x1e.xlarge + - t3.xlarge + - m1.xlarge + - c5d.xlarge + - m6g.xlarge + - c5n.xlarge + - t3.large + - m5d.large + - t3a.micro + - i3en.large + - c3.large + - m5ad.large + - t2.medium + - r7g.large + - r5b.large + - r6g.large + - c6id.large + - t3.micro + - r6gd.large + - c7g.large + - t3a.small + - c4.large + - t2.large + - r5ad.large + - m1.large + - r5.large + - m4.large + - t3a.large + - t4g.nano + - c6a.large + - t3a.nano + - r6i.large + - m6gd.large + - r4.large + - c5ad.large + - m6id.large + - r7i.large + - t3.nano + - t4g.micro + - c1.medium + - c6gn.large + - m5.large + - t3a.medium + - c5.large + - m6i.large + - c7i.large + - t4g.medium + - r5a.large + - c5n.large + - r5n.large + - m7g.large + - t4g.small + - m7i-flex.large + - c6i.large + - m2.xlarge + - m6a.large + - r5d.large + - m7i.large + - c6g.large + - t3.medium + - c5d.large + - c5a.large + - c6in.large + - t3.small + - m3.large + - c6gd.large + - c7i-flex.large + - i4i.large + - r3.large + - m7gd.large + - m5a.large + - t4g.large + - m5zn.large + - i3.large + - m6g.large + - c6g.medium + - m7gd.medium + - t2.small + - m1.medium + - m6g.medium + - m1.small + - m6gd.medium + - t1.micro + - r7g.medium + - t2.micro + - m7g.medium + - m3.medium + - r6g.medium + - c6gd.medium + - c7g.medium + - t2.nano + - c6gn.medium + - r6gd.medium us-east-1: - - u7in-24tb.224xlarge - - u7in-32tb.224xlarge - - u7in-16tb.224xlarge - - u7i-12tb.224xlarge - - u-6tb1.112xlarge - - u-18tb1.112xlarge - - u-12tb1.112xlarge - - u-24tb1.112xlarge - - u-9tb1.112xlarge - - u-3tb1.56xlarge - - u-6tb1.56xlarge - - r7a.48xlarge - - c7a.48xlarge - - c8g.48xlarge - - r6a.metal - - r8g.metal-48xl - - g6e.48xlarge - - r6a.48xlarge - - c6a.metal - - m8g.metal-48xl - - r7i.metal-48xl - - c7a.metal-48xl - - c6a.48xlarge - - c8g.metal-48xl - - m7a.metal-48xl - - m8g.48xlarge - - x8g.48xlarge - - m6a.48xlarge - - c7i.48xlarge - - g6.48xlarge - - inf2.48xlarge - - r7i.48xlarge - - m6a.metal - - c7i.metal-48xl - - m7i.metal-48xl - - p5.48xlarge - - r7a.metal-48xl - - m7i.48xlarge - - m7a.48xlarge - - g5.48xlarge - - x8g.metal-48xl - - r8g.48xlarge - - r6in.metal - - r7iz.32xlarge - - m6a.32xlarge - - m6i.32xlarge - - r6i.32xlarge - - r6a.32xlarge - - c7a.32xlarge - - r6id.metal - - x1e.32xlarge - - trn1.32xlarge - - c6id.metal - - x2idn.32xlarge - - x1.32xlarge - - r7a.32xlarge - - c6in.32xlarge - - c6i.metal - - x2iedn.metal - - m6in.metal - - m6idn.metal - - m6id.metal - - m6in.32xlarge - - i4i.metal - - r6i.metal - - x2iedn.32xlarge - - c6id.32xlarge - - m6i.metal - - x2idn.metal - - trn1n.32xlarge - - m6idn.32xlarge - - i4i.32xlarge - - m7a.32xlarge - - r7iz.metal-32xl - - c6a.32xlarge - - m6id.32xlarge - - r6id.32xlarge - - r6idn.metal - - r6in.32xlarge - - r6idn.32xlarge - - c6in.metal - - c6i.32xlarge - - m5d.metal - - r6id.24xlarge - - c5d.24xlarge - - vt1.24xlarge - - r6in.24xlarge - - inf1.24xlarge - - r5.metal - - i3en.metal - - r7i.24xlarge - - m6a.24xlarge - - c6in.24xlarge - - c5ad.24xlarge - - c7i.metal-24xl - - c6a.24xlarge - - r5dn.metal - - r5b.24xlarge - - m5dn.24xlarge - - g6e.24xlarge - - r8g.metal-24xl - - m8g.24xlarge - - r8g.24xlarge - - r7i.metal-24xl - - i3en.24xlarge - - r5n.metal - - c6id.24xlarge - - m6in.24xlarge - - m5n.24xlarge - - m7i.metal-24xl - - g4dn.metal - - r5dn.24xlarge - - r5a.24xlarge - - c5.24xlarge - - r6i.24xlarge - - dl1.24xlarge - - x2iedn.24xlarge - - r6idn.24xlarge - - r5.24xlarge - - r5d.metal - - g6.24xlarge - - c5d.metal - - inf2.24xlarge - - c5a.24xlarge - - m8g.metal-24xl - - r5n.24xlarge - - m5n.metal - - m5.metal - - c8g.24xlarge - - c5.metal - - m5d.24xlarge - - p4d.24xlarge - - c6i.24xlarge - - m7i.24xlarge - - r7a.24xlarge - - x8g.24xlarge - - x2idn.24xlarge - - c7i.24xlarge - - r5d.24xlarge - - x8g.metal-24xl - - m6i.24xlarge - - m5.24xlarge - - g5.24xlarge - - m5dn.metal - - c7a.24xlarge - - i4i.24xlarge - - r5b.metal - - m7a.24xlarge - - r5ad.24xlarge - - m6idn.24xlarge - - p3dn.24xlarge - - m6id.24xlarge - - c8g.metal-24xl - - m5a.24xlarge - - r6a.24xlarge - - m5ad.24xlarge - - i3.metal - - c5n.metal - - c5d.18xlarge - - c5n.18xlarge - - c5.18xlarge - - r8g.16xlarge - - g4ad.16xlarge - - c6a.16xlarge - - i3.16xlarge - - m6g.16xlarge - - r5dn.16xlarge - - m5.16xlarge - - r6a.16xlarge - - r7iz.16xlarge - - m6i.16xlarge - - c6gd.16xlarge - - x1e.16xlarge - - c7gn.16xlarge - - r4.16xlarge - - r5n.16xlarge - - m7gd.16xlarge - - c8g.16xlarge - - c6g.16xlarge - - x2gd.16xlarge - - c7a.16xlarge - - c7g.metal - - m5dn.16xlarge - - c5a.16xlarge - - m6id.16xlarge - - c6gn.16xlarge - - m6a.16xlarge - - c6id.16xlarge - - c7gd.metal - - g3.16xlarge - - x2iedn.16xlarge - - x2idn.16xlarge - - m6gd.16xlarge - - x1.16xlarge - - c6i.16xlarge - - m7g.16xlarge - - g5g.16xlarge - - r5ad.16xlarge - - c6g.metal - - c6in.16xlarge - - c7i.16xlarge - - m7g.metal - - m6g.metal - - c7g.16xlarge - - r6i.16xlarge - - g5g.metal - - m6in.16xlarge - - r5b.16xlarge - - g6e.16xlarge - - m6gd.metal - - f1.16xlarge - - r7a.16xlarge - - g5.16xlarge - - r6in.16xlarge - - i4g.16xlarge - - m7i.16xlarge - - r7iz.metal-16xl - - r7i.16xlarge - - x2gd.metal - - r7gd.metal - - m5n.16xlarge - - g6.16xlarge - - c7gd.16xlarge - - m7a.16xlarge - - r5d.16xlarge - - m6idn.16xlarge - - c7gn.metal - - x8g.16xlarge - - m5d.16xlarge - - r5a.16xlarge - - p2.16xlarge - - hpc7g.16xlarge - - r6id.16xlarge - - g4dn.16xlarge - - r7gd.16xlarge - - r7g.metal - - m4.16xlarge - - r6gd.metal - - r7g.16xlarge - - r5.16xlarge - - r6g.16xlarge - - c6gd.metal - - im4gn.16xlarge - - c5ad.16xlarge - - p3.16xlarge - - r6idn.16xlarge - - i4i.16xlarge - - r6gd.16xlarge - - m7gd.metal - - r6g.metal - - h1.16xlarge - - m5a.16xlarge - - m5ad.16xlarge - - m8g.16xlarge - - r5a.12xlarge - - m6g.12xlarge - - x2gd.12xlarge - - d3en.12xlarge - - r6id.12xlarge - - x2iezn.metal - - c5d.12xlarge - - r5n.12xlarge - - r7gd.12xlarge - - m5d.12xlarge - - c6i.12xlarge - - c6id.12xlarge - - m7gd.12xlarge - - m7g.12xlarge - - c8g.12xlarge - - i3en.12xlarge - - i4i.12xlarge - - g4dn.12xlarge - - c7g.12xlarge - - m7i.12xlarge - - c5a.12xlarge - - g6.12xlarge - - r6idn.12xlarge - - r6in.12xlarge - - r5.12xlarge - - m5zn.metal - - c7gn.12xlarge - - r7iz.12xlarge - - m6idn.12xlarge - - c6g.12xlarge - - r7g.12xlarge - - c6in.12xlarge - - m5zn.12xlarge - - x2iezn.12xlarge - - r6a.12xlarge - - m8g.12xlarge - - z1d.metal - - c6gd.12xlarge - - m6a.12xlarge - - m6in.12xlarge - - x8g.12xlarge - - r5b.12xlarge - - m6id.12xlarge - - r5ad.12xlarge - - z1d.12xlarge - - r6gd.12xlarge - - m6i.12xlarge - - g5.12xlarge - - m6gd.12xlarge - - c6gn.12xlarge - - c5.12xlarge - - r8g.12xlarge - - m5ad.12xlarge - - r6g.12xlarge - - m7a.12xlarge - - r6i.12xlarge - - c7gd.12xlarge - - m5a.12xlarge - - c6a.12xlarge - - r5dn.12xlarge - - m5n.12xlarge - - g6e.12xlarge - - r5d.12xlarge - - m5dn.12xlarge - - c5ad.12xlarge - - r7i.12xlarge - - c7a.12xlarge - - r7a.12xlarge - - m5.12xlarge - - c7i.12xlarge - - m4.10xlarge - - d2.8xlarge - - c5d.9xlarge - - c4.8xlarge - - c5n.9xlarge - - c5.9xlarge - - h1.8xlarge - - x8g.8xlarge - - c7a.8xlarge - - m7a.8xlarge - - r7iz.8xlarge - - r8g.8xlarge - - x2gd.8xlarge - - r6in.8xlarge - - m6idn.8xlarge - - r5d.8xlarge - - c8g.8xlarge - - r6i.8xlarge - - g4dn.8xlarge - - m6g.8xlarge - - c7i.8xlarge - - r7i.8xlarge - - r6id.8xlarge - - c7g.8xlarge - - c3.8xlarge - - r6idn.8xlarge - - i3.8xlarge - - c6id.8xlarge - - is4gen.8xlarge - - r5dn.8xlarge - - g6e.8xlarge - - r6g.8xlarge - - m6gd.8xlarge - - c6g.8xlarge - - m7i-flex.8xlarge - - c6a.8xlarge - - m7i.8xlarge - - p3.8xlarge - - d3.8xlarge - - r6a.8xlarge - - g5.8xlarge - - i4i.8xlarge - - m5dn.8xlarge - - m7g.8xlarge - - m5n.8xlarge - - x1e.8xlarge - - g5g.8xlarge - - r5n.8xlarge - - c6in.8xlarge - - c7gd.8xlarge - - m8g.8xlarge - - c6gd.8xlarge - - r7gd.8xlarge - - im4gn.8xlarge - - c7i-flex.8xlarge - - m7gd.8xlarge - - m6a.8xlarge - - c7gn.8xlarge - - r5b.8xlarge - - r6gd.8xlarge - - m6i.8xlarge - - r4.8xlarge - - c6i.8xlarge - - c5a.8xlarge - - c6gn.8xlarge - - r7a.8xlarge - - gr6.8xlarge - - g3.8xlarge - - g4ad.8xlarge - - r5a.8xlarge - - m5.8xlarge - - inf2.8xlarge - - m6in.8xlarge - - m5ad.8xlarge - - d3en.8xlarge - - g6.8xlarge - - x2iezn.8xlarge - - x2iedn.8xlarge - - i2.8xlarge - - r5ad.8xlarge - - m5d.8xlarge - - i4g.8xlarge - - p2.8xlarge - - r7g.8xlarge - - hpc7g.8xlarge - - m6id.8xlarge - - r5.8xlarge - - r3.8xlarge - - c5ad.8xlarge - - m5a.8xlarge - - d3en.6xlarge - - inf1.6xlarge - - vt1.6xlarge - - i3en.6xlarge - - x2iezn.6xlarge - - z1d.6xlarge - - m5zn.6xlarge - - mac2-m1ultra.metal - - g4dn.4xlarge - - c5.4xlarge - - r5n.4xlarge - - c6gn.4xlarge - - x8g.4xlarge - - r7gd.4xlarge - - m6idn.4xlarge - - c8g.4xlarge - - m7g.4xlarge - - m5.4xlarge - - c5n.4xlarge - - i3.4xlarge - - r8g.4xlarge - - h1.4xlarge - - c7a.4xlarge - - i2.4xlarge - - c6a.4xlarge - - g5.4xlarge - - c4.4xlarge - - g6.4xlarge - - m5d.4xlarge - - c7i-flex.4xlarge - - c6i.4xlarge - - m6g.4xlarge - - r6i.4xlarge - - d2.4xlarge - - r7i.4xlarge - - c5ad.4xlarge - - m6gd.4xlarge - - r7a.4xlarge - - r3.4xlarge - - x2gd.4xlarge - - x1e.4xlarge - - m5ad.4xlarge - - g4ad.4xlarge - - hpc7g.4xlarge - - r5dn.4xlarge - - c6gd.4xlarge - - r6in.4xlarge - - is4gen.4xlarge - - r6a.4xlarge - - c6g.4xlarge - - m6i.4xlarge - - i4g.4xlarge - - m5a.4xlarge - - x2iezn.4xlarge - - m7i-flex.4xlarge - - m6a.4xlarge - - m6in.4xlarge - - x2iedn.4xlarge - - gr6.4xlarge - - i4i.4xlarge - - im4gn.4xlarge - - c7i.4xlarge - - m5dn.4xlarge - - r6id.4xlarge - - c7gd.4xlarge - - r7iz.4xlarge - - m6id.4xlarge - - g5g.4xlarge - - r5d.4xlarge - - f1.4xlarge - - r5a.4xlarge - - c5d.4xlarge - - d3en.4xlarge - - r6g.4xlarge - - r6gd.4xlarge - - c6id.4xlarge - - m5n.4xlarge - - m8g.4xlarge - - m7a.4xlarge - - m7gd.4xlarge - - r7g.4xlarge - - r6idn.4xlarge - - r5b.4xlarge - - c6in.4xlarge - - c7g.4xlarge - - c5a.4xlarge - - c3.4xlarge - - g3.4xlarge - - c7gn.4xlarge - - r5ad.4xlarge - - a1.metal - - a1.4xlarge - - d3.4xlarge - - r5.4xlarge - - g6e.4xlarge - - r4.4xlarge - - m4.4xlarge - - m7i.4xlarge - - m5zn.3xlarge - - vt1.3xlarge - - i3en.3xlarge - - mac1.metal - - z1d.3xlarge - - mac2-m2pro.metal - - r7gd.2xlarge - - i3en.2xlarge - - m7g.2xlarge - - r6id.2xlarge - - r7a.2xlarge - - c3.2xlarge - - c7a.2xlarge - - r8g.2xlarge - - a1.2xlarge - - c5n.2xlarge - - m3.2xlarge - - m5a.2xlarge - - m2.4xlarge - - r6a.2xlarge - - r5b.2xlarge - - m5dn.2xlarge - - m6gd.2xlarge - - z1d.2xlarge - - m6g.2xlarge - - c6gd.2xlarge - - c7gd.2xlarge - - t4g.2xlarge - - m5.2xlarge - - m4.2xlarge - - r4.2xlarge - - i2.2xlarge - - m5zn.2xlarge - - r5.2xlarge - - m7a.2xlarge - - x1e.2xlarge - - m6idn.2xlarge - - m6a.2xlarge - - c4.2xlarge - - r6idn.2xlarge - - r5n.2xlarge - - r7g.2xlarge - - mac2-m2.metal - - r5a.2xlarge - - m7gd.2xlarge - - m6in.2xlarge - - c7gn.2xlarge - - g6.2xlarge - - c5.2xlarge - - c5d.2xlarge - - c8g.2xlarge - - r6i.2xlarge - - t3.2xlarge - - trn1.2xlarge - - r5d.2xlarge - - c6id.2xlarge - - c6i.2xlarge - - r7iz.2xlarge - - t3a.2xlarge - - d3en.2xlarge - - r6g.2xlarge - - d2.2xlarge - - m6i.2xlarge - - m8g.2xlarge - - x8g.2xlarge - - m6id.2xlarge - - c5ad.2xlarge - - r5dn.2xlarge - - r5ad.2xlarge - - g4ad.2xlarge - - is4gen.2xlarge - - im4gn.2xlarge - - x2iezn.2xlarge - - i3.2xlarge - - c6g.2xlarge - - m5ad.2xlarge - - c7i.2xlarge - - m7i-flex.2xlarge - - t2.2xlarge - - c5a.2xlarge - - i4i.2xlarge - - x2iedn.2xlarge - - r6gd.2xlarge - - c6gn.2xlarge - - c7i-flex.2xlarge - - m5d.2xlarge - - mac2.metal - - c7g.2xlarge - - x2gd.2xlarge - - g4dn.2xlarge - - i4g.2xlarge - - m7i.2xlarge - - g6e.2xlarge - - c6in.2xlarge - - c1.xlarge - - h1.2xlarge - - p3.2xlarge - - g5g.2xlarge - - m5n.2xlarge - - r6in.2xlarge - - d3.2xlarge - - r3.2xlarge - - inf1.2xlarge - - r7i.2xlarge - - f1.2xlarge - - c6a.2xlarge - - g5.2xlarge - - c5.xlarge - - m5dn.xlarge - - d3en.xlarge - - r5ad.xlarge - - r6gd.xlarge - - c7i.xlarge - - c5ad.xlarge - - t3a.xlarge - - c5d.xlarge - - r5a.xlarge - - r5dn.xlarge - - m6idn.xlarge - - r7a.xlarge - - i3en.xlarge - - g6.xlarge - - g4dn.xlarge - - m6i.xlarge - - m1.xlarge - - c6gn.xlarge - - m6id.xlarge - - d2.xlarge - - g6e.xlarge - - r5n.xlarge - - r6id.xlarge - - m7i.xlarge - - a1.xlarge - - r3.xlarge - - r5.xlarge - - d3.xlarge - - g4ad.xlarge - - m5d.xlarge - - g5g.xlarge - - r7iz.xlarge - - x1e.xlarge - - r8g.xlarge - - m7gd.xlarge - - c4.xlarge - - g5.xlarge - - r4.xlarge - - i4g.xlarge - - t4g.xlarge - - c7i-flex.xlarge - - m7i-flex.xlarge - - i3.xlarge - - x2iedn.xlarge - - c7gd.xlarge - - c5a.xlarge - - m5ad.xlarge - - inf1.xlarge - - is4gen.xlarge - - r7g.xlarge - - z1d.xlarge - - m5n.xlarge - - c6in.xlarge - - m7g.xlarge - - c6i.xlarge - - r6g.xlarge - - r5b.xlarge - - m3.xlarge - - x2gd.xlarge - - c6id.xlarge - - r6idn.xlarge - - c6gd.xlarge - - c7gn.xlarge - - m5a.xlarge - - r6i.xlarge - - m7a.xlarge - - t2.xlarge - - r7i.xlarge - - m6g.xlarge - - m4.xlarge - - i2.xlarge - - r7gd.xlarge - - inf2.xlarge - - r5d.xlarge - - g3s.xlarge - - x8g.xlarge - - r6a.xlarge - - m5zn.xlarge - - c5n.xlarge - - p2.xlarge - - m2.2xlarge - - m6gd.xlarge - - r6in.xlarge - - m6a.xlarge - - c3.xlarge - - t3.xlarge - - c7a.xlarge - - c6a.xlarge - - m5.xlarge - - im4gn.xlarge - - m6in.xlarge - - i4i.xlarge - - m8g.xlarge - - c7g.xlarge - - c6g.xlarge - - c8g.xlarge - - r6g.large - - c7gd.large - - c6in.large - - r5a.large - - r5d.large - - t3a.small - - m7a.large - - c6gn.large - - t4g.medium - - i3en.large - - t3a.medium - - i4g.large - - r4.large - - m6a.large - - m1.large - - r7a.large - - t3.medium - - m7gd.large - - m6id.large - - t4g.large - - r5ad.large - - c5.large - - t3.large - - m7i.large - - r7i.large - - t3a.micro - - m6in.large - - t3.micro - - t4g.micro - - t3a.large - - i4i.large - - t4g.small - - m2.xlarge - - m6idn.large - - m5dn.large - - c6gd.large - - m6gd.large - - r6in.large - - m5d.large - - r3.large - - c6i.large - - m5n.large - - im4gn.large - - m5.large - - c6id.large - - c7i-flex.large - - r7g.large - - i3.large - - r6id.large - - c5d.large - - a1.large - - t2.medium - - is4gen.large - - c5ad.large - - r7iz.large - - c7g.large - - r5dn.large - - m5a.large - - t3.nano - - x2gd.large - - t3a.nano - - c7i.large - - r5n.large - - c1.medium - - m6g.large - - m3.large - - c6g.large - - c7gn.large - - t4g.nano - - r5.large - - m4.large - - m5zn.large - - t3.small - - r5b.large - - m7i-flex.large - - r7gd.large - - c8g.large - - m6i.large - - m7g.large - - r6a.large - - z1d.large - - r6idn.large - - m8g.large - - c5a.large - - t2.large - - r8g.large - - c3.large - - c4.large - - c7a.large - - x8g.large - - r6gd.large - - c5n.large - - r6i.large - - c6a.large - - m5ad.large - - c7gn.medium - - m3.medium - - c8g.medium - - is4gen.medium - - x2gd.medium - - c6gd.medium - - m6g.medium - - c7gd.medium - - t1.micro - - r7gd.medium - - t2.micro - - m8g.medium - - x8g.medium - - m1.small - - m7g.medium - - c7a.medium - - c6gn.medium - - t2.small - - t2.nano - - c6g.medium - - r7g.medium - - m6gd.medium - - m7gd.medium - - r8g.medium - - c7g.medium - - m7a.medium - - m1.medium - - r6gd.medium - - r6g.medium - - r7a.medium - - a1.medium + - u7in-24tb.224xlarge + - u7in-32tb.224xlarge + - u7in-16tb.224xlarge + - u7i-12tb.224xlarge + - u-6tb1.112xlarge + - u-18tb1.112xlarge + - u-12tb1.112xlarge + - u-24tb1.112xlarge + - u-9tb1.112xlarge + - u-3tb1.56xlarge + - u-6tb1.56xlarge + - r7a.48xlarge + - c7a.48xlarge + - c8g.48xlarge + - r6a.metal + - r8g.metal-48xl + - g6e.48xlarge + - r6a.48xlarge + - c6a.metal + - m8g.metal-48xl + - r7i.metal-48xl + - c7a.metal-48xl + - c6a.48xlarge + - c8g.metal-48xl + - m7a.metal-48xl + - m8g.48xlarge + - x8g.48xlarge + - m6a.48xlarge + - c7i.48xlarge + - g6.48xlarge + - inf2.48xlarge + - r7i.48xlarge + - m6a.metal + - c7i.metal-48xl + - m7i.metal-48xl + - p5.48xlarge + - r7a.metal-48xl + - m7i.48xlarge + - m7a.48xlarge + - g5.48xlarge + - x8g.metal-48xl + - r8g.48xlarge + - r6in.metal + - r7iz.32xlarge + - m6a.32xlarge + - m6i.32xlarge + - r6i.32xlarge + - r6a.32xlarge + - c7a.32xlarge + - r6id.metal + - x1e.32xlarge + - trn1.32xlarge + - c6id.metal + - x2idn.32xlarge + - x1.32xlarge + - r7a.32xlarge + - c6in.32xlarge + - c6i.metal + - x2iedn.metal + - m6in.metal + - m6idn.metal + - m6id.metal + - m6in.32xlarge + - i4i.metal + - r6i.metal + - x2iedn.32xlarge + - c6id.32xlarge + - m6i.metal + - x2idn.metal + - trn1n.32xlarge + - m6idn.32xlarge + - i4i.32xlarge + - m7a.32xlarge + - r7iz.metal-32xl + - c6a.32xlarge + - m6id.32xlarge + - r6id.32xlarge + - r6idn.metal + - r6in.32xlarge + - r6idn.32xlarge + - c6in.metal + - c6i.32xlarge + - m5d.metal + - r6id.24xlarge + - c5d.24xlarge + - vt1.24xlarge + - r6in.24xlarge + - inf1.24xlarge + - r5.metal + - i3en.metal + - r7i.24xlarge + - m6a.24xlarge + - c6in.24xlarge + - c5ad.24xlarge + - c7i.metal-24xl + - c6a.24xlarge + - r5dn.metal + - r5b.24xlarge + - m5dn.24xlarge + - g6e.24xlarge + - r8g.metal-24xl + - m8g.24xlarge + - r8g.24xlarge + - r7i.metal-24xl + - i3en.24xlarge + - r5n.metal + - c6id.24xlarge + - m6in.24xlarge + - m5n.24xlarge + - m7i.metal-24xl + - g4dn.metal + - r5dn.24xlarge + - r5a.24xlarge + - c5.24xlarge + - r6i.24xlarge + - dl1.24xlarge + - x2iedn.24xlarge + - r6idn.24xlarge + - r5.24xlarge + - r5d.metal + - g6.24xlarge + - c5d.metal + - inf2.24xlarge + - c5a.24xlarge + - m8g.metal-24xl + - r5n.24xlarge + - m5n.metal + - m5.metal + - c8g.24xlarge + - c5.metal + - m5d.24xlarge + - p4d.24xlarge + - c6i.24xlarge + - m7i.24xlarge + - r7a.24xlarge + - x8g.24xlarge + - x2idn.24xlarge + - c7i.24xlarge + - r5d.24xlarge + - x8g.metal-24xl + - m6i.24xlarge + - m5.24xlarge + - g5.24xlarge + - m5dn.metal + - c7a.24xlarge + - i4i.24xlarge + - r5b.metal + - m7a.24xlarge + - r5ad.24xlarge + - m6idn.24xlarge + - p3dn.24xlarge + - m6id.24xlarge + - c8g.metal-24xl + - m5a.24xlarge + - r6a.24xlarge + - m5ad.24xlarge + - i3.metal + - c5n.metal + - c5d.18xlarge + - c5n.18xlarge + - c5.18xlarge + - r8g.16xlarge + - g4ad.16xlarge + - c6a.16xlarge + - i3.16xlarge + - m6g.16xlarge + - r5dn.16xlarge + - m5.16xlarge + - r6a.16xlarge + - r7iz.16xlarge + - m6i.16xlarge + - c6gd.16xlarge + - x1e.16xlarge + - c7gn.16xlarge + - r4.16xlarge + - r5n.16xlarge + - m7gd.16xlarge + - c8g.16xlarge + - c6g.16xlarge + - x2gd.16xlarge + - c7a.16xlarge + - c7g.metal + - m5dn.16xlarge + - c5a.16xlarge + - m6id.16xlarge + - c6gn.16xlarge + - m6a.16xlarge + - c6id.16xlarge + - c7gd.metal + - g3.16xlarge + - x2iedn.16xlarge + - x2idn.16xlarge + - m6gd.16xlarge + - x1.16xlarge + - c6i.16xlarge + - m7g.16xlarge + - g5g.16xlarge + - r5ad.16xlarge + - c6g.metal + - c6in.16xlarge + - c7i.16xlarge + - m7g.metal + - m6g.metal + - c7g.16xlarge + - r6i.16xlarge + - g5g.metal + - m6in.16xlarge + - r5b.16xlarge + - g6e.16xlarge + - m6gd.metal + - f1.16xlarge + - r7a.16xlarge + - g5.16xlarge + - r6in.16xlarge + - i4g.16xlarge + - m7i.16xlarge + - r7iz.metal-16xl + - r7i.16xlarge + - x2gd.metal + - r7gd.metal + - m5n.16xlarge + - g6.16xlarge + - c7gd.16xlarge + - m7a.16xlarge + - r5d.16xlarge + - m6idn.16xlarge + - c7gn.metal + - x8g.16xlarge + - m5d.16xlarge + - r5a.16xlarge + - p2.16xlarge + - hpc7g.16xlarge + - r6id.16xlarge + - g4dn.16xlarge + - r7gd.16xlarge + - r7g.metal + - m4.16xlarge + - r6gd.metal + - r7g.16xlarge + - r5.16xlarge + - r6g.16xlarge + - c6gd.metal + - im4gn.16xlarge + - c5ad.16xlarge + - p3.16xlarge + - r6idn.16xlarge + - i4i.16xlarge + - r6gd.16xlarge + - m7gd.metal + - r6g.metal + - h1.16xlarge + - m5a.16xlarge + - m5ad.16xlarge + - m8g.16xlarge + - r5a.12xlarge + - m6g.12xlarge + - x2gd.12xlarge + - d3en.12xlarge + - r6id.12xlarge + - x2iezn.metal + - c5d.12xlarge + - r5n.12xlarge + - r7gd.12xlarge + - m5d.12xlarge + - c6i.12xlarge + - c6id.12xlarge + - m7gd.12xlarge + - m7g.12xlarge + - c8g.12xlarge + - i3en.12xlarge + - i4i.12xlarge + - g4dn.12xlarge + - c7g.12xlarge + - m7i.12xlarge + - c5a.12xlarge + - g6.12xlarge + - r6idn.12xlarge + - r6in.12xlarge + - r5.12xlarge + - m5zn.metal + - c7gn.12xlarge + - r7iz.12xlarge + - m6idn.12xlarge + - c6g.12xlarge + - r7g.12xlarge + - c6in.12xlarge + - m5zn.12xlarge + - x2iezn.12xlarge + - r6a.12xlarge + - m8g.12xlarge + - z1d.metal + - c6gd.12xlarge + - m6a.12xlarge + - m6in.12xlarge + - x8g.12xlarge + - r5b.12xlarge + - m6id.12xlarge + - r5ad.12xlarge + - z1d.12xlarge + - r6gd.12xlarge + - m6i.12xlarge + - g5.12xlarge + - m6gd.12xlarge + - c6gn.12xlarge + - c5.12xlarge + - r8g.12xlarge + - m5ad.12xlarge + - r6g.12xlarge + - m7a.12xlarge + - r6i.12xlarge + - c7gd.12xlarge + - m5a.12xlarge + - c6a.12xlarge + - r5dn.12xlarge + - m5n.12xlarge + - g6e.12xlarge + - r5d.12xlarge + - m5dn.12xlarge + - c5ad.12xlarge + - r7i.12xlarge + - c7a.12xlarge + - r7a.12xlarge + - m5.12xlarge + - c7i.12xlarge + - m4.10xlarge + - d2.8xlarge + - c5d.9xlarge + - c4.8xlarge + - c5n.9xlarge + - c5.9xlarge + - h1.8xlarge + - x8g.8xlarge + - c7a.8xlarge + - m7a.8xlarge + - r7iz.8xlarge + - r8g.8xlarge + - x2gd.8xlarge + - r6in.8xlarge + - m6idn.8xlarge + - r5d.8xlarge + - c8g.8xlarge + - r6i.8xlarge + - g4dn.8xlarge + - m6g.8xlarge + - c7i.8xlarge + - r7i.8xlarge + - r6id.8xlarge + - c7g.8xlarge + - c3.8xlarge + - r6idn.8xlarge + - i3.8xlarge + - c6id.8xlarge + - is4gen.8xlarge + - r5dn.8xlarge + - g6e.8xlarge + - r6g.8xlarge + - m6gd.8xlarge + - c6g.8xlarge + - m7i-flex.8xlarge + - c6a.8xlarge + - m7i.8xlarge + - p3.8xlarge + - d3.8xlarge + - r6a.8xlarge + - g5.8xlarge + - i4i.8xlarge + - m5dn.8xlarge + - m7g.8xlarge + - m5n.8xlarge + - x1e.8xlarge + - g5g.8xlarge + - r5n.8xlarge + - c6in.8xlarge + - c7gd.8xlarge + - m8g.8xlarge + - c6gd.8xlarge + - r7gd.8xlarge + - im4gn.8xlarge + - c7i-flex.8xlarge + - m7gd.8xlarge + - m6a.8xlarge + - c7gn.8xlarge + - r5b.8xlarge + - r6gd.8xlarge + - m6i.8xlarge + - r4.8xlarge + - c6i.8xlarge + - c5a.8xlarge + - c6gn.8xlarge + - r7a.8xlarge + - gr6.8xlarge + - g3.8xlarge + - g4ad.8xlarge + - r5a.8xlarge + - m5.8xlarge + - inf2.8xlarge + - m6in.8xlarge + - m5ad.8xlarge + - d3en.8xlarge + - g6.8xlarge + - x2iezn.8xlarge + - x2iedn.8xlarge + - i2.8xlarge + - r5ad.8xlarge + - m5d.8xlarge + - i4g.8xlarge + - p2.8xlarge + - r7g.8xlarge + - hpc7g.8xlarge + - m6id.8xlarge + - r5.8xlarge + - r3.8xlarge + - c5ad.8xlarge + - m5a.8xlarge + - d3en.6xlarge + - inf1.6xlarge + - vt1.6xlarge + - i3en.6xlarge + - x2iezn.6xlarge + - z1d.6xlarge + - m5zn.6xlarge + - mac2-m1ultra.metal + - g4dn.4xlarge + - c5.4xlarge + - r5n.4xlarge + - c6gn.4xlarge + - x8g.4xlarge + - r7gd.4xlarge + - m6idn.4xlarge + - c8g.4xlarge + - m7g.4xlarge + - m5.4xlarge + - c5n.4xlarge + - i3.4xlarge + - r8g.4xlarge + - h1.4xlarge + - c7a.4xlarge + - i2.4xlarge + - c6a.4xlarge + - g5.4xlarge + - c4.4xlarge + - g6.4xlarge + - m5d.4xlarge + - c7i-flex.4xlarge + - c6i.4xlarge + - m6g.4xlarge + - r6i.4xlarge + - d2.4xlarge + - r7i.4xlarge + - c5ad.4xlarge + - m6gd.4xlarge + - r7a.4xlarge + - r3.4xlarge + - x2gd.4xlarge + - x1e.4xlarge + - m5ad.4xlarge + - g4ad.4xlarge + - hpc7g.4xlarge + - r5dn.4xlarge + - c6gd.4xlarge + - r6in.4xlarge + - is4gen.4xlarge + - r6a.4xlarge + - c6g.4xlarge + - m6i.4xlarge + - i4g.4xlarge + - m5a.4xlarge + - x2iezn.4xlarge + - m7i-flex.4xlarge + - m6a.4xlarge + - m6in.4xlarge + - x2iedn.4xlarge + - gr6.4xlarge + - i4i.4xlarge + - im4gn.4xlarge + - c7i.4xlarge + - m5dn.4xlarge + - r6id.4xlarge + - c7gd.4xlarge + - r7iz.4xlarge + - m6id.4xlarge + - g5g.4xlarge + - r5d.4xlarge + - f1.4xlarge + - r5a.4xlarge + - c5d.4xlarge + - d3en.4xlarge + - r6g.4xlarge + - r6gd.4xlarge + - c6id.4xlarge + - m5n.4xlarge + - m8g.4xlarge + - m7a.4xlarge + - m7gd.4xlarge + - r7g.4xlarge + - r6idn.4xlarge + - r5b.4xlarge + - c6in.4xlarge + - c7g.4xlarge + - c5a.4xlarge + - c3.4xlarge + - g3.4xlarge + - c7gn.4xlarge + - r5ad.4xlarge + - a1.metal + - a1.4xlarge + - d3.4xlarge + - r5.4xlarge + - g6e.4xlarge + - r4.4xlarge + - m4.4xlarge + - m7i.4xlarge + - m5zn.3xlarge + - vt1.3xlarge + - i3en.3xlarge + - mac1.metal + - z1d.3xlarge + - mac2-m2pro.metal + - r7gd.2xlarge + - i3en.2xlarge + - m7g.2xlarge + - r6id.2xlarge + - r7a.2xlarge + - c3.2xlarge + - c7a.2xlarge + - r8g.2xlarge + - a1.2xlarge + - c5n.2xlarge + - m3.2xlarge + - m5a.2xlarge + - m2.4xlarge + - r6a.2xlarge + - r5b.2xlarge + - m5dn.2xlarge + - m6gd.2xlarge + - z1d.2xlarge + - m6g.2xlarge + - c6gd.2xlarge + - c7gd.2xlarge + - t4g.2xlarge + - m5.2xlarge + - m4.2xlarge + - r4.2xlarge + - i2.2xlarge + - m5zn.2xlarge + - r5.2xlarge + - m7a.2xlarge + - x1e.2xlarge + - m6idn.2xlarge + - m6a.2xlarge + - c4.2xlarge + - r6idn.2xlarge + - r5n.2xlarge + - r7g.2xlarge + - mac2-m2.metal + - r5a.2xlarge + - m7gd.2xlarge + - m6in.2xlarge + - c7gn.2xlarge + - g6.2xlarge + - c5.2xlarge + - c5d.2xlarge + - c8g.2xlarge + - r6i.2xlarge + - t3.2xlarge + - trn1.2xlarge + - r5d.2xlarge + - c6id.2xlarge + - c6i.2xlarge + - r7iz.2xlarge + - t3a.2xlarge + - d3en.2xlarge + - r6g.2xlarge + - d2.2xlarge + - m6i.2xlarge + - m8g.2xlarge + - x8g.2xlarge + - m6id.2xlarge + - c5ad.2xlarge + - r5dn.2xlarge + - r5ad.2xlarge + - g4ad.2xlarge + - is4gen.2xlarge + - im4gn.2xlarge + - x2iezn.2xlarge + - i3.2xlarge + - c6g.2xlarge + - m5ad.2xlarge + - c7i.2xlarge + - m7i-flex.2xlarge + - t2.2xlarge + - c5a.2xlarge + - i4i.2xlarge + - x2iedn.2xlarge + - r6gd.2xlarge + - c6gn.2xlarge + - c7i-flex.2xlarge + - m5d.2xlarge + - mac2.metal + - c7g.2xlarge + - x2gd.2xlarge + - g4dn.2xlarge + - i4g.2xlarge + - m7i.2xlarge + - g6e.2xlarge + - c6in.2xlarge + - c1.xlarge + - h1.2xlarge + - p3.2xlarge + - g5g.2xlarge + - m5n.2xlarge + - r6in.2xlarge + - d3.2xlarge + - r3.2xlarge + - inf1.2xlarge + - r7i.2xlarge + - f1.2xlarge + - c6a.2xlarge + - g5.2xlarge + - c5.xlarge + - m5dn.xlarge + - d3en.xlarge + - r5ad.xlarge + - r6gd.xlarge + - c7i.xlarge + - c5ad.xlarge + - t3a.xlarge + - c5d.xlarge + - r5a.xlarge + - r5dn.xlarge + - m6idn.xlarge + - r7a.xlarge + - i3en.xlarge + - g6.xlarge + - g4dn.xlarge + - m6i.xlarge + - m1.xlarge + - c6gn.xlarge + - m6id.xlarge + - d2.xlarge + - g6e.xlarge + - r5n.xlarge + - r6id.xlarge + - m7i.xlarge + - a1.xlarge + - r3.xlarge + - r5.xlarge + - d3.xlarge + - g4ad.xlarge + - m5d.xlarge + - g5g.xlarge + - r7iz.xlarge + - x1e.xlarge + - r8g.xlarge + - m7gd.xlarge + - c4.xlarge + - g5.xlarge + - r4.xlarge + - i4g.xlarge + - t4g.xlarge + - c7i-flex.xlarge + - m7i-flex.xlarge + - i3.xlarge + - x2iedn.xlarge + - c7gd.xlarge + - c5a.xlarge + - m5ad.xlarge + - inf1.xlarge + - is4gen.xlarge + - r7g.xlarge + - z1d.xlarge + - m5n.xlarge + - c6in.xlarge + - m7g.xlarge + - c6i.xlarge + - r6g.xlarge + - r5b.xlarge + - m3.xlarge + - x2gd.xlarge + - c6id.xlarge + - r6idn.xlarge + - c6gd.xlarge + - c7gn.xlarge + - m5a.xlarge + - r6i.xlarge + - m7a.xlarge + - t2.xlarge + - r7i.xlarge + - m6g.xlarge + - m4.xlarge + - i2.xlarge + - r7gd.xlarge + - inf2.xlarge + - r5d.xlarge + - g3s.xlarge + - x8g.xlarge + - r6a.xlarge + - m5zn.xlarge + - c5n.xlarge + - p2.xlarge + - m2.2xlarge + - m6gd.xlarge + - r6in.xlarge + - m6a.xlarge + - c3.xlarge + - t3.xlarge + - c7a.xlarge + - c6a.xlarge + - m5.xlarge + - im4gn.xlarge + - m6in.xlarge + - i4i.xlarge + - m8g.xlarge + - c7g.xlarge + - c6g.xlarge + - c8g.xlarge + - r6g.large + - c7gd.large + - c6in.large + - r5a.large + - r5d.large + - t3a.small + - m7a.large + - c6gn.large + - t4g.medium + - i3en.large + - t3a.medium + - i4g.large + - r4.large + - m6a.large + - m1.large + - r7a.large + - t3.medium + - m7gd.large + - m6id.large + - t4g.large + - r5ad.large + - c5.large + - t3.large + - m7i.large + - r7i.large + - t3a.micro + - m6in.large + - t3.micro + - t4g.micro + - t3a.large + - i4i.large + - t4g.small + - m2.xlarge + - m6idn.large + - m5dn.large + - c6gd.large + - m6gd.large + - r6in.large + - m5d.large + - r3.large + - c6i.large + - m5n.large + - im4gn.large + - m5.large + - c6id.large + - c7i-flex.large + - r7g.large + - i3.large + - r6id.large + - c5d.large + - a1.large + - t2.medium + - is4gen.large + - c5ad.large + - r7iz.large + - c7g.large + - r5dn.large + - m5a.large + - t3.nano + - x2gd.large + - t3a.nano + - c7i.large + - r5n.large + - c1.medium + - m6g.large + - m3.large + - c6g.large + - c7gn.large + - t4g.nano + - r5.large + - m4.large + - m5zn.large + - t3.small + - r5b.large + - m7i-flex.large + - r7gd.large + - c8g.large + - m6i.large + - m7g.large + - r6a.large + - z1d.large + - r6idn.large + - m8g.large + - c5a.large + - t2.large + - r8g.large + - c3.large + - c4.large + - c7a.large + - x8g.large + - r6gd.large + - c5n.large + - r6i.large + - c6a.large + - m5ad.large + - c7gn.medium + - m3.medium + - c8g.medium + - is4gen.medium + - x2gd.medium + - c6gd.medium + - m6g.medium + - c7gd.medium + - t1.micro + - r7gd.medium + - t2.micro + - m8g.medium + - x8g.medium + - m1.small + - m7g.medium + - c7a.medium + - c6gn.medium + - t2.small + - t2.nano + - c6g.medium + - r7g.medium + - m6gd.medium + - m7gd.medium + - r8g.medium + - c7g.medium + - m7a.medium + - m1.medium + - r6gd.medium + - r6g.medium + - r7a.medium + - a1.medium us-east-2: - - u-9tb1.112xlarge - - u-12tb1.112xlarge - - u-6tb1.112xlarge - - u-6tb1.56xlarge - - u-3tb1.56xlarge - - c7a.48xlarge - - m7i.metal-48xl - - g6e.48xlarge - - c6a.48xlarge - - m7a.48xlarge - - c7i.metal-48xl - - r7i.48xlarge - - m7a.metal-48xl - - p5e.48xlarge - - r7i.metal-48xl - - inf2.48xlarge - - r7a.metal-48xl - - c6a.metal - - p5.48xlarge - - r8g.metal-48xl - - c7a.metal-48xl - - c7i.48xlarge - - r8g.48xlarge - - r6a.48xlarge - - m8g.metal-48xl - - m8g.48xlarge - - m6a.metal - - r6a.metal - - c8g.48xlarge - - c8g.metal-48xl - - m7i.48xlarge - - r7a.48xlarge - - m6a.48xlarge - - g5.48xlarge - - hpc7a.96xlarge - - g6.48xlarge - - m6i.32xlarge - - m6id.metal - - r6in.metal - - x2iedn.metal - - c6id.metal - - trn1.32xlarge - - r6idn.metal - - r6i.metal - - m7a.32xlarge - - r6a.32xlarge - - m6in.32xlarge - - r6id.32xlarge - - i4i.metal - - c7a.32xlarge - - m6i.metal - - r6idn.32xlarge - - m6in.metal - - x2idn.32xlarge - - m6idn.metal - - c6in.metal - - m6idn.32xlarge - - r6id.metal - - m6a.32xlarge - - c6a.32xlarge - - x1.32xlarge - - c6id.32xlarge - - x2idn.metal - - r7a.32xlarge - - c6i.metal - - c6i.32xlarge - - x2iedn.32xlarge - - r7iz.metal-32xl - - m6id.32xlarge - - r6i.32xlarge - - i4i.32xlarge - - trn1n.32xlarge - - r6in.32xlarge - - c6in.32xlarge - - x1e.32xlarge - - r7iz.32xlarge - - r5d.metal - - m6idn.24xlarge - - m5d.metal - - m7i.metal-24xl - - m5.metal - - c7i.metal-24xl - - g6.24xlarge - - r5n.24xlarge - - c5ad.24xlarge - - i3en.24xlarge - - c6i.24xlarge - - inf1.24xlarge - - r5b.metal - - r8g.metal-24xl - - hpc6a.48xlarge - - m8g.metal-24xl - - r6a.24xlarge - - m5n.24xlarge - - g5.24xlarge - - hpc7a.48xlarge - - r5a.24xlarge - - m5dn.24xlarge - - x2iedn.24xlarge - - r5.24xlarge - - m7a.24xlarge - - m6id.24xlarge - - g6e.24xlarge - - r6i.24xlarge - - x2idn.24xlarge - - c5.24xlarge - - g4dn.metal - - m6i.24xlarge - - m6a.24xlarge - - r7i.24xlarge - - r5ad.24xlarge - - c5a.24xlarge - - inf2.24xlarge - - r5dn.24xlarge - - r7a.24xlarge - - m7i.24xlarge - - c5d.metal - - m5a.24xlarge - - m5d.24xlarge - - r5dn.metal - - r5d.24xlarge - - m5n.metal - - c5d.24xlarge - - c8g.metal-24xl - - c6id.24xlarge - - r7i.metal-24xl - - c7a.24xlarge - - r6in.24xlarge - - m8g.24xlarge - - c6in.24xlarge - - i4i.24xlarge - - r5n.metal - - m5dn.metal - - r6idn.24xlarge - - c5.metal - - c7i.24xlarge - - r5.metal - - m5ad.24xlarge - - c8g.24xlarge - - m6in.24xlarge - - c6a.24xlarge - - p4d.24xlarge - - i3en.metal - - r8g.24xlarge - - r5b.24xlarge - - m5.24xlarge - - r6id.24xlarge - - c5.18xlarge - - c5n.metal - - i3.metal - - c5d.18xlarge - - c5n.18xlarge - - g6e.16xlarge - - i4i.16xlarge - - c8g.16xlarge - - r6i.16xlarge - - x2idn.16xlarge - - im4gn.16xlarge - - r7a.16xlarge - - r5.16xlarge - - g5.16xlarge - - m6gd.16xlarge - - m4.16xlarge - - p2.16xlarge - - p3.16xlarge - - g4ad.16xlarge - - i3.16xlarge - - x1.16xlarge - - c6gn.16xlarge - - c6i.16xlarge - - m6a.16xlarge - - c7gn.metal - - hpc6id.32xlarge - - c6g.metal - - m6idn.16xlarge - - c6gd.16xlarge - - c6g.16xlarge - - g3.16xlarge - - m7g.16xlarge - - h1.16xlarge - - x2gd.16xlarge - - r5ad.16xlarge - - m6id.16xlarge - - r5n.16xlarge - - c7g.16xlarge - - c7gd.16xlarge - - r5a.16xlarge - - c5a.16xlarge - - r6g.16xlarge - - r7g.16xlarge - - m7i.16xlarge - - m7gd.16xlarge - - c7g.metal - - m6i.16xlarge - - m6in.16xlarge - - m8g.16xlarge - - r6gd.16xlarge - - g4dn.16xlarge - - r7gd.metal - - r4.16xlarge - - i4g.16xlarge - - c6a.16xlarge - - c7i.16xlarge - - c6in.16xlarge - - m6gd.metal - - r7iz.16xlarge - - c7gd.metal - - m7g.metal - - r6in.16xlarge - - m5d.16xlarge - - x1e.16xlarge - - r5d.16xlarge - - r6id.16xlarge - - r6idn.16xlarge - - m7a.16xlarge - - m5n.16xlarge - - m5dn.16xlarge - - m6g.metal - - c6id.16xlarge - - r6g.metal - - m6g.16xlarge - - x2gd.metal - - m5.16xlarge - - c7gn.16xlarge - - r7gd.16xlarge - - c5ad.16xlarge - - x2iedn.16xlarge - - r7g.metal - - c6gd.metal - - r5dn.16xlarge - - r6gd.metal - - r8g.16xlarge - - m5a.16xlarge - - r7iz.metal-16xl - - m5ad.16xlarge - - m7gd.metal - - g6.16xlarge - - r5b.16xlarge - - r6a.16xlarge - - r7i.16xlarge - - c7a.16xlarge - - c7g.12xlarge - - r5a.12xlarge - - m5n.12xlarge - - c6i.12xlarge - - m6gd.12xlarge - - m5a.12xlarge - - i3en.12xlarge - - m5ad.12xlarge - - r6g.12xlarge - - r5.12xlarge - - r7g.12xlarge - - c7a.12xlarge - - m6in.12xlarge - - g6e.12xlarge - - c6a.12xlarge - - g5.12xlarge - - r5d.12xlarge - - m6i.12xlarge - - r5dn.12xlarge - - m7a.12xlarge - - r7i.12xlarge - - m7gd.12xlarge - - c7gn.12xlarge - - r7a.12xlarge - - r5n.12xlarge - - m5dn.12xlarge - - r6a.12xlarge - - m5d.12xlarge - - r6id.12xlarge - - r5b.12xlarge - - c6g.12xlarge - - hpc7a.24xlarge - - m5zn.12xlarge - - c5a.12xlarge - - c8g.12xlarge - - g4dn.12xlarge - - r8g.12xlarge - - m5zn.metal - - i4i.12xlarge - - r5ad.12xlarge - - m6idn.12xlarge - - z1d.12xlarge - - m7i.12xlarge - - c5d.12xlarge - - m6a.12xlarge - - r6in.12xlarge - - c6gn.12xlarge - - m6g.12xlarge - - g6.12xlarge - - m7g.12xlarge - - c5ad.12xlarge - - r6idn.12xlarge - - c7gd.12xlarge - - r7iz.12xlarge - - r6gd.12xlarge - - r6i.12xlarge - - x2gd.12xlarge - - c5.12xlarge - - r7gd.12xlarge - - m5.12xlarge - - c6in.12xlarge - - c6id.12xlarge - - m8g.12xlarge - - c6gd.12xlarge - - c7i.12xlarge - - z1d.metal - - m6id.12xlarge - - m4.10xlarge - - c5d.9xlarge - - c5n.9xlarge - - d2.8xlarge - - c4.8xlarge - - c5.9xlarge - - g5.8xlarge - - r5n.8xlarge - - c6id.8xlarge - - p3.8xlarge - - r7i.8xlarge - - c6i.8xlarge - - x2iedn.8xlarge - - m6id.8xlarge - - r7g.8xlarge - - m6g.8xlarge - - m8g.8xlarge - - m6a.8xlarge - - c6gn.8xlarge - - i3.8xlarge - - c8g.8xlarge - - r6idn.8xlarge - - m5a.8xlarge - - c7gn.8xlarge - - r8g.8xlarge - - i4g.8xlarge - - m7i.8xlarge - - g4ad.8xlarge - - r5b.8xlarge - - r7gd.8xlarge - - r7a.8xlarge - - m5.8xlarge - - c6in.8xlarge - - is4gen.8xlarge - - r5a.8xlarge - - c7a.8xlarge - - i2.8xlarge - - m7i-flex.8xlarge - - r3.8xlarge - - c5ad.8xlarge - - gr6.8xlarge - - c5a.8xlarge - - inf2.8xlarge - - m7g.8xlarge - - p2.8xlarge - - m5n.8xlarge - - x2gd.8xlarge - - m6gd.8xlarge - - im4gn.8xlarge - - r6g.8xlarge - - d3.8xlarge - - m5dn.8xlarge - - g3.8xlarge - - i4i.8xlarge - - m6idn.8xlarge - - c6g.8xlarge - - r5ad.8xlarge - - r6a.8xlarge - - r6i.8xlarge - - m6i.8xlarge - - g6.8xlarge - - r6in.8xlarge - - g6e.8xlarge - - r6id.8xlarge - - h1.8xlarge - - c7gd.8xlarge - - c6a.8xlarge - - m5ad.8xlarge - - r5d.8xlarge - - c7i-flex.8xlarge - - m7gd.8xlarge - - c7i.8xlarge - - x1e.8xlarge - - m5d.8xlarge - - r5.8xlarge - - r4.8xlarge - - g4dn.8xlarge - - r5dn.8xlarge - - c7g.8xlarge - - m6in.8xlarge - - m7a.8xlarge - - c6gd.8xlarge - - r6gd.8xlarge - - r7iz.8xlarge - - inf1.6xlarge - - z1d.6xlarge - - m5zn.6xlarge - - i3en.6xlarge - - hpc7a.12xlarge - - r6gd.4xlarge - - m6id.4xlarge - - r5a.4xlarge - - r7g.4xlarge - - d2.4xlarge - - c7gd.4xlarge - - r5d.4xlarge - - c5.4xlarge - - g3.4xlarge - - r7gd.4xlarge - - r5dn.4xlarge - - r3.4xlarge - - r8g.4xlarge - - g6e.4xlarge - - gr6.4xlarge - - m6idn.4xlarge - - c7i-flex.4xlarge - - m7a.4xlarge - - c8g.4xlarge - - m4.4xlarge - - c7gn.4xlarge - - m5ad.4xlarge - - c5ad.4xlarge - - c7g.4xlarge - - c7i.4xlarge - - d3.4xlarge - - g6.4xlarge - - r5ad.4xlarge - - m7g.4xlarge - - m5a.4xlarge - - c5d.4xlarge - - x1e.4xlarge - - c6gd.4xlarge - - i3.4xlarge - - m6i.4xlarge - - c6g.4xlarge - - r7a.4xlarge - - r6a.4xlarge - - m7i.4xlarge - - c6i.4xlarge - - c6id.4xlarge - - g5.4xlarge - - g4dn.4xlarge - - m5n.4xlarge - - m7gd.4xlarge - - a1.metal - - r6id.4xlarge - - m5dn.4xlarge - - r5.4xlarge - - m5d.4xlarge - - m7i-flex.4xlarge - - g4ad.4xlarge - - r6i.4xlarge - - c5n.4xlarge - - c4.4xlarge - - r7i.4xlarge - - r6idn.4xlarge - - r6in.4xlarge - - x2gd.4xlarge - - c6gn.4xlarge - - a1.4xlarge - - m5.4xlarge - - i2.4xlarge - - m6gd.4xlarge - - im4gn.4xlarge - - m8g.4xlarge - - h1.4xlarge - - is4gen.4xlarge - - i4i.4xlarge - - c6in.4xlarge - - m6a.4xlarge - - r7iz.4xlarge - - r5b.4xlarge - - m6in.4xlarge - - r5n.4xlarge - - c5a.4xlarge - - c7a.4xlarge - - x2iedn.4xlarge - - m6g.4xlarge - - i4g.4xlarge - - c6a.4xlarge - - r6g.4xlarge - - r4.4xlarge - - mac2-m2pro.metal - - z1d.3xlarge - - i3en.3xlarge - - m5zn.3xlarge - - mac1.metal - - c7a.2xlarge - - t4g.2xlarge - - d3.2xlarge - - c6gn.2xlarge - - r6id.2xlarge - - m7i.2xlarge - - r5dn.2xlarge - - r6a.2xlarge - - r5ad.2xlarge - - c6i.2xlarge - - r7iz.2xlarge - - r5d.2xlarge - - c7g.2xlarge - - r5n.2xlarge - - m6g.2xlarge - - z1d.2xlarge - - i3.2xlarge - - r5b.2xlarge - - t3a.2xlarge - - i2.2xlarge - - r4.2xlarge - - c6in.2xlarge - - m7a.2xlarge - - m5dn.2xlarge - - c6gd.2xlarge - - x2gd.2xlarge - - m6i.2xlarge - - inf1.2xlarge - - m7i-flex.2xlarge - - r8g.2xlarge - - c7i-flex.2xlarge - - r7a.2xlarge - - m6in.2xlarge - - c7gn.2xlarge - - m5n.2xlarge - - m7g.2xlarge - - i4g.2xlarge - - c6g.2xlarge - - m6idn.2xlarge - - i4i.2xlarge - - m6gd.2xlarge - - r6g.2xlarge - - c6id.2xlarge - - c6a.2xlarge - - mac2.metal - - c5ad.2xlarge - - i3en.2xlarge - - g4ad.2xlarge - - c5a.2xlarge - - x2iedn.2xlarge - - m6a.2xlarge - - m5a.2xlarge - - g6e.2xlarge - - x1e.2xlarge - - c8g.2xlarge - - a1.2xlarge - - im4gn.2xlarge - - c7i.2xlarge - - g4dn.2xlarge - - r5a.2xlarge - - t3.2xlarge - - trn1.2xlarge - - g6.2xlarge - - m6id.2xlarge - - t2.2xlarge - - m5.2xlarge - - r3.2xlarge - - c5d.2xlarge - - m5zn.2xlarge - - r7gd.2xlarge - - r5.2xlarge - - h1.2xlarge - - r6idn.2xlarge - - r6i.2xlarge - - m8g.2xlarge - - r7g.2xlarge - - p3.2xlarge - - c4.2xlarge - - is4gen.2xlarge - - g5.2xlarge - - c5n.2xlarge - - m5ad.2xlarge - - r7i.2xlarge - - mac2-m2.metal - - m7gd.2xlarge - - r6in.2xlarge - - m5d.2xlarge - - r6gd.2xlarge - - c5.2xlarge - - m4.2xlarge - - d2.2xlarge - - c7gd.2xlarge - - r5ad.xlarge - - m6i.xlarge - - m6id.xlarge - - c6gn.xlarge - - r5dn.xlarge - - c5d.xlarge - - r5a.xlarge - - t3a.xlarge - - c5ad.xlarge - - m6in.xlarge - - c6g.xlarge - - r5d.xlarge - - m5.xlarge - - m7gd.xlarge - - r6a.xlarge - - r6gd.xlarge - - r8g.xlarge - - inf2.xlarge - - im4gn.xlarge - - r6in.xlarge - - d2.xlarge - - r7gd.xlarge - - m5a.xlarge - - c6i.xlarge - - r6id.xlarge - - r5n.xlarge - - i4i.xlarge - - g5.xlarge - - r7i.xlarge - - r5.xlarge - - i4g.xlarge - - m5dn.xlarge - - i2.xlarge - - m8g.xlarge - - c6a.xlarge - - m6g.xlarge - - d3.xlarge - - c8g.xlarge - - c6gd.xlarge - - g3s.xlarge - - z1d.xlarge - - c6in.xlarge - - r3.xlarge - - m6a.xlarge - - g4dn.xlarge - - g6.xlarge - - r7iz.xlarge - - m7i-flex.xlarge - - c5.xlarge - - m4.xlarge - - r7g.xlarge - - i3.xlarge - - r6g.xlarge - - c7g.xlarge - - m7a.xlarge - - c5n.xlarge - - c5a.xlarge - - p2.xlarge - - m5n.xlarge - - t3.xlarge - - m6gd.xlarge - - m6idn.xlarge - - r6idn.xlarge - - t4g.xlarge - - c7a.xlarge - - m5zn.xlarge - - a1.xlarge - - g6e.xlarge - - m5d.xlarge - - r7a.xlarge - - m5ad.xlarge - - r5b.xlarge - - r6i.xlarge - - r4.xlarge - - is4gen.xlarge - - x1e.xlarge - - g4ad.xlarge - - inf1.xlarge - - c7i.xlarge - - m7g.xlarge - - c4.xlarge - - t2.xlarge - - c7gn.xlarge - - m7i.xlarge - - x2iedn.xlarge - - c6id.xlarge - - c7i-flex.xlarge - - i3en.xlarge - - x2gd.xlarge - - c7gd.xlarge - - m5n.large - - i4i.large - - r4.large - - t3.small - - c7a.large - - m8g.large - - c5ad.large - - c7gn.large - - m6i.large - - m6id.large - - r8g.large - - im4gn.large - - r7g.large - - r7a.large - - m6a.large - - i3en.large - - m5ad.large - - r6i.large - - m5zn.large - - r5a.large - - m4.large - - c7gd.large - - r6a.large - - m5dn.large - - c6i.large - - t3a.nano - - r5n.large - - c5d.large - - t4g.large - - m7g.large - - r6g.large - - m7gd.large - - t3a.micro - - c5n.large - - m5a.large - - r6gd.large - - is4gen.large - - c7g.large - - c5a.large - - m7i-flex.large - - x2gd.large - - c7i.large - - c6g.large - - c6in.large - - t3.medium - - t4g.nano - - c5.large - - m7i.large - - r7gd.large - - r7i.large - - z1d.large - - m6gd.large - - i4g.large - - r5.large - - t4g.medium - - i3.large - - c6id.large - - t3a.large - - m6g.large - - c6gn.large - - t3a.small - - m5d.large - - t2.large - - c4.large - - c6a.large - - m6in.large - - r7iz.large - - r6in.large - - m6idn.large - - c6gd.large - - a1.large - - t2.medium - - t3.large - - m5.large - - r6id.large - - r5b.large - - r6idn.large - - r5d.large - - r5ad.large - - c7i-flex.large - - t3.micro - - r5dn.large - - t4g.micro - - c8g.large - - r3.large - - t4g.small - - t3.nano - - m7a.large - - t3a.medium - - t2.small - - x2gd.medium - - r7gd.medium - - m7gd.medium - - c7gd.medium - - t2.nano - - c8g.medium - - r7a.medium - - c7gn.medium - - m6g.medium - - m6gd.medium - - c7g.medium - - a1.medium - - m8g.medium - - r6gd.medium - - c6gn.medium - - t2.micro - - c6g.medium - - r8g.medium - - r6g.medium - - is4gen.medium - - c6gd.medium - - c7a.medium - - r7g.medium - - m7g.medium - - m7a.medium + - u-9tb1.112xlarge + - u-12tb1.112xlarge + - u-6tb1.112xlarge + - u-6tb1.56xlarge + - u-3tb1.56xlarge + - c7a.48xlarge + - m7i.metal-48xl + - g6e.48xlarge + - c6a.48xlarge + - m7a.48xlarge + - c7i.metal-48xl + - r7i.48xlarge + - m7a.metal-48xl + - p5e.48xlarge + - r7i.metal-48xl + - inf2.48xlarge + - r7a.metal-48xl + - c6a.metal + - p5.48xlarge + - r8g.metal-48xl + - c7a.metal-48xl + - c7i.48xlarge + - r8g.48xlarge + - r6a.48xlarge + - m8g.metal-48xl + - m8g.48xlarge + - m6a.metal + - r6a.metal + - c8g.48xlarge + - c8g.metal-48xl + - m7i.48xlarge + - r7a.48xlarge + - m6a.48xlarge + - g5.48xlarge + - hpc7a.96xlarge + - g6.48xlarge + - m6i.32xlarge + - m6id.metal + - r6in.metal + - x2iedn.metal + - c6id.metal + - trn1.32xlarge + - r6idn.metal + - r6i.metal + - m7a.32xlarge + - r6a.32xlarge + - m6in.32xlarge + - r6id.32xlarge + - i4i.metal + - c7a.32xlarge + - m6i.metal + - r6idn.32xlarge + - m6in.metal + - x2idn.32xlarge + - m6idn.metal + - c6in.metal + - m6idn.32xlarge + - r6id.metal + - m6a.32xlarge + - c6a.32xlarge + - x1.32xlarge + - c6id.32xlarge + - x2idn.metal + - r7a.32xlarge + - c6i.metal + - c6i.32xlarge + - x2iedn.32xlarge + - r7iz.metal-32xl + - m6id.32xlarge + - r6i.32xlarge + - i4i.32xlarge + - trn1n.32xlarge + - r6in.32xlarge + - c6in.32xlarge + - x1e.32xlarge + - r7iz.32xlarge + - r5d.metal + - m6idn.24xlarge + - m5d.metal + - m7i.metal-24xl + - m5.metal + - c7i.metal-24xl + - g6.24xlarge + - r5n.24xlarge + - c5ad.24xlarge + - i3en.24xlarge + - c6i.24xlarge + - inf1.24xlarge + - r5b.metal + - r8g.metal-24xl + - hpc6a.48xlarge + - m8g.metal-24xl + - r6a.24xlarge + - m5n.24xlarge + - g5.24xlarge + - hpc7a.48xlarge + - r5a.24xlarge + - m5dn.24xlarge + - x2iedn.24xlarge + - r5.24xlarge + - m7a.24xlarge + - m6id.24xlarge + - g6e.24xlarge + - r6i.24xlarge + - x2idn.24xlarge + - c5.24xlarge + - g4dn.metal + - m6i.24xlarge + - m6a.24xlarge + - r7i.24xlarge + - r5ad.24xlarge + - c5a.24xlarge + - inf2.24xlarge + - r5dn.24xlarge + - r7a.24xlarge + - m7i.24xlarge + - c5d.metal + - m5a.24xlarge + - m5d.24xlarge + - r5dn.metal + - r5d.24xlarge + - m5n.metal + - c5d.24xlarge + - c8g.metal-24xl + - c6id.24xlarge + - r7i.metal-24xl + - c7a.24xlarge + - r6in.24xlarge + - m8g.24xlarge + - c6in.24xlarge + - i4i.24xlarge + - r5n.metal + - m5dn.metal + - r6idn.24xlarge + - c5.metal + - c7i.24xlarge + - r5.metal + - m5ad.24xlarge + - c8g.24xlarge + - m6in.24xlarge + - c6a.24xlarge + - p4d.24xlarge + - i3en.metal + - r8g.24xlarge + - r5b.24xlarge + - m5.24xlarge + - r6id.24xlarge + - c5.18xlarge + - c5n.metal + - i3.metal + - c5d.18xlarge + - c5n.18xlarge + - g6e.16xlarge + - i4i.16xlarge + - c8g.16xlarge + - r6i.16xlarge + - x2idn.16xlarge + - im4gn.16xlarge + - r7a.16xlarge + - r5.16xlarge + - g5.16xlarge + - m6gd.16xlarge + - m4.16xlarge + - p2.16xlarge + - p3.16xlarge + - g4ad.16xlarge + - i3.16xlarge + - x1.16xlarge + - c6gn.16xlarge + - c6i.16xlarge + - m6a.16xlarge + - c7gn.metal + - hpc6id.32xlarge + - c6g.metal + - m6idn.16xlarge + - c6gd.16xlarge + - c6g.16xlarge + - g3.16xlarge + - m7g.16xlarge + - h1.16xlarge + - x2gd.16xlarge + - r5ad.16xlarge + - m6id.16xlarge + - r5n.16xlarge + - c7g.16xlarge + - c7gd.16xlarge + - r5a.16xlarge + - c5a.16xlarge + - r6g.16xlarge + - r7g.16xlarge + - m7i.16xlarge + - m7gd.16xlarge + - c7g.metal + - m6i.16xlarge + - m6in.16xlarge + - m8g.16xlarge + - r6gd.16xlarge + - g4dn.16xlarge + - r7gd.metal + - r4.16xlarge + - i4g.16xlarge + - c6a.16xlarge + - c7i.16xlarge + - c6in.16xlarge + - m6gd.metal + - r7iz.16xlarge + - c7gd.metal + - m7g.metal + - r6in.16xlarge + - m5d.16xlarge + - x1e.16xlarge + - r5d.16xlarge + - r6id.16xlarge + - r6idn.16xlarge + - m7a.16xlarge + - m5n.16xlarge + - m5dn.16xlarge + - m6g.metal + - c6id.16xlarge + - r6g.metal + - m6g.16xlarge + - x2gd.metal + - m5.16xlarge + - c7gn.16xlarge + - r7gd.16xlarge + - c5ad.16xlarge + - x2iedn.16xlarge + - r7g.metal + - c6gd.metal + - r5dn.16xlarge + - r6gd.metal + - r8g.16xlarge + - m5a.16xlarge + - r7iz.metal-16xl + - m5ad.16xlarge + - m7gd.metal + - g6.16xlarge + - r5b.16xlarge + - r6a.16xlarge + - r7i.16xlarge + - c7a.16xlarge + - c7g.12xlarge + - r5a.12xlarge + - m5n.12xlarge + - c6i.12xlarge + - m6gd.12xlarge + - m5a.12xlarge + - i3en.12xlarge + - m5ad.12xlarge + - r6g.12xlarge + - r5.12xlarge + - r7g.12xlarge + - c7a.12xlarge + - m6in.12xlarge + - g6e.12xlarge + - c6a.12xlarge + - g5.12xlarge + - r5d.12xlarge + - m6i.12xlarge + - r5dn.12xlarge + - m7a.12xlarge + - r7i.12xlarge + - m7gd.12xlarge + - c7gn.12xlarge + - r7a.12xlarge + - r5n.12xlarge + - m5dn.12xlarge + - r6a.12xlarge + - m5d.12xlarge + - r6id.12xlarge + - r5b.12xlarge + - c6g.12xlarge + - hpc7a.24xlarge + - m5zn.12xlarge + - c5a.12xlarge + - c8g.12xlarge + - g4dn.12xlarge + - r8g.12xlarge + - m5zn.metal + - i4i.12xlarge + - r5ad.12xlarge + - m6idn.12xlarge + - z1d.12xlarge + - m7i.12xlarge + - c5d.12xlarge + - m6a.12xlarge + - r6in.12xlarge + - c6gn.12xlarge + - m6g.12xlarge + - g6.12xlarge + - m7g.12xlarge + - c5ad.12xlarge + - r6idn.12xlarge + - c7gd.12xlarge + - r7iz.12xlarge + - r6gd.12xlarge + - r6i.12xlarge + - x2gd.12xlarge + - c5.12xlarge + - r7gd.12xlarge + - m5.12xlarge + - c6in.12xlarge + - c6id.12xlarge + - m8g.12xlarge + - c6gd.12xlarge + - c7i.12xlarge + - z1d.metal + - m6id.12xlarge + - m4.10xlarge + - c5d.9xlarge + - c5n.9xlarge + - d2.8xlarge + - c4.8xlarge + - c5.9xlarge + - g5.8xlarge + - r5n.8xlarge + - c6id.8xlarge + - p3.8xlarge + - r7i.8xlarge + - c6i.8xlarge + - x2iedn.8xlarge + - m6id.8xlarge + - r7g.8xlarge + - m6g.8xlarge + - m8g.8xlarge + - m6a.8xlarge + - c6gn.8xlarge + - i3.8xlarge + - c8g.8xlarge + - r6idn.8xlarge + - m5a.8xlarge + - c7gn.8xlarge + - r8g.8xlarge + - i4g.8xlarge + - m7i.8xlarge + - g4ad.8xlarge + - r5b.8xlarge + - r7gd.8xlarge + - r7a.8xlarge + - m5.8xlarge + - c6in.8xlarge + - is4gen.8xlarge + - r5a.8xlarge + - c7a.8xlarge + - i2.8xlarge + - m7i-flex.8xlarge + - r3.8xlarge + - c5ad.8xlarge + - gr6.8xlarge + - c5a.8xlarge + - inf2.8xlarge + - m7g.8xlarge + - p2.8xlarge + - m5n.8xlarge + - x2gd.8xlarge + - m6gd.8xlarge + - im4gn.8xlarge + - r6g.8xlarge + - d3.8xlarge + - m5dn.8xlarge + - g3.8xlarge + - i4i.8xlarge + - m6idn.8xlarge + - c6g.8xlarge + - r5ad.8xlarge + - r6a.8xlarge + - r6i.8xlarge + - m6i.8xlarge + - g6.8xlarge + - r6in.8xlarge + - g6e.8xlarge + - r6id.8xlarge + - h1.8xlarge + - c7gd.8xlarge + - c6a.8xlarge + - m5ad.8xlarge + - r5d.8xlarge + - c7i-flex.8xlarge + - m7gd.8xlarge + - c7i.8xlarge + - x1e.8xlarge + - m5d.8xlarge + - r5.8xlarge + - r4.8xlarge + - g4dn.8xlarge + - r5dn.8xlarge + - c7g.8xlarge + - m6in.8xlarge + - m7a.8xlarge + - c6gd.8xlarge + - r6gd.8xlarge + - r7iz.8xlarge + - inf1.6xlarge + - z1d.6xlarge + - m5zn.6xlarge + - i3en.6xlarge + - hpc7a.12xlarge + - r6gd.4xlarge + - m6id.4xlarge + - r5a.4xlarge + - r7g.4xlarge + - d2.4xlarge + - c7gd.4xlarge + - r5d.4xlarge + - c5.4xlarge + - g3.4xlarge + - r7gd.4xlarge + - r5dn.4xlarge + - r3.4xlarge + - r8g.4xlarge + - g6e.4xlarge + - gr6.4xlarge + - m6idn.4xlarge + - c7i-flex.4xlarge + - m7a.4xlarge + - c8g.4xlarge + - m4.4xlarge + - c7gn.4xlarge + - m5ad.4xlarge + - c5ad.4xlarge + - c7g.4xlarge + - c7i.4xlarge + - d3.4xlarge + - g6.4xlarge + - r5ad.4xlarge + - m7g.4xlarge + - m5a.4xlarge + - c5d.4xlarge + - x1e.4xlarge + - c6gd.4xlarge + - i3.4xlarge + - m6i.4xlarge + - c6g.4xlarge + - r7a.4xlarge + - r6a.4xlarge + - m7i.4xlarge + - c6i.4xlarge + - c6id.4xlarge + - g5.4xlarge + - g4dn.4xlarge + - m5n.4xlarge + - m7gd.4xlarge + - a1.metal + - r6id.4xlarge + - m5dn.4xlarge + - r5.4xlarge + - m5d.4xlarge + - m7i-flex.4xlarge + - g4ad.4xlarge + - r6i.4xlarge + - c5n.4xlarge + - c4.4xlarge + - r7i.4xlarge + - r6idn.4xlarge + - r6in.4xlarge + - x2gd.4xlarge + - c6gn.4xlarge + - a1.4xlarge + - m5.4xlarge + - i2.4xlarge + - m6gd.4xlarge + - im4gn.4xlarge + - m8g.4xlarge + - h1.4xlarge + - is4gen.4xlarge + - i4i.4xlarge + - c6in.4xlarge + - m6a.4xlarge + - r7iz.4xlarge + - r5b.4xlarge + - m6in.4xlarge + - r5n.4xlarge + - c5a.4xlarge + - c7a.4xlarge + - x2iedn.4xlarge + - m6g.4xlarge + - i4g.4xlarge + - c6a.4xlarge + - r6g.4xlarge + - r4.4xlarge + - mac2-m2pro.metal + - z1d.3xlarge + - i3en.3xlarge + - m5zn.3xlarge + - mac1.metal + - c7a.2xlarge + - t4g.2xlarge + - d3.2xlarge + - c6gn.2xlarge + - r6id.2xlarge + - m7i.2xlarge + - r5dn.2xlarge + - r6a.2xlarge + - r5ad.2xlarge + - c6i.2xlarge + - r7iz.2xlarge + - r5d.2xlarge + - c7g.2xlarge + - r5n.2xlarge + - m6g.2xlarge + - z1d.2xlarge + - i3.2xlarge + - r5b.2xlarge + - t3a.2xlarge + - i2.2xlarge + - r4.2xlarge + - c6in.2xlarge + - m7a.2xlarge + - m5dn.2xlarge + - c6gd.2xlarge + - x2gd.2xlarge + - m6i.2xlarge + - inf1.2xlarge + - m7i-flex.2xlarge + - r8g.2xlarge + - c7i-flex.2xlarge + - r7a.2xlarge + - m6in.2xlarge + - c7gn.2xlarge + - m5n.2xlarge + - m7g.2xlarge + - i4g.2xlarge + - c6g.2xlarge + - m6idn.2xlarge + - i4i.2xlarge + - m6gd.2xlarge + - r6g.2xlarge + - c6id.2xlarge + - c6a.2xlarge + - mac2.metal + - c5ad.2xlarge + - i3en.2xlarge + - g4ad.2xlarge + - c5a.2xlarge + - x2iedn.2xlarge + - m6a.2xlarge + - m5a.2xlarge + - g6e.2xlarge + - x1e.2xlarge + - c8g.2xlarge + - a1.2xlarge + - im4gn.2xlarge + - c7i.2xlarge + - g4dn.2xlarge + - r5a.2xlarge + - t3.2xlarge + - trn1.2xlarge + - g6.2xlarge + - m6id.2xlarge + - t2.2xlarge + - m5.2xlarge + - r3.2xlarge + - c5d.2xlarge + - m5zn.2xlarge + - r7gd.2xlarge + - r5.2xlarge + - h1.2xlarge + - r6idn.2xlarge + - r6i.2xlarge + - m8g.2xlarge + - r7g.2xlarge + - p3.2xlarge + - c4.2xlarge + - is4gen.2xlarge + - g5.2xlarge + - c5n.2xlarge + - m5ad.2xlarge + - r7i.2xlarge + - mac2-m2.metal + - m7gd.2xlarge + - r6in.2xlarge + - m5d.2xlarge + - r6gd.2xlarge + - c5.2xlarge + - m4.2xlarge + - d2.2xlarge + - c7gd.2xlarge + - r5ad.xlarge + - m6i.xlarge + - m6id.xlarge + - c6gn.xlarge + - r5dn.xlarge + - c5d.xlarge + - r5a.xlarge + - t3a.xlarge + - c5ad.xlarge + - m6in.xlarge + - c6g.xlarge + - r5d.xlarge + - m5.xlarge + - m7gd.xlarge + - r6a.xlarge + - r6gd.xlarge + - r8g.xlarge + - inf2.xlarge + - im4gn.xlarge + - r6in.xlarge + - d2.xlarge + - r7gd.xlarge + - m5a.xlarge + - c6i.xlarge + - r6id.xlarge + - r5n.xlarge + - i4i.xlarge + - g5.xlarge + - r7i.xlarge + - r5.xlarge + - i4g.xlarge + - m5dn.xlarge + - i2.xlarge + - m8g.xlarge + - c6a.xlarge + - m6g.xlarge + - d3.xlarge + - c8g.xlarge + - c6gd.xlarge + - g3s.xlarge + - z1d.xlarge + - c6in.xlarge + - r3.xlarge + - m6a.xlarge + - g4dn.xlarge + - g6.xlarge + - r7iz.xlarge + - m7i-flex.xlarge + - c5.xlarge + - m4.xlarge + - r7g.xlarge + - i3.xlarge + - r6g.xlarge + - c7g.xlarge + - m7a.xlarge + - c5n.xlarge + - c5a.xlarge + - p2.xlarge + - m5n.xlarge + - t3.xlarge + - m6gd.xlarge + - m6idn.xlarge + - r6idn.xlarge + - t4g.xlarge + - c7a.xlarge + - m5zn.xlarge + - a1.xlarge + - g6e.xlarge + - m5d.xlarge + - r7a.xlarge + - m5ad.xlarge + - r5b.xlarge + - r6i.xlarge + - r4.xlarge + - is4gen.xlarge + - x1e.xlarge + - g4ad.xlarge + - inf1.xlarge + - c7i.xlarge + - m7g.xlarge + - c4.xlarge + - t2.xlarge + - c7gn.xlarge + - m7i.xlarge + - x2iedn.xlarge + - c6id.xlarge + - c7i-flex.xlarge + - i3en.xlarge + - x2gd.xlarge + - c7gd.xlarge + - m5n.large + - i4i.large + - r4.large + - t3.small + - c7a.large + - m8g.large + - c5ad.large + - c7gn.large + - m6i.large + - m6id.large + - r8g.large + - im4gn.large + - r7g.large + - r7a.large + - m6a.large + - i3en.large + - m5ad.large + - r6i.large + - m5zn.large + - r5a.large + - m4.large + - c7gd.large + - r6a.large + - m5dn.large + - c6i.large + - t3a.nano + - r5n.large + - c5d.large + - t4g.large + - m7g.large + - r6g.large + - m7gd.large + - t3a.micro + - c5n.large + - m5a.large + - r6gd.large + - is4gen.large + - c7g.large + - c5a.large + - m7i-flex.large + - x2gd.large + - c7i.large + - c6g.large + - c6in.large + - t3.medium + - t4g.nano + - c5.large + - m7i.large + - r7gd.large + - r7i.large + - z1d.large + - m6gd.large + - i4g.large + - r5.large + - t4g.medium + - i3.large + - c6id.large + - t3a.large + - m6g.large + - c6gn.large + - t3a.small + - m5d.large + - t2.large + - c4.large + - c6a.large + - m6in.large + - r7iz.large + - r6in.large + - m6idn.large + - c6gd.large + - a1.large + - t2.medium + - t3.large + - m5.large + - r6id.large + - r5b.large + - r6idn.large + - r5d.large + - r5ad.large + - c7i-flex.large + - t3.micro + - r5dn.large + - t4g.micro + - c8g.large + - r3.large + - t4g.small + - t3.nano + - m7a.large + - t3a.medium + - t2.small + - x2gd.medium + - r7gd.medium + - m7gd.medium + - c7gd.medium + - t2.nano + - c8g.medium + - r7a.medium + - c7gn.medium + - m6g.medium + - m6gd.medium + - c7g.medium + - a1.medium + - m8g.medium + - r6gd.medium + - c6gn.medium + - t2.micro + - c6g.medium + - r8g.medium + - r6g.medium + - is4gen.medium + - c6gd.medium + - c7a.medium + - r7g.medium + - m7g.medium + - m7a.medium us-west-1: - - r6a.metal - - m7i.metal-48xl - - c6a.metal - - m6a.metal - - m6a.48xlarge - - r6a.48xlarge - - c7i.48xlarge - - m7i.48xlarge - - c7i.metal-48xl - - r7i.48xlarge - - c6a.48xlarge - - r7i.metal-48xl - - x2idn.32xlarge - - m6i.32xlarge - - c6a.32xlarge - - c6in.metal - - c6in.32xlarge - - i4i.metal - - c6i.32xlarge - - x2iedn.32xlarge - - m6idn.metal - - m6a.32xlarge - - c6i.metal - - x2iedn.metal - - r6i.32xlarge - - m6idn.32xlarge - - r6i.metal - - m6in.32xlarge - - r6a.32xlarge - - i4i.32xlarge - - m6i.metal - - m6in.metal - - x2idn.metal - - m7i.metal-24xl - - m6i.24xlarge - - r7i.24xlarge - - x2iedn.24xlarge - - r7i.metal-24xl - - r5d.metal - - c5a.24xlarge - - r5n.24xlarge - - c5d.metal - - i4i.24xlarge - - i3en.metal - - m5.metal - - m6a.24xlarge - - m5d.metal - - m5.24xlarge - - r6a.24xlarge - - g4dn.metal - - x2idn.24xlarge - - m5d.24xlarge - - c6in.24xlarge - - r6i.24xlarge - - r5d.24xlarge - - m5ad.24xlarge - - c5.24xlarge - - i3en.24xlarge - - r5.metal - - c5.metal - - c7i.24xlarge - - c6i.24xlarge - - m6idn.24xlarge - - m6in.24xlarge - - m7i.24xlarge - - c7i.metal-24xl - - r5ad.24xlarge - - m5a.24xlarge - - inf1.24xlarge - - c6a.24xlarge - - r5a.24xlarge - - r5.24xlarge - - c5d.24xlarge - - r5n.metal - - c5d.18xlarge - - c5n.metal - - c5n.18xlarge - - c5.18xlarge - - i3.metal - - m6gd.16xlarge - - r6gd.metal - - r6g.metal - - c7gd.metal - - m5d.16xlarge - - x2iedn.16xlarge - - m6g.metal - - i4i.16xlarge - - m7i.16xlarge - - r6i.16xlarge - - r7g.metal - - m7g.16xlarge - - m6i.16xlarge - - r4.16xlarge - - m5.16xlarge - - m6idn.16xlarge - - m5a.16xlarge - - r7gd.16xlarge - - r5ad.16xlarge - - r7g.16xlarge - - x2idn.16xlarge - - c5a.16xlarge - - c6g.16xlarge - - r5a.16xlarge - - i3.16xlarge - - r5d.16xlarge - - m6in.16xlarge - - c7g.16xlarge - - r6gd.16xlarge - - m4.16xlarge - - c6g.metal - - r5n.16xlarge - - m6a.16xlarge - - c6in.16xlarge - - c6gd.metal - - r5.16xlarge - - m6gd.metal - - c6gn.16xlarge - - r6a.16xlarge - - m7gd.metal - - g4dn.16xlarge - - r7i.16xlarge - - r7gd.metal - - m7g.metal - - r6g.16xlarge - - c7g.metal - - g3.16xlarge - - m5ad.16xlarge - - c6i.16xlarge - - c7gd.16xlarge - - c7i.16xlarge - - m6g.16xlarge - - m7gd.16xlarge - - c6a.16xlarge - - c6gd.16xlarge - - c5d.12xlarge - - c6g.12xlarge - - r7i.12xlarge - - m7i.12xlarge - - m6gd.12xlarge - - c7i.12xlarge - - m6in.12xlarge - - c7gd.12xlarge - - m6a.12xlarge - - m5a.12xlarge - - r5a.12xlarge - - c6gd.12xlarge - - z1d.12xlarge - - c6a.12xlarge - - r7g.12xlarge - - m7g.12xlarge - - m5.12xlarge - - m7gd.12xlarge - - r5ad.12xlarge - - r6gd.12xlarge - - c5a.12xlarge - - r6a.12xlarge - - m5d.12xlarge - - r5d.12xlarge - - c6i.12xlarge - - c6gn.12xlarge - - i3en.12xlarge - - m6g.12xlarge - - c6in.12xlarge - - c5.12xlarge - - g4dn.12xlarge - - r6i.12xlarge - - i4i.12xlarge - - z1d.metal - - m5zn.metal - - m5zn.12xlarge - - m5ad.12xlarge - - m6idn.12xlarge - - r5n.12xlarge - - c7g.12xlarge - - r5.12xlarge - - m6i.12xlarge - - r7gd.12xlarge - - r6g.12xlarge - - m4.10xlarge - - c4.8xlarge - - c5.9xlarge - - c5n.9xlarge - - c5d.9xlarge - - d2.8xlarge - - m5.8xlarge - - m7i-flex.8xlarge - - m5ad.8xlarge - - r5.8xlarge - - r3.8xlarge - - c7g.8xlarge - - m7i.8xlarge - - c6gd.8xlarge - - m6in.8xlarge - - g3.8xlarge - - c7i.8xlarge - - i3.8xlarge - - r6g.8xlarge - - x2iedn.8xlarge - - m6i.8xlarge - - g4dn.8xlarge - - r5a.8xlarge - - r6i.8xlarge - - m7gd.8xlarge - - r7gd.8xlarge - - c3.8xlarge - - c6g.8xlarge - - m5d.8xlarge - - c7i-flex.8xlarge - - r5n.8xlarge - - c6i.8xlarge - - r6gd.8xlarge - - c7gd.8xlarge - - r7i.8xlarge - - m6gd.8xlarge - - c6in.8xlarge - - i4i.8xlarge - - r5ad.8xlarge - - m6a.8xlarge - - r4.8xlarge - - r5d.8xlarge - - m5a.8xlarge - - c5a.8xlarge - - i2.8xlarge - - m6idn.8xlarge - - m7g.8xlarge - - c6gn.8xlarge - - r6a.8xlarge - - m6g.8xlarge - - c6a.8xlarge - - r7g.8xlarge - - z1d.6xlarge - - inf1.6xlarge - - m5zn.6xlarge - - i3en.6xlarge - - m7i-flex.4xlarge - - r6i.4xlarge - - c7g.4xlarge - - c6gn.4xlarge - - c5d.4xlarge - - r7i.4xlarge - - g3.4xlarge - - i2.4xlarge - - r5a.4xlarge - - c7i.4xlarge - - r5d.4xlarge - - i4i.4xlarge - - m6gd.4xlarge - - d2.4xlarge - - r6g.4xlarge - - r5n.4xlarge - - c3.4xlarge - - m5a.4xlarge - - c5n.4xlarge - - c5.4xlarge - - m5d.4xlarge - - r7g.4xlarge - - r4.4xlarge - - m7g.4xlarge - - c6i.4xlarge - - c4.4xlarge - - c6in.4xlarge - - r5.4xlarge - - r7gd.4xlarge - - r3.4xlarge - - c6a.4xlarge - - i3.4xlarge - - m6a.4xlarge - - m7i.4xlarge - - m5ad.4xlarge - - c6gd.4xlarge - - c6g.4xlarge - - r6gd.4xlarge - - c5a.4xlarge - - r5ad.4xlarge - - m6idn.4xlarge - - m4.4xlarge - - g4dn.4xlarge - - m6g.4xlarge - - m6i.4xlarge - - m6in.4xlarge - - x2iedn.4xlarge - - r6a.4xlarge - - m5.4xlarge - - c7i-flex.4xlarge - - c7gd.4xlarge - - m7gd.4xlarge - - m5zn.3xlarge - - z1d.3xlarge - - i3en.3xlarge - - i2.2xlarge - - m6gd.2xlarge - - m6a.2xlarge - - m7gd.2xlarge - - c1.xlarge - - t2.2xlarge - - m5zn.2xlarge - - r4.2xlarge - - i4i.2xlarge - - r3.2xlarge - - c7i.2xlarge - - c5.2xlarge - - m6i.2xlarge - - r5a.2xlarge - - c6in.2xlarge - - c7i-flex.2xlarge - - c5a.2xlarge - - r5d.2xlarge - - c5n.2xlarge - - m6in.2xlarge - - r6gd.2xlarge - - inf1.2xlarge - - z1d.2xlarge - - r7i.2xlarge - - c6gd.2xlarge - - m6g.2xlarge - - i3.2xlarge - - r5.2xlarge - - m7i.2xlarge - - m5.2xlarge - - c6i.2xlarge - - r6g.2xlarge - - c6gn.2xlarge - - c5d.2xlarge - - m5d.2xlarge - - i3en.2xlarge - - m5a.2xlarge - - m6idn.2xlarge - - r5n.2xlarge - - c6a.2xlarge - - m7i-flex.2xlarge - - m7g.2xlarge - - t3a.2xlarge - - c4.2xlarge - - c7g.2xlarge - - r7g.2xlarge - - m5ad.2xlarge - - c6g.2xlarge - - r7gd.2xlarge - - r5ad.2xlarge - - d2.2xlarge - - c7gd.2xlarge - - t3.2xlarge - - x2iedn.2xlarge - - r6i.2xlarge - - m4.2xlarge - - c3.2xlarge - - m3.2xlarge - - t4g.2xlarge - - m2.4xlarge - - r6a.2xlarge - - g4dn.2xlarge - - inf1.xlarge - - m7gd.xlarge - - r5.xlarge - - t4g.xlarge - - m5zn.xlarge - - m6g.xlarge - - t3a.xlarge - - m4.xlarge - - c6in.xlarge - - m3.xlarge - - r6a.xlarge - - r4.xlarge - - r5ad.xlarge - - t3.xlarge - - m6idn.xlarge - - c4.xlarge - - r7gd.xlarge - - m5.xlarge - - r7g.xlarge - - c3.xlarge - - r6i.xlarge - - m7i.xlarge - - c7g.xlarge - - r3.xlarge - - i3.xlarge - - m7g.xlarge - - c5n.xlarge - - c6a.xlarge - - r7i.xlarge - - r5n.xlarge - - m7i-flex.xlarge - - m6a.xlarge - - c7i-flex.xlarge - - r5d.xlarge - - m5ad.xlarge - - x2iedn.xlarge - - c6gd.xlarge - - r6g.xlarge - - m6gd.xlarge - - m1.xlarge - - m5d.xlarge - - t2.xlarge - - i3en.xlarge - - r5a.xlarge - - c5a.xlarge - - m6i.xlarge - - c5d.xlarge - - g4dn.xlarge - - m5a.xlarge - - i2.xlarge - - c6gn.xlarge - - c6g.xlarge - - c5.xlarge - - m2.2xlarge - - i4i.xlarge - - c7gd.xlarge - - d2.xlarge - - c7i.xlarge - - m6in.xlarge - - z1d.xlarge - - r6gd.xlarge - - c6i.xlarge - - c7g.large - - t4g.micro - - t3a.micro - - r5ad.large - - m5.large - - m5ad.large - - c5a.large - - z1d.large - - t2.medium - - m7gd.large - - t3a.small - - t3.small - - i3en.large - - r6g.large - - t3.large - - r6gd.large - - m6gd.large - - c5.large - - t4g.nano - - t3.micro - - m5d.large - - c6i.large - - m6a.large - - m6idn.large - - t4g.medium - - m5zn.large - - m1.large - - m6g.large - - c3.large - - m6in.large - - r7g.large - - c7i.large - - c4.large - - t3a.nano - - m2.xlarge - - c6a.large - - m6i.large - - i3.large - - c1.medium - - c7i-flex.large - - t3a.medium - - c6gn.large - - c6g.large - - t4g.large - - c5n.large - - t3a.large - - r5n.large - - m4.large - - r5d.large - - t3.medium - - c7gd.large - - m3.large - - r7i.large - - r7gd.large - - m7i-flex.large - - c5d.large - - i4i.large - - c6in.large - - r5.large - - r6i.large - - c6gd.large - - r3.large - - r5a.large - - t3.nano - - t4g.small - - t2.large - - m7i.large - - r4.large - - m7g.large - - r6a.large - - m5a.large - - c6g.medium - - m6g.medium - - t2.small - - m7gd.medium - - c6gn.medium - - c7gd.medium - - t2.nano - - c7g.medium - - r7g.medium - - m3.medium - - r6g.medium - - m7g.medium - - r6gd.medium - - m1.small - - c6gd.medium - - r7gd.medium - - m1.medium - - t2.micro - - m6gd.medium - - t1.micro + - r6a.metal + - m7i.metal-48xl + - c6a.metal + - m6a.metal + - m6a.48xlarge + - r6a.48xlarge + - c7i.48xlarge + - m7i.48xlarge + - c7i.metal-48xl + - r7i.48xlarge + - c6a.48xlarge + - r7i.metal-48xl + - x2idn.32xlarge + - m6i.32xlarge + - c6a.32xlarge + - c6in.metal + - c6in.32xlarge + - i4i.metal + - c6i.32xlarge + - x2iedn.32xlarge + - m6idn.metal + - m6a.32xlarge + - c6i.metal + - x2iedn.metal + - r6i.32xlarge + - m6idn.32xlarge + - r6i.metal + - m6in.32xlarge + - r6a.32xlarge + - i4i.32xlarge + - m6i.metal + - m6in.metal + - x2idn.metal + - m7i.metal-24xl + - m6i.24xlarge + - r7i.24xlarge + - x2iedn.24xlarge + - r7i.metal-24xl + - r5d.metal + - c5a.24xlarge + - r5n.24xlarge + - c5d.metal + - i4i.24xlarge + - i3en.metal + - m5.metal + - m6a.24xlarge + - m5d.metal + - m5.24xlarge + - r6a.24xlarge + - g4dn.metal + - x2idn.24xlarge + - m5d.24xlarge + - c6in.24xlarge + - r6i.24xlarge + - r5d.24xlarge + - m5ad.24xlarge + - c5.24xlarge + - i3en.24xlarge + - r5.metal + - c5.metal + - c7i.24xlarge + - c6i.24xlarge + - m6idn.24xlarge + - m6in.24xlarge + - m7i.24xlarge + - c7i.metal-24xl + - r5ad.24xlarge + - m5a.24xlarge + - inf1.24xlarge + - c6a.24xlarge + - r5a.24xlarge + - r5.24xlarge + - c5d.24xlarge + - r5n.metal + - c5d.18xlarge + - c5n.metal + - c5n.18xlarge + - c5.18xlarge + - i3.metal + - m6gd.16xlarge + - r6gd.metal + - r6g.metal + - c7gd.metal + - m5d.16xlarge + - x2iedn.16xlarge + - m6g.metal + - i4i.16xlarge + - m7i.16xlarge + - r6i.16xlarge + - r7g.metal + - m7g.16xlarge + - m6i.16xlarge + - r4.16xlarge + - m5.16xlarge + - m6idn.16xlarge + - m5a.16xlarge + - r7gd.16xlarge + - r5ad.16xlarge + - r7g.16xlarge + - x2idn.16xlarge + - c5a.16xlarge + - c6g.16xlarge + - r5a.16xlarge + - i3.16xlarge + - r5d.16xlarge + - m6in.16xlarge + - c7g.16xlarge + - r6gd.16xlarge + - m4.16xlarge + - c6g.metal + - r5n.16xlarge + - m6a.16xlarge + - c6in.16xlarge + - c6gd.metal + - r5.16xlarge + - m6gd.metal + - c6gn.16xlarge + - r6a.16xlarge + - m7gd.metal + - g4dn.16xlarge + - r7i.16xlarge + - r7gd.metal + - m7g.metal + - r6g.16xlarge + - c7g.metal + - g3.16xlarge + - m5ad.16xlarge + - c6i.16xlarge + - c7gd.16xlarge + - c7i.16xlarge + - m6g.16xlarge + - m7gd.16xlarge + - c6a.16xlarge + - c6gd.16xlarge + - c5d.12xlarge + - c6g.12xlarge + - r7i.12xlarge + - m7i.12xlarge + - m6gd.12xlarge + - c7i.12xlarge + - m6in.12xlarge + - c7gd.12xlarge + - m6a.12xlarge + - m5a.12xlarge + - r5a.12xlarge + - c6gd.12xlarge + - z1d.12xlarge + - c6a.12xlarge + - r7g.12xlarge + - m7g.12xlarge + - m5.12xlarge + - m7gd.12xlarge + - r5ad.12xlarge + - r6gd.12xlarge + - c5a.12xlarge + - r6a.12xlarge + - m5d.12xlarge + - r5d.12xlarge + - c6i.12xlarge + - c6gn.12xlarge + - i3en.12xlarge + - m6g.12xlarge + - c6in.12xlarge + - c5.12xlarge + - g4dn.12xlarge + - r6i.12xlarge + - i4i.12xlarge + - z1d.metal + - m5zn.metal + - m5zn.12xlarge + - m5ad.12xlarge + - m6idn.12xlarge + - r5n.12xlarge + - c7g.12xlarge + - r5.12xlarge + - m6i.12xlarge + - r7gd.12xlarge + - r6g.12xlarge + - m4.10xlarge + - c4.8xlarge + - c5.9xlarge + - c5n.9xlarge + - c5d.9xlarge + - d2.8xlarge + - m5.8xlarge + - m7i-flex.8xlarge + - m5ad.8xlarge + - r5.8xlarge + - r3.8xlarge + - c7g.8xlarge + - m7i.8xlarge + - c6gd.8xlarge + - m6in.8xlarge + - g3.8xlarge + - c7i.8xlarge + - i3.8xlarge + - r6g.8xlarge + - x2iedn.8xlarge + - m6i.8xlarge + - g4dn.8xlarge + - r5a.8xlarge + - r6i.8xlarge + - m7gd.8xlarge + - r7gd.8xlarge + - c3.8xlarge + - c6g.8xlarge + - m5d.8xlarge + - c7i-flex.8xlarge + - r5n.8xlarge + - c6i.8xlarge + - r6gd.8xlarge + - c7gd.8xlarge + - r7i.8xlarge + - m6gd.8xlarge + - c6in.8xlarge + - i4i.8xlarge + - r5ad.8xlarge + - m6a.8xlarge + - r4.8xlarge + - r5d.8xlarge + - m5a.8xlarge + - c5a.8xlarge + - i2.8xlarge + - m6idn.8xlarge + - m7g.8xlarge + - c6gn.8xlarge + - r6a.8xlarge + - m6g.8xlarge + - c6a.8xlarge + - r7g.8xlarge + - z1d.6xlarge + - inf1.6xlarge + - m5zn.6xlarge + - i3en.6xlarge + - m7i-flex.4xlarge + - r6i.4xlarge + - c7g.4xlarge + - c6gn.4xlarge + - c5d.4xlarge + - r7i.4xlarge + - g3.4xlarge + - i2.4xlarge + - r5a.4xlarge + - c7i.4xlarge + - r5d.4xlarge + - i4i.4xlarge + - m6gd.4xlarge + - d2.4xlarge + - r6g.4xlarge + - r5n.4xlarge + - c3.4xlarge + - m5a.4xlarge + - c5n.4xlarge + - c5.4xlarge + - m5d.4xlarge + - r7g.4xlarge + - r4.4xlarge + - m7g.4xlarge + - c6i.4xlarge + - c4.4xlarge + - c6in.4xlarge + - r5.4xlarge + - r7gd.4xlarge + - r3.4xlarge + - c6a.4xlarge + - i3.4xlarge + - m6a.4xlarge + - m7i.4xlarge + - m5ad.4xlarge + - c6gd.4xlarge + - c6g.4xlarge + - r6gd.4xlarge + - c5a.4xlarge + - r5ad.4xlarge + - m6idn.4xlarge + - m4.4xlarge + - g4dn.4xlarge + - m6g.4xlarge + - m6i.4xlarge + - m6in.4xlarge + - x2iedn.4xlarge + - r6a.4xlarge + - m5.4xlarge + - c7i-flex.4xlarge + - c7gd.4xlarge + - m7gd.4xlarge + - m5zn.3xlarge + - z1d.3xlarge + - i3en.3xlarge + - i2.2xlarge + - m6gd.2xlarge + - m6a.2xlarge + - m7gd.2xlarge + - c1.xlarge + - t2.2xlarge + - m5zn.2xlarge + - r4.2xlarge + - i4i.2xlarge + - r3.2xlarge + - c7i.2xlarge + - c5.2xlarge + - m6i.2xlarge + - r5a.2xlarge + - c6in.2xlarge + - c7i-flex.2xlarge + - c5a.2xlarge + - r5d.2xlarge + - c5n.2xlarge + - m6in.2xlarge + - r6gd.2xlarge + - inf1.2xlarge + - z1d.2xlarge + - r7i.2xlarge + - c6gd.2xlarge + - m6g.2xlarge + - i3.2xlarge + - r5.2xlarge + - m7i.2xlarge + - m5.2xlarge + - c6i.2xlarge + - r6g.2xlarge + - c6gn.2xlarge + - c5d.2xlarge + - m5d.2xlarge + - i3en.2xlarge + - m5a.2xlarge + - m6idn.2xlarge + - r5n.2xlarge + - c6a.2xlarge + - m7i-flex.2xlarge + - m7g.2xlarge + - t3a.2xlarge + - c4.2xlarge + - c7g.2xlarge + - r7g.2xlarge + - m5ad.2xlarge + - c6g.2xlarge + - r7gd.2xlarge + - r5ad.2xlarge + - d2.2xlarge + - c7gd.2xlarge + - t3.2xlarge + - x2iedn.2xlarge + - r6i.2xlarge + - m4.2xlarge + - c3.2xlarge + - m3.2xlarge + - t4g.2xlarge + - m2.4xlarge + - r6a.2xlarge + - g4dn.2xlarge + - inf1.xlarge + - m7gd.xlarge + - r5.xlarge + - t4g.xlarge + - m5zn.xlarge + - m6g.xlarge + - t3a.xlarge + - m4.xlarge + - c6in.xlarge + - m3.xlarge + - r6a.xlarge + - r4.xlarge + - r5ad.xlarge + - t3.xlarge + - m6idn.xlarge + - c4.xlarge + - r7gd.xlarge + - m5.xlarge + - r7g.xlarge + - c3.xlarge + - r6i.xlarge + - m7i.xlarge + - c7g.xlarge + - r3.xlarge + - i3.xlarge + - m7g.xlarge + - c5n.xlarge + - c6a.xlarge + - r7i.xlarge + - r5n.xlarge + - m7i-flex.xlarge + - m6a.xlarge + - c7i-flex.xlarge + - r5d.xlarge + - m5ad.xlarge + - x2iedn.xlarge + - c6gd.xlarge + - r6g.xlarge + - m6gd.xlarge + - m1.xlarge + - m5d.xlarge + - t2.xlarge + - i3en.xlarge + - r5a.xlarge + - c5a.xlarge + - m6i.xlarge + - c5d.xlarge + - g4dn.xlarge + - m5a.xlarge + - i2.xlarge + - c6gn.xlarge + - c6g.xlarge + - c5.xlarge + - m2.2xlarge + - i4i.xlarge + - c7gd.xlarge + - d2.xlarge + - c7i.xlarge + - m6in.xlarge + - z1d.xlarge + - r6gd.xlarge + - c6i.xlarge + - c7g.large + - t4g.micro + - t3a.micro + - r5ad.large + - m5.large + - m5ad.large + - c5a.large + - z1d.large + - t2.medium + - m7gd.large + - t3a.small + - t3.small + - i3en.large + - r6g.large + - t3.large + - r6gd.large + - m6gd.large + - c5.large + - t4g.nano + - t3.micro + - m5d.large + - c6i.large + - m6a.large + - m6idn.large + - t4g.medium + - m5zn.large + - m1.large + - m6g.large + - c3.large + - m6in.large + - r7g.large + - c7i.large + - c4.large + - t3a.nano + - m2.xlarge + - c6a.large + - m6i.large + - i3.large + - c1.medium + - c7i-flex.large + - t3a.medium + - c6gn.large + - c6g.large + - t4g.large + - c5n.large + - t3a.large + - r5n.large + - m4.large + - r5d.large + - t3.medium + - c7gd.large + - m3.large + - r7i.large + - r7gd.large + - m7i-flex.large + - c5d.large + - i4i.large + - c6in.large + - r5.large + - r6i.large + - c6gd.large + - r3.large + - r5a.large + - t3.nano + - t4g.small + - t2.large + - m7i.large + - r4.large + - m7g.large + - r6a.large + - m5a.large + - c6g.medium + - m6g.medium + - t2.small + - m7gd.medium + - c6gn.medium + - c7gd.medium + - t2.nano + - c7g.medium + - r7g.medium + - m3.medium + - r6g.medium + - m7g.medium + - r6gd.medium + - m1.small + - c6gd.medium + - r7gd.medium + - m1.medium + - t2.micro + - m6gd.medium + - t1.micro us-west-2: - - u7i-12tb.224xlarge - - u7in-32tb.224xlarge - - u7in-16tb.224xlarge - - u7in-24tb.224xlarge - - u-24tb1.112xlarge - - u-12tb1.112xlarge - - u-9tb1.112xlarge - - u-6tb1.112xlarge - - u-18tb1.112xlarge - - u-3tb1.56xlarge - - u-6tb1.56xlarge - - c7i.48xlarge - - r7a.metal-48xl - - c6a.metal - - r7a.48xlarge - - c7i.metal-48xl - - g6.48xlarge - - inf2.48xlarge - - m6a.48xlarge - - m7i.metal-48xl - - m8g.metal-48xl - - g5.48xlarge - - c7a.metal-48xl - - g6e.48xlarge - - c7a.48xlarge - - r8g.48xlarge - - r6a.48xlarge - - r8g.metal-48xl - - m8g.48xlarge - - c8g.metal-48xl - - p5.48xlarge - - r7i.48xlarge - - m7a.48xlarge - - r7i.metal-48xl - - m7a.metal-48xl - - r6a.metal - - c8g.48xlarge - - m6a.metal - - c6a.48xlarge - - x8g.metal-48xl - - m7i.48xlarge - - x8g.48xlarge - - c6in.metal - - c6a.32xlarge - - c6in.32xlarge - - r6a.32xlarge - - r7iz.32xlarge - - m7a.32xlarge - - m6idn.metal - - m6in.32xlarge - - m6in.metal - - r6id.metal - - r6in.32xlarge - - x2idn.metal - - c6id.metal - - x2idn.32xlarge - - m6idn.32xlarge - - r6i.metal - - r6idn.metal - - c7a.32xlarge - - m6id.metal - - x1e.32xlarge - - r7a.32xlarge - - r6i.32xlarge - - c6id.32xlarge - - x2iedn.32xlarge - - c6i.32xlarge - - r6in.metal - - i4i.32xlarge - - r7iz.metal-32xl - - x1.32xlarge - - m6i.32xlarge - - m6id.32xlarge - - i4i.metal - - x2iedn.metal - - m6i.metal - - m6a.32xlarge - - c6i.metal - - trn1n.32xlarge - - trn1.32xlarge - - r6idn.32xlarge - - r6id.32xlarge - - m6in.24xlarge - - c5.24xlarge - - m7i.metal-24xl - - c6in.24xlarge - - r7i.metal-24xl - - r5b.24xlarge - - c7i.24xlarge - - m8g.metal-24xl - - c7i.metal-24xl - - r5dn.24xlarge - - r8g.metal-24xl - - r5dn.metal - - r5.metal - - r5.24xlarge - - x2iedn.24xlarge - - c5ad.24xlarge - - x8g.24xlarge - - c5d.24xlarge - - c5a.24xlarge - - c6a.24xlarge - - r5a.24xlarge - - c5.metal - - r8g.24xlarge - - g6e.24xlarge - - r5b.metal - - m6a.24xlarge - - x2idn.24xlarge - - m5.metal - - inf1.24xlarge - - vt1.24xlarge - - r6i.24xlarge - - i3en.metal - - m5n.24xlarge - - r5n.metal - - r6idn.24xlarge - - r5n.24xlarge - - r6id.24xlarge - - m6id.24xlarge - - r5d.24xlarge - - c7a.24xlarge - - r7i.24xlarge - - r5d.metal - - m5n.metal - - c6i.24xlarge - - c8g.24xlarge - - dl1.24xlarge - - p3dn.24xlarge - - c6id.24xlarge - - m5.24xlarge - - dl2q.24xlarge - - m5d.metal - - g4dn.metal - - m6idn.24xlarge - - m5a.24xlarge - - m5dn.24xlarge - - p4d.24xlarge - - i3en.24xlarge - - m8g.24xlarge - - m5d.24xlarge - - r7a.24xlarge - - m5ad.24xlarge - - r6in.24xlarge - - i4i.24xlarge - - x8g.metal-24xl - - r5ad.24xlarge - - c8g.metal-24xl - - m5dn.metal - - m7i.24xlarge - - g5.24xlarge - - c5d.metal - - inf2.24xlarge - - r6a.24xlarge - - g6.24xlarge - - m6i.24xlarge - - m7a.24xlarge - - i3.metal - - c5n.metal - - c5n.18xlarge - - c5d.18xlarge - - c5.18xlarge - - x2iedn.16xlarge - - m6gd.16xlarge - - g4ad.16xlarge - - p2.16xlarge - - x2gd.16xlarge - - r5ad.16xlarge - - c6i.16xlarge - - x2gd.metal - - x1.16xlarge - - r5n.16xlarge - - r7g.16xlarge - - c7g.metal - - c7a.16xlarge - - g5g.16xlarge - - m5dn.16xlarge - - c7i.16xlarge - - m5a.16xlarge - - m7i.16xlarge - - c6id.16xlarge - - r7iz.16xlarge - - c6gd.16xlarge - - r8g.16xlarge - - c6gd.metal - - i3.16xlarge - - r6in.16xlarge - - c7g.16xlarge - - m6i.16xlarge - - m5.16xlarge - - r7a.16xlarge - - r6g.16xlarge - - m6a.16xlarge - - c6g.16xlarge - - r5b.16xlarge - - x1e.16xlarge - - m7g.16xlarge - - r5dn.16xlarge - - c8g.16xlarge - - c6a.16xlarge - - r4.16xlarge - - m5n.16xlarge - - c5a.16xlarge - - i4i.16xlarge - - f1.16xlarge - - m5d.16xlarge - - x8g.16xlarge - - m6g.metal - - m7gd.16xlarge - - r6idn.16xlarge - - c7gd.16xlarge - - m8g.16xlarge - - im4gn.16xlarge - - r6a.16xlarge - - c6gn.16xlarge - - g6.16xlarge - - r7g.metal - - g5.16xlarge - - r6i.16xlarge - - m7g.metal - - x2idn.16xlarge - - m6id.16xlarge - - r5d.16xlarge - - g6e.16xlarge - - g4dn.16xlarge - - m7gd.metal - - m7a.16xlarge - - m6g.16xlarge - - c5ad.16xlarge - - g3.16xlarge - - r7i.16xlarge - - m6gd.metal - - m5ad.16xlarge - - c7gn.16xlarge - - m6in.16xlarge - - r6gd.metal - - p3.16xlarge - - c6g.metal - - c6in.16xlarge - - r6gd.16xlarge - - r7gd.metal - - r6id.16xlarge - - r5.16xlarge - - c7gn.metal - - r7gd.16xlarge - - c7gd.metal - - i4g.16xlarge - - m4.16xlarge - - h1.16xlarge - - g5g.metal - - r7iz.metal-16xl - - r6g.metal - - m6idn.16xlarge - - r5a.16xlarge - - c7g.12xlarge - - r7gd.12xlarge - - r8g.12xlarge - - c5a.12xlarge - - d3en.12xlarge - - m7i.12xlarge - - r5.12xlarge - - c8g.12xlarge - - g5.12xlarge - - g4dn.12xlarge - - m5n.12xlarge - - r6in.12xlarge - - m8g.12xlarge - - m5.12xlarge - - m5a.12xlarge - - m7gd.12xlarge - - c5d.12xlarge - - m5zn.12xlarge - - r5a.12xlarge - - m5d.12xlarge - - m6in.12xlarge - - c6id.12xlarge - - r7iz.12xlarge - - m6gd.12xlarge - - c6in.12xlarge - - x2iezn.12xlarge - - m5ad.12xlarge - - c6gd.12xlarge - - c7gn.12xlarge - - r5n.12xlarge - - x2iezn.metal - - m5dn.12xlarge - - x2gd.12xlarge - - m5zn.metal - - i3en.12xlarge - - m6id.12xlarge - - c7a.12xlarge - - r6idn.12xlarge - - z1d.metal - - c6gn.12xlarge - - r6i.12xlarge - - g6.12xlarge - - m6i.12xlarge - - r6id.12xlarge - - r6a.12xlarge - - c6g.12xlarge - - z1d.12xlarge - - m7g.12xlarge - - r5d.12xlarge - - r5ad.12xlarge - - r6g.12xlarge - - c6a.12xlarge - - c5ad.12xlarge - - x8g.12xlarge - - r7a.12xlarge - - m6g.12xlarge - - m6a.12xlarge - - m7a.12xlarge - - r7i.12xlarge - - r5b.12xlarge - - c6i.12xlarge - - g6e.12xlarge - - c5.12xlarge - - r5dn.12xlarge - - i4i.12xlarge - - c7gd.12xlarge - - r7g.12xlarge - - r6gd.12xlarge - - c7i.12xlarge - - m6idn.12xlarge - - m4.10xlarge - - c5n.9xlarge - - d2.8xlarge - - c5d.9xlarge - - c5.9xlarge - - c4.8xlarge - - m5a.8xlarge - - c6gn.8xlarge - - g4dn.8xlarge - - m5dn.8xlarge - - c6gd.8xlarge - - r5d.8xlarge - - m5n.8xlarge - - r8g.8xlarge - - r5dn.8xlarge - - x2gd.8xlarge - - m6i.8xlarge - - r7a.8xlarge - - r3.8xlarge - - r6in.8xlarge - - i4i.8xlarge - - c6in.8xlarge - - r5.8xlarge - - r7iz.8xlarge - - c7gn.8xlarge - - x2iezn.8xlarge - - r7g.8xlarge - - r6idn.8xlarge - - g5g.8xlarge - - m6id.8xlarge - - inf2.8xlarge - - g6.8xlarge - - g5.8xlarge - - c8g.8xlarge - - r6gd.8xlarge - - c7i-flex.8xlarge - - i2.8xlarge - - r6i.8xlarge - - m7gd.8xlarge - - c7gd.8xlarge - - m6in.8xlarge - - p2.8xlarge - - im4gn.8xlarge - - m7a.8xlarge - - i4g.8xlarge - - m5d.8xlarge - - c6g.8xlarge - - c5a.8xlarge - - m6a.8xlarge - - c5ad.8xlarge - - g3.8xlarge - - d3en.8xlarge - - r7gd.8xlarge - - r6id.8xlarge - - m8g.8xlarge - - m5.8xlarge - - c6a.8xlarge - - c7a.8xlarge - - x2iedn.8xlarge - - r4.8xlarge - - c3.8xlarge - - m5ad.8xlarge - - r7i.8xlarge - - h1.8xlarge - - r6a.8xlarge - - c7g.8xlarge - - g6e.8xlarge - - r6g.8xlarge - - c7i.8xlarge - - r5a.8xlarge - - m7g.8xlarge - - is4gen.8xlarge - - gr6.8xlarge - - m6gd.8xlarge - - m7i.8xlarge - - p3.8xlarge - - r5b.8xlarge - - m6g.8xlarge - - i3.8xlarge - - m6idn.8xlarge - - x1e.8xlarge - - r5ad.8xlarge - - r5n.8xlarge - - x8g.8xlarge - - c6id.8xlarge - - g4ad.8xlarge - - d3.8xlarge - - m7i-flex.8xlarge - - c6i.8xlarge - - m5zn.6xlarge - - z1d.6xlarge - - i3en.6xlarge - - vt1.6xlarge - - d3en.6xlarge - - x2iezn.6xlarge - - inf1.6xlarge - - mac2-m1ultra.metal - - i4i.4xlarge - - r4.4xlarge - - c8g.4xlarge - - gr6.4xlarge - - c7i.4xlarge - - r5b.4xlarge - - g6e.4xlarge - - r6i.4xlarge - - d2.4xlarge - - c6g.4xlarge - - c7gn.4xlarge - - d3.4xlarge - - x2gd.4xlarge - - g4ad.4xlarge - - i3.4xlarge - - im4gn.4xlarge - - c7gd.4xlarge - - r5n.4xlarge - - m6g.4xlarge - - r6gd.4xlarge - - f1.4xlarge - - m7gd.4xlarge - - g5.4xlarge - - c6gd.4xlarge - - i4g.4xlarge - - m6gd.4xlarge - - m6a.4xlarge - - r7gd.4xlarge - - r6g.4xlarge - - m7i-flex.4xlarge - - r6a.4xlarge - - a1.4xlarge - - x1e.4xlarge - - m6in.4xlarge - - m8g.4xlarge - - c6in.4xlarge - - d3en.4xlarge - - c6i.4xlarge - - x2iedn.4xlarge - - m4.4xlarge - - m7g.4xlarge - - m6id.4xlarge - - r6in.4xlarge - - c7g.4xlarge - - r8g.4xlarge - - r3.4xlarge - - m7i.4xlarge - - r5ad.4xlarge - - r7i.4xlarge - - c5d.4xlarge - - g6.4xlarge - - m6i.4xlarge - - c6gn.4xlarge - - c7a.4xlarge - - x2iezn.4xlarge - - c5n.4xlarge - - c6id.4xlarge - - r5dn.4xlarge - - c5.4xlarge - - c5ad.4xlarge - - r5.4xlarge - - r5a.4xlarge - - m5d.4xlarge - - a1.metal - - g3.4xlarge - - x8g.4xlarge - - r5d.4xlarge - - is4gen.4xlarge - - c6a.4xlarge - - m5ad.4xlarge - - m6idn.4xlarge - - g4dn.4xlarge - - r6id.4xlarge - - r7g.4xlarge - - i2.4xlarge - - m5n.4xlarge - - h1.4xlarge - - c5a.4xlarge - - m5.4xlarge - - m7a.4xlarge - - c4.4xlarge - - r7a.4xlarge - - c7i-flex.4xlarge - - m5a.4xlarge - - g5g.4xlarge - - r7iz.4xlarge - - c3.4xlarge - - m5dn.4xlarge - - r6idn.4xlarge - - m5zn.3xlarge - - mac2-m2pro.metal - - i3en.3xlarge - - mac1.metal - - vt1.3xlarge - - z1d.3xlarge - - r6id.2xlarge - - c4.2xlarge - - x1e.2xlarge - - z1d.2xlarge - - i4g.2xlarge - - m7i-flex.2xlarge - - d3en.2xlarge - - r6in.2xlarge - - r6idn.2xlarge - - r7g.2xlarge - - r5ad.2xlarge - - g5g.2xlarge - - g4dn.2xlarge - - r7a.2xlarge - - m6id.2xlarge - - m6a.2xlarge - - r5a.2xlarge - - r3.2xlarge - - c1.xlarge - - m7g.2xlarge - - trn1.2xlarge - - x2iedn.2xlarge - - i3.2xlarge - - m8g.2xlarge - - r7i.2xlarge - - r6gd.2xlarge - - mac2.metal - - t2.2xlarge - - g6.2xlarge - - i4i.2xlarge - - m6in.2xlarge - - r6i.2xlarge - - m7gd.2xlarge - - c6in.2xlarge - - m4.2xlarge - - r8g.2xlarge - - p3.2xlarge - - c6id.2xlarge - - r5n.2xlarge - - m5a.2xlarge - - c7gn.2xlarge - - c5ad.2xlarge - - m3.2xlarge - - r6g.2xlarge - - m6g.2xlarge - - c7i.2xlarge - - t3.2xlarge - - d3.2xlarge - - is4gen.2xlarge - - m5d.2xlarge - - m2.4xlarge - - c6g.2xlarge - - g5.2xlarge - - x8g.2xlarge - - r5d.2xlarge - - c5n.2xlarge - - x2gd.2xlarge - - a1.2xlarge - - r7gd.2xlarge - - m6i.2xlarge - - c7g.2xlarge - - h1.2xlarge - - g4ad.2xlarge - - inf1.2xlarge - - c5a.2xlarge - - i2.2xlarge - - c6gd.2xlarge - - m6gd.2xlarge - - c8g.2xlarge - - f1.2xlarge - - im4gn.2xlarge - - t4g.2xlarge - - r6a.2xlarge - - m5zn.2xlarge - - r5.2xlarge - - m5n.2xlarge - - mac2-m2.metal - - c6gn.2xlarge - - m6idn.2xlarge - - m7i.2xlarge - - m5.2xlarge - - m7a.2xlarge - - c7gd.2xlarge - - r4.2xlarge - - x2iezn.2xlarge - - d2.2xlarge - - c5d.2xlarge - - r5dn.2xlarge - - t3a.2xlarge - - c6i.2xlarge - - c6a.2xlarge - - c7a.2xlarge - - c3.2xlarge - - m5dn.2xlarge - - c7i-flex.2xlarge - - g6e.2xlarge - - c5.2xlarge - - m5ad.2xlarge - - r5b.2xlarge - - i3en.2xlarge - - r7iz.2xlarge - - m5n.xlarge - - a1.xlarge - - m5dn.xlarge - - c6gn.xlarge - - r8g.xlarge - - x2iedn.xlarge - - c6a.xlarge - - m5ad.xlarge - - t3a.xlarge - - m1.xlarge - - r5d.xlarge - - m7a.xlarge - - c3.xlarge - - m7i.xlarge - - t3.xlarge - - r7iz.xlarge - - m3.xlarge - - c7gn.xlarge - - d3en.xlarge - - r6g.xlarge - - g4ad.xlarge - - i3en.xlarge - - x1e.xlarge - - d2.xlarge - - inf1.xlarge - - i2.xlarge - - r7i.xlarge - - c7g.xlarge - - m5zn.xlarge - - g5g.xlarge - - t4g.xlarge - - c5d.xlarge - - r7g.xlarge - - r5b.xlarge - - m4.xlarge - - g6e.xlarge - - t2.xlarge - - m6i.xlarge - - c4.xlarge - - m6in.xlarge - - c7i.xlarge - - r4.xlarge - - d3.xlarge - - m5.xlarge - - m6idn.xlarge - - z1d.xlarge - - g5.xlarge - - g4dn.xlarge - - c7a.xlarge - - r5dn.xlarge - - im4gn.xlarge - - c8g.xlarge - - r5a.xlarge - - r6idn.xlarge - - c7i-flex.xlarge - - r5ad.xlarge - - m2.2xlarge - - c6i.xlarge - - c5a.xlarge - - c6g.xlarge - - i4i.xlarge - - r6gd.xlarge - - m7i-flex.xlarge - - c6in.xlarge - - c7gd.xlarge - - m8g.xlarge - - r6a.xlarge - - m6id.xlarge - - g6.xlarge - - r5.xlarge - - r3.xlarge - - x2gd.xlarge - - r6i.xlarge - - i3.xlarge - - x8g.xlarge - - c5ad.xlarge - - m5d.xlarge - - p2.xlarge - - m7gd.xlarge - - m7g.xlarge - - inf2.xlarge - - c6id.xlarge - - m6gd.xlarge - - i4g.xlarge - - r7a.xlarge - - c6gd.xlarge - - r6in.xlarge - - is4gen.xlarge - - c5n.xlarge - - m6a.xlarge - - m5a.xlarge - - r5n.xlarge - - c5.xlarge - - r7gd.xlarge - - g3s.xlarge - - m6g.xlarge - - r6id.xlarge - - c5d.large - - c7g.large - - c5n.large - - c4.large - - t3a.micro - - c5.large - - m6id.large - - r7i.large - - t3a.nano - - c8g.large - - t3a.small - - t3a.large - - m7i-flex.large - - m6gd.large - - c1.medium - - c3.large - - c6in.large - - r6g.large - - r5d.large - - r5.large - - r5ad.large - - i3en.large - - t3.small - - m5a.large - - i3.large - - z1d.large - - t4g.micro - - r6in.large - - i4i.large - - t3a.medium - - m1.large - - c7gn.large - - t3.micro - - m7i.large - - c6id.large - - m6g.large - - t4g.small - - t4g.nano - - m5d.large - - c6gd.large - - x2gd.large - - t4g.medium - - m7gd.large - - t3.nano - - t3.medium - - m7g.large - - r6gd.large - - m4.large - - r8g.large - - r5dn.large - - m5.large - - c6g.large - - r4.large - - m5dn.large - - m5ad.large - - r6id.large - - a1.large - - r7a.large - - t2.large - - m6i.large - - r3.large - - m6a.large - - im4gn.large - - t4g.large - - i4g.large - - r5a.large - - t3.large - - m6in.large - - t2.medium - - m3.large - - r6idn.large - - m5n.large - - r7iz.large - - is4gen.large - - c6gn.large - - r5n.large - - r5b.large - - m2.xlarge - - c5ad.large - - c6a.large - - m6idn.large - - c6i.large - - c7gd.large - - r6a.large - - r7gd.large - - c7i.large - - c7a.large - - r7g.large - - c7i-flex.large - - m5zn.large - - m7a.large - - r6i.large - - m8g.large - - x8g.large - - c5a.large - - t2.nano - - is4gen.medium - - m1.small - - c8g.medium - - m6g.medium - - m1.medium - - r8g.medium - - c6gd.medium - - r7a.medium - - c6g.medium - - m6gd.medium - - t1.micro - - r7g.medium - - r6gd.medium - - m7g.medium - - c7gd.medium - - r7gd.medium - - m3.medium - - x2gd.medium - - c7gn.medium - - x8g.medium - - r6g.medium - - c7g.medium - - m7gd.medium - - a1.medium - - c6gn.medium - - t2.small - - t2.micro - - m7a.medium - - m8g.medium - - c7a.medium + - u7i-12tb.224xlarge + - u7in-32tb.224xlarge + - u7in-16tb.224xlarge + - u7in-24tb.224xlarge + - u-24tb1.112xlarge + - u-12tb1.112xlarge + - u-9tb1.112xlarge + - u-6tb1.112xlarge + - u-18tb1.112xlarge + - u-3tb1.56xlarge + - u-6tb1.56xlarge + - c7i.48xlarge + - r7a.metal-48xl + - c6a.metal + - r7a.48xlarge + - c7i.metal-48xl + - g6.48xlarge + - inf2.48xlarge + - m6a.48xlarge + - m7i.metal-48xl + - m8g.metal-48xl + - g5.48xlarge + - c7a.metal-48xl + - g6e.48xlarge + - c7a.48xlarge + - r8g.48xlarge + - r6a.48xlarge + - r8g.metal-48xl + - m8g.48xlarge + - c8g.metal-48xl + - p5.48xlarge + - r7i.48xlarge + - m7a.48xlarge + - r7i.metal-48xl + - m7a.metal-48xl + - r6a.metal + - c8g.48xlarge + - m6a.metal + - c6a.48xlarge + - x8g.metal-48xl + - m7i.48xlarge + - x8g.48xlarge + - c6in.metal + - c6a.32xlarge + - c6in.32xlarge + - r6a.32xlarge + - r7iz.32xlarge + - m7a.32xlarge + - m6idn.metal + - m6in.32xlarge + - m6in.metal + - r6id.metal + - r6in.32xlarge + - x2idn.metal + - c6id.metal + - x2idn.32xlarge + - m6idn.32xlarge + - r6i.metal + - r6idn.metal + - c7a.32xlarge + - m6id.metal + - x1e.32xlarge + - r7a.32xlarge + - r6i.32xlarge + - c6id.32xlarge + - x2iedn.32xlarge + - c6i.32xlarge + - r6in.metal + - i4i.32xlarge + - r7iz.metal-32xl + - x1.32xlarge + - m6i.32xlarge + - m6id.32xlarge + - i4i.metal + - x2iedn.metal + - m6i.metal + - m6a.32xlarge + - c6i.metal + - trn1n.32xlarge + - trn1.32xlarge + - r6idn.32xlarge + - r6id.32xlarge + - m6in.24xlarge + - c5.24xlarge + - m7i.metal-24xl + - c6in.24xlarge + - r7i.metal-24xl + - r5b.24xlarge + - c7i.24xlarge + - m8g.metal-24xl + - c7i.metal-24xl + - r5dn.24xlarge + - r8g.metal-24xl + - r5dn.metal + - r5.metal + - r5.24xlarge + - x2iedn.24xlarge + - c5ad.24xlarge + - x8g.24xlarge + - c5d.24xlarge + - c5a.24xlarge + - c6a.24xlarge + - r5a.24xlarge + - c5.metal + - r8g.24xlarge + - g6e.24xlarge + - r5b.metal + - m6a.24xlarge + - x2idn.24xlarge + - m5.metal + - inf1.24xlarge + - vt1.24xlarge + - r6i.24xlarge + - i3en.metal + - m5n.24xlarge + - r5n.metal + - r6idn.24xlarge + - r5n.24xlarge + - r6id.24xlarge + - m6id.24xlarge + - r5d.24xlarge + - c7a.24xlarge + - r7i.24xlarge + - r5d.metal + - m5n.metal + - c6i.24xlarge + - c8g.24xlarge + - dl1.24xlarge + - p3dn.24xlarge + - c6id.24xlarge + - m5.24xlarge + - dl2q.24xlarge + - m5d.metal + - g4dn.metal + - m6idn.24xlarge + - m5a.24xlarge + - m5dn.24xlarge + - p4d.24xlarge + - i3en.24xlarge + - m8g.24xlarge + - m5d.24xlarge + - r7a.24xlarge + - m5ad.24xlarge + - r6in.24xlarge + - i4i.24xlarge + - x8g.metal-24xl + - r5ad.24xlarge + - c8g.metal-24xl + - m5dn.metal + - m7i.24xlarge + - g5.24xlarge + - c5d.metal + - inf2.24xlarge + - r6a.24xlarge + - g6.24xlarge + - m6i.24xlarge + - m7a.24xlarge + - i3.metal + - c5n.metal + - c5n.18xlarge + - c5d.18xlarge + - c5.18xlarge + - x2iedn.16xlarge + - m6gd.16xlarge + - g4ad.16xlarge + - p2.16xlarge + - x2gd.16xlarge + - r5ad.16xlarge + - c6i.16xlarge + - x2gd.metal + - x1.16xlarge + - r5n.16xlarge + - r7g.16xlarge + - c7g.metal + - c7a.16xlarge + - g5g.16xlarge + - m5dn.16xlarge + - c7i.16xlarge + - m5a.16xlarge + - m7i.16xlarge + - c6id.16xlarge + - r7iz.16xlarge + - c6gd.16xlarge + - r8g.16xlarge + - c6gd.metal + - i3.16xlarge + - r6in.16xlarge + - c7g.16xlarge + - m6i.16xlarge + - m5.16xlarge + - r7a.16xlarge + - r6g.16xlarge + - m6a.16xlarge + - c6g.16xlarge + - r5b.16xlarge + - x1e.16xlarge + - m7g.16xlarge + - r5dn.16xlarge + - c8g.16xlarge + - c6a.16xlarge + - r4.16xlarge + - m5n.16xlarge + - c5a.16xlarge + - i4i.16xlarge + - f1.16xlarge + - m5d.16xlarge + - x8g.16xlarge + - m6g.metal + - m7gd.16xlarge + - r6idn.16xlarge + - c7gd.16xlarge + - m8g.16xlarge + - im4gn.16xlarge + - r6a.16xlarge + - c6gn.16xlarge + - g6.16xlarge + - r7g.metal + - g5.16xlarge + - r6i.16xlarge + - m7g.metal + - x2idn.16xlarge + - m6id.16xlarge + - r5d.16xlarge + - g6e.16xlarge + - g4dn.16xlarge + - m7gd.metal + - m7a.16xlarge + - m6g.16xlarge + - c5ad.16xlarge + - g3.16xlarge + - r7i.16xlarge + - m6gd.metal + - m5ad.16xlarge + - c7gn.16xlarge + - m6in.16xlarge + - r6gd.metal + - p3.16xlarge + - c6g.metal + - c6in.16xlarge + - r6gd.16xlarge + - r7gd.metal + - r6id.16xlarge + - r5.16xlarge + - c7gn.metal + - r7gd.16xlarge + - c7gd.metal + - i4g.16xlarge + - m4.16xlarge + - h1.16xlarge + - g5g.metal + - r7iz.metal-16xl + - r6g.metal + - m6idn.16xlarge + - r5a.16xlarge + - c7g.12xlarge + - r7gd.12xlarge + - r8g.12xlarge + - c5a.12xlarge + - d3en.12xlarge + - m7i.12xlarge + - r5.12xlarge + - c8g.12xlarge + - g5.12xlarge + - g4dn.12xlarge + - m5n.12xlarge + - r6in.12xlarge + - m8g.12xlarge + - m5.12xlarge + - m5a.12xlarge + - m7gd.12xlarge + - c5d.12xlarge + - m5zn.12xlarge + - r5a.12xlarge + - m5d.12xlarge + - m6in.12xlarge + - c6id.12xlarge + - r7iz.12xlarge + - m6gd.12xlarge + - c6in.12xlarge + - x2iezn.12xlarge + - m5ad.12xlarge + - c6gd.12xlarge + - c7gn.12xlarge + - r5n.12xlarge + - x2iezn.metal + - m5dn.12xlarge + - x2gd.12xlarge + - m5zn.metal + - i3en.12xlarge + - m6id.12xlarge + - c7a.12xlarge + - r6idn.12xlarge + - z1d.metal + - c6gn.12xlarge + - r6i.12xlarge + - g6.12xlarge + - m6i.12xlarge + - r6id.12xlarge + - r6a.12xlarge + - c6g.12xlarge + - z1d.12xlarge + - m7g.12xlarge + - r5d.12xlarge + - r5ad.12xlarge + - r6g.12xlarge + - c6a.12xlarge + - c5ad.12xlarge + - x8g.12xlarge + - r7a.12xlarge + - m6g.12xlarge + - m6a.12xlarge + - m7a.12xlarge + - r7i.12xlarge + - r5b.12xlarge + - c6i.12xlarge + - g6e.12xlarge + - c5.12xlarge + - r5dn.12xlarge + - i4i.12xlarge + - c7gd.12xlarge + - r7g.12xlarge + - r6gd.12xlarge + - c7i.12xlarge + - m6idn.12xlarge + - m4.10xlarge + - c5n.9xlarge + - d2.8xlarge + - c5d.9xlarge + - c5.9xlarge + - c4.8xlarge + - m5a.8xlarge + - c6gn.8xlarge + - g4dn.8xlarge + - m5dn.8xlarge + - c6gd.8xlarge + - r5d.8xlarge + - m5n.8xlarge + - r8g.8xlarge + - r5dn.8xlarge + - x2gd.8xlarge + - m6i.8xlarge + - r7a.8xlarge + - r3.8xlarge + - r6in.8xlarge + - i4i.8xlarge + - c6in.8xlarge + - r5.8xlarge + - r7iz.8xlarge + - c7gn.8xlarge + - x2iezn.8xlarge + - r7g.8xlarge + - r6idn.8xlarge + - g5g.8xlarge + - m6id.8xlarge + - inf2.8xlarge + - g6.8xlarge + - g5.8xlarge + - c8g.8xlarge + - r6gd.8xlarge + - c7i-flex.8xlarge + - i2.8xlarge + - r6i.8xlarge + - m7gd.8xlarge + - c7gd.8xlarge + - m6in.8xlarge + - p2.8xlarge + - im4gn.8xlarge + - m7a.8xlarge + - i4g.8xlarge + - m5d.8xlarge + - c6g.8xlarge + - c5a.8xlarge + - m6a.8xlarge + - c5ad.8xlarge + - g3.8xlarge + - d3en.8xlarge + - r7gd.8xlarge + - r6id.8xlarge + - m8g.8xlarge + - m5.8xlarge + - c6a.8xlarge + - c7a.8xlarge + - x2iedn.8xlarge + - r4.8xlarge + - c3.8xlarge + - m5ad.8xlarge + - r7i.8xlarge + - h1.8xlarge + - r6a.8xlarge + - c7g.8xlarge + - g6e.8xlarge + - r6g.8xlarge + - c7i.8xlarge + - r5a.8xlarge + - m7g.8xlarge + - is4gen.8xlarge + - gr6.8xlarge + - m6gd.8xlarge + - m7i.8xlarge + - p3.8xlarge + - r5b.8xlarge + - m6g.8xlarge + - i3.8xlarge + - m6idn.8xlarge + - x1e.8xlarge + - r5ad.8xlarge + - r5n.8xlarge + - x8g.8xlarge + - c6id.8xlarge + - g4ad.8xlarge + - d3.8xlarge + - m7i-flex.8xlarge + - c6i.8xlarge + - m5zn.6xlarge + - z1d.6xlarge + - i3en.6xlarge + - vt1.6xlarge + - d3en.6xlarge + - x2iezn.6xlarge + - inf1.6xlarge + - mac2-m1ultra.metal + - i4i.4xlarge + - r4.4xlarge + - c8g.4xlarge + - gr6.4xlarge + - c7i.4xlarge + - r5b.4xlarge + - g6e.4xlarge + - r6i.4xlarge + - d2.4xlarge + - c6g.4xlarge + - c7gn.4xlarge + - d3.4xlarge + - x2gd.4xlarge + - g4ad.4xlarge + - i3.4xlarge + - im4gn.4xlarge + - c7gd.4xlarge + - r5n.4xlarge + - m6g.4xlarge + - r6gd.4xlarge + - f1.4xlarge + - m7gd.4xlarge + - g5.4xlarge + - c6gd.4xlarge + - i4g.4xlarge + - m6gd.4xlarge + - m6a.4xlarge + - r7gd.4xlarge + - r6g.4xlarge + - m7i-flex.4xlarge + - r6a.4xlarge + - a1.4xlarge + - x1e.4xlarge + - m6in.4xlarge + - m8g.4xlarge + - c6in.4xlarge + - d3en.4xlarge + - c6i.4xlarge + - x2iedn.4xlarge + - m4.4xlarge + - m7g.4xlarge + - m6id.4xlarge + - r6in.4xlarge + - c7g.4xlarge + - r8g.4xlarge + - r3.4xlarge + - m7i.4xlarge + - r5ad.4xlarge + - r7i.4xlarge + - c5d.4xlarge + - g6.4xlarge + - m6i.4xlarge + - c6gn.4xlarge + - c7a.4xlarge + - x2iezn.4xlarge + - c5n.4xlarge + - c6id.4xlarge + - r5dn.4xlarge + - c5.4xlarge + - c5ad.4xlarge + - r5.4xlarge + - r5a.4xlarge + - m5d.4xlarge + - a1.metal + - g3.4xlarge + - x8g.4xlarge + - r5d.4xlarge + - is4gen.4xlarge + - c6a.4xlarge + - m5ad.4xlarge + - m6idn.4xlarge + - g4dn.4xlarge + - r6id.4xlarge + - r7g.4xlarge + - i2.4xlarge + - m5n.4xlarge + - h1.4xlarge + - c5a.4xlarge + - m5.4xlarge + - m7a.4xlarge + - c4.4xlarge + - r7a.4xlarge + - c7i-flex.4xlarge + - m5a.4xlarge + - g5g.4xlarge + - r7iz.4xlarge + - c3.4xlarge + - m5dn.4xlarge + - r6idn.4xlarge + - m5zn.3xlarge + - mac2-m2pro.metal + - i3en.3xlarge + - mac1.metal + - vt1.3xlarge + - z1d.3xlarge + - r6id.2xlarge + - c4.2xlarge + - x1e.2xlarge + - z1d.2xlarge + - i4g.2xlarge + - m7i-flex.2xlarge + - d3en.2xlarge + - r6in.2xlarge + - r6idn.2xlarge + - r7g.2xlarge + - r5ad.2xlarge + - g5g.2xlarge + - g4dn.2xlarge + - r7a.2xlarge + - m6id.2xlarge + - m6a.2xlarge + - r5a.2xlarge + - r3.2xlarge + - c1.xlarge + - m7g.2xlarge + - trn1.2xlarge + - x2iedn.2xlarge + - i3.2xlarge + - m8g.2xlarge + - r7i.2xlarge + - r6gd.2xlarge + - mac2.metal + - t2.2xlarge + - g6.2xlarge + - i4i.2xlarge + - m6in.2xlarge + - r6i.2xlarge + - m7gd.2xlarge + - c6in.2xlarge + - m4.2xlarge + - r8g.2xlarge + - p3.2xlarge + - c6id.2xlarge + - r5n.2xlarge + - m5a.2xlarge + - c7gn.2xlarge + - c5ad.2xlarge + - m3.2xlarge + - r6g.2xlarge + - m6g.2xlarge + - c7i.2xlarge + - t3.2xlarge + - d3.2xlarge + - is4gen.2xlarge + - m5d.2xlarge + - m2.4xlarge + - c6g.2xlarge + - g5.2xlarge + - x8g.2xlarge + - r5d.2xlarge + - c5n.2xlarge + - x2gd.2xlarge + - a1.2xlarge + - r7gd.2xlarge + - m6i.2xlarge + - c7g.2xlarge + - h1.2xlarge + - g4ad.2xlarge + - inf1.2xlarge + - c5a.2xlarge + - i2.2xlarge + - c6gd.2xlarge + - m6gd.2xlarge + - c8g.2xlarge + - f1.2xlarge + - im4gn.2xlarge + - t4g.2xlarge + - r6a.2xlarge + - m5zn.2xlarge + - r5.2xlarge + - m5n.2xlarge + - mac2-m2.metal + - c6gn.2xlarge + - m6idn.2xlarge + - m7i.2xlarge + - m5.2xlarge + - m7a.2xlarge + - c7gd.2xlarge + - r4.2xlarge + - x2iezn.2xlarge + - d2.2xlarge + - c5d.2xlarge + - r5dn.2xlarge + - t3a.2xlarge + - c6i.2xlarge + - c6a.2xlarge + - c7a.2xlarge + - c3.2xlarge + - m5dn.2xlarge + - c7i-flex.2xlarge + - g6e.2xlarge + - c5.2xlarge + - m5ad.2xlarge + - r5b.2xlarge + - i3en.2xlarge + - r7iz.2xlarge + - m5n.xlarge + - a1.xlarge + - m5dn.xlarge + - c6gn.xlarge + - r8g.xlarge + - x2iedn.xlarge + - c6a.xlarge + - m5ad.xlarge + - t3a.xlarge + - m1.xlarge + - r5d.xlarge + - m7a.xlarge + - c3.xlarge + - m7i.xlarge + - t3.xlarge + - r7iz.xlarge + - m3.xlarge + - c7gn.xlarge + - d3en.xlarge + - r6g.xlarge + - g4ad.xlarge + - i3en.xlarge + - x1e.xlarge + - d2.xlarge + - inf1.xlarge + - i2.xlarge + - r7i.xlarge + - c7g.xlarge + - m5zn.xlarge + - g5g.xlarge + - t4g.xlarge + - c5d.xlarge + - r7g.xlarge + - r5b.xlarge + - m4.xlarge + - g6e.xlarge + - t2.xlarge + - m6i.xlarge + - c4.xlarge + - m6in.xlarge + - c7i.xlarge + - r4.xlarge + - d3.xlarge + - m5.xlarge + - m6idn.xlarge + - z1d.xlarge + - g5.xlarge + - g4dn.xlarge + - c7a.xlarge + - r5dn.xlarge + - im4gn.xlarge + - c8g.xlarge + - r5a.xlarge + - r6idn.xlarge + - c7i-flex.xlarge + - r5ad.xlarge + - m2.2xlarge + - c6i.xlarge + - c5a.xlarge + - c6g.xlarge + - i4i.xlarge + - r6gd.xlarge + - m7i-flex.xlarge + - c6in.xlarge + - c7gd.xlarge + - m8g.xlarge + - r6a.xlarge + - m6id.xlarge + - g6.xlarge + - r5.xlarge + - r3.xlarge + - x2gd.xlarge + - r6i.xlarge + - i3.xlarge + - x8g.xlarge + - c5ad.xlarge + - m5d.xlarge + - p2.xlarge + - m7gd.xlarge + - m7g.xlarge + - inf2.xlarge + - c6id.xlarge + - m6gd.xlarge + - i4g.xlarge + - r7a.xlarge + - c6gd.xlarge + - r6in.xlarge + - is4gen.xlarge + - c5n.xlarge + - m6a.xlarge + - m5a.xlarge + - r5n.xlarge + - c5.xlarge + - r7gd.xlarge + - g3s.xlarge + - m6g.xlarge + - r6id.xlarge + - c5d.large + - c7g.large + - c5n.large + - c4.large + - t3a.micro + - c5.large + - m6id.large + - r7i.large + - t3a.nano + - c8g.large + - t3a.small + - t3a.large + - m7i-flex.large + - m6gd.large + - c1.medium + - c3.large + - c6in.large + - r6g.large + - r5d.large + - r5.large + - r5ad.large + - i3en.large + - t3.small + - m5a.large + - i3.large + - z1d.large + - t4g.micro + - r6in.large + - i4i.large + - t3a.medium + - m1.large + - c7gn.large + - t3.micro + - m7i.large + - c6id.large + - m6g.large + - t4g.small + - t4g.nano + - m5d.large + - c6gd.large + - x2gd.large + - t4g.medium + - m7gd.large + - t3.nano + - t3.medium + - m7g.large + - r6gd.large + - m4.large + - r8g.large + - r5dn.large + - m5.large + - c6g.large + - r4.large + - m5dn.large + - m5ad.large + - r6id.large + - a1.large + - r7a.large + - t2.large + - m6i.large + - r3.large + - m6a.large + - im4gn.large + - t4g.large + - i4g.large + - r5a.large + - t3.large + - m6in.large + - t2.medium + - m3.large + - r6idn.large + - m5n.large + - r7iz.large + - is4gen.large + - c6gn.large + - r5n.large + - r5b.large + - m2.xlarge + - c5ad.large + - c6a.large + - m6idn.large + - c6i.large + - c7gd.large + - r6a.large + - r7gd.large + - c7i.large + - c7a.large + - r7g.large + - c7i-flex.large + - m5zn.large + - m7a.large + - r6i.large + - m8g.large + - x8g.large + - c5a.large + - t2.nano + - is4gen.medium + - m1.small + - c8g.medium + - m6g.medium + - m1.medium + - r8g.medium + - c6gd.medium + - r7a.medium + - c6g.medium + - m6gd.medium + - t1.micro + - r7g.medium + - r6gd.medium + - m7g.medium + - c7gd.medium + - r7gd.medium + - m3.medium + - x2gd.medium + - c7gn.medium + - x8g.medium + - r6g.medium + - c7g.medium + - m7gd.medium + - a1.medium + - c6gn.medium + - t2.small + - t2.micro + - m7a.medium + - m8g.medium + - c7a.medium removedZones: [] -ubuntu_amis: - ap-northeast-1: ami-0ac6b9b2908f3e20d - ap-northeast-2: ami-042e76978adeb8c48 - ap-northeast-3: ami-0206f4f885421736f - ap-south-1: ami-09b0a86a2c84101e1 - ap-southeast-1: ami-03fa85deedfcac80b - ap-southeast-2: ami-040e71e7b8391cae4 - ca-central-1: ami-00498a47f0a5d4232 - eu-central-1: ami-0745b7d4092315796 - eu-north-1: ami-089146c5626baa6bf - eu-west-1: ami-0a422d70f727fe93e - eu-west-2: ami-03ceeb33c1e4abcd1 - eu-west-3: ami-07db896e164bc4476 - sa-east-1: ami-036f48ec20249562a - us-east-1: ami-005fc0f236362e99f - us-east-2: ami-00eb69d236edcfaf8 - us-west-1: ami-0819a8650d771b8be - us-west-2: ami-0b8c6b923777519db diff --git a/internal/clouds/aws/locations.go b/internal/clouds/aws/locations.go index 0acb1f56..7edfd59f 100644 --- a/internal/clouds/aws/locations.go +++ b/internal/clouds/aws/locations.go @@ -10,9 +10,8 @@ import ( ) type AWSData struct { - Locations []string `yaml:"locations"` - UbuntuAMIs map[string]string `yaml:"ubuntu_amis"` - VMSizes map[string][]string + Locations []string `yaml:"locations"` + VMSizes map[string][]string `yaml:"vmsizes"` } func getSortedAWSData() ([]byte, error) { @@ -28,9 +27,8 @@ func getSortedAWSData() ([]byte, error) { } awsData := AWSData{ - Locations: make([]string, 0), - UbuntuAMIs: make(map[string]string), - VMSizes: make(map[string][]string), + Locations: make([]string, 0), + VMSizes: make(map[string][]string), } // Extract locations and VM sizes @@ -48,13 +46,6 @@ func getSortedAWSData() ([]byte, error) { } } - // Extract Ubuntu AMIs - if ubuntuAMIs, ok := rawData["ubuntu_amis"].(map[interface{}]interface{}); ok { - for region, ami := range ubuntuAMIs { - awsData.UbuntuAMIs[region.(string)] = ami.(string) - } - } - // Sort locations sort.Strings(awsData.Locations) @@ -81,6 +72,11 @@ func IsValidAWSRegion(region string) bool { return false } + // Convert from possible zone to region + if len(region) > 0 && region[len(region)-1] >= 'a' && region[len(region)-1] <= 'z' { + region = region[:len(region)-1] + } + for _, loc := range awsData.Locations { if strings.EqualFold(loc, region) { return true @@ -91,30 +87,6 @@ func IsValidAWSRegion(region string) bool { return false } -func GetUbuntuAMI(region string) (string, bool) { - l := logger.Get() - data, err := getSortedAWSData() - if err != nil { - l.Warnf("Failed to get sorted AWS data: %v", err) - return "", false - } - - var awsData AWSData - err = yaml.Unmarshal(data, &awsData) - if err != nil { - l.Warnf("Failed to unmarshal AWS data: %v", err) - return "", false - } - - ami, exists := awsData.UbuntuAMIs[region] - if !exists { - l.Warnf("No Ubuntu AMI found for region: %s", region) - return "", false - } - - return ami, true -} - func IsValidAWSInstanceType(region, instanceType string) bool { l := logger.Get() data, err := getSortedAWSData() @@ -130,6 +102,11 @@ func IsValidAWSInstanceType(region, instanceType string) bool { return false } + // Convert from possible zone to region + if len(region) > 0 && region[len(region)-1] >= 'a' && region[len(region)-1] <= 'z' { + region = region[:len(region)-1] + } + instanceTypes, exists := awsData.VMSizes[region] if !exists { l.Warnf("Region not found: %s", region) diff --git a/internal/clouds/aws/locations_test.go b/internal/clouds/aws/locations_test.go index 7a93d1a1..d332880d 100644 --- a/internal/clouds/aws/locations_test.go +++ b/internal/clouds/aws/locations_test.go @@ -24,30 +24,6 @@ func TestIsValidAWSRegion(t *testing.T) { }) } } - -func TestGetUbuntuAMI(t *testing.T) { - tests := []struct { - name string - region string - expectedOK bool - }{ - {"Valid region", "us-east-1", true}, - {"Invalid region", "invalid-region", false}, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - ami, ok := GetUbuntuAMI(tt.region) - if ok != tt.expectedOK { - t.Errorf("GetUbuntuAMI(%s) ok = %v, want %v", tt.region, ok, tt.expectedOK) - } - if tt.expectedOK && ami == "" { - t.Errorf("GetUbuntuAMI(%s) returned an empty AMI for a valid region", tt.region) - } - }) - } -} - func TestIsValidAWSInstanceType(t *testing.T) { tests := []struct { name string diff --git a/internal/clouds/general/105_install_run_bacalhau.sh b/internal/clouds/general/105_install_run_bacalhau.sh index e3917710..d688d7c9 100755 --- a/internal/clouds/general/105_install_run_bacalhau.sh +++ b/internal/clouds/general/105_install_run_bacalhau.sh @@ -9,53 +9,38 @@ cat << 'EOF' > "${RUN_BACALHAU_SH}" set -euo pipefail +# Log files LOG_FILE="/var/log/bacalhau_start.log" +DEBUG_LOG_FILE="/var/log/bacalhau_start_debug.log" + +# Ensure log files are writable +touch "$LOG_FILE" "$DEBUG_LOG_FILE" +chmod 666 "$LOG_FILE" "$DEBUG_LOG_FILE" log() { echo "$(date '+%Y-%m-%d %H:%M:%S') - $1" | tee -a "$LOG_FILE" } +log_debug() { + echo "[$(date '+%Y-%m-%d %H:%M:%S')] $*" >> "$DEBUG_LOG_FILE" +} + +log_error() { + echo "[ERROR][$(date '+%Y-%m-%d %H:%M:%S')] $*" | tee -a "$LOG_FILE" >> "$DEBUG_LOG_FILE" +} # Source the configuration file if [ -f /etc/node-config ]; then # shellcheck disable=SC1091 source /etc/node-config else - log "Error: /etc/node-config file not found." + log_error "Node configuration file not found at /etc/node-config" exit 1 fi -check_orchestrators() { - if [ -z "${ORCHESTRATORS:-}" ]; then - log "Error: ORCHESTRATORS environment variable is not set." - exit 1 - fi -} - -get_current_labels() { - local config_json - config_json=$(bacalhau config list --output json) - if [ -z "$config_json" ]; then - log "Error: Failed to get Bacalhau configuration" - return 1 - fi - - local labels - labels=$(echo "$config_json" | jq -r '.[] | select(.Key == "Labels") | .Value | to_entries | map("\(.key)=\(.value)") | join(",")') - echo "$labels" -} - -start_bacalhau() { - log "Starting Bacalhau..." - - # Initialize labels with current labels from Bacalhau config - LABELS=$(get_current_labels) - if [ $? -ne 0 ]; then - log "Failed to get current labels. Proceeding with empty labels." - LABELS="" - fi - - # Read each line from node-config +# Function to get labels from node config +get_labels() { + local labels="" while IFS= read -r line do # Skip empty lines and lines starting with TOKEN @@ -66,30 +51,60 @@ start_bacalhau() { var_value=${!var_name} # Remove any quotes from the value - var_value=$(echo "$var_value" | tr -d '"') + var_value=$(echo "$var_value" | tr -d '\"') - # Append to LABELS string - LABELS="${LABELS:+$LABELS,}${var_name}=${var_value}" + # Append to labels string + labels="${labels:+$labels,}${var_name}=${var_value}" done < /etc/node-config + + echo "$labels" +} + +check_env_vars() { + local required_vars=("NODE_TYPE" "ORCHESTRATORS") + for var in "${required_vars[@]}"; do + if [ -z "${!var}" ]; then + log_error "Required environment variable $var is not set" + return 1 + fi + done + return 0 +} - # Print the labels for verification - echo "Constructed Labels:" - echo "$LABELS" +start_bacalhau() { + log "Starting Bacalhau..." + + # Get labels from configuration + LABELS=$(get_labels) + + # Validate environment + if ! check_env_vars; then + log_error "Environment validation failed" + return 1 + fi + + # Log environment for debugging + log_debug "Environment:" + log_debug "NODE_TYPE: ${NODE_TYPE}" + log_debug "ORCHESTRATORS: ${ORCHESTRATORS}" + log_debug "LABELS: ${LABELS}" if [ -n "${TOKEN:-}" ]; then ORCHESTRATORS="${TOKEN}@${ORCHESTRATORS}" fi - # Start Bacalhau + # Start Bacalhau with verbose logging /usr/local/bin/bacalhau serve \ --node-type "${NODE_TYPE}" \ --orchestrators "${ORCHESTRATORS}" \ --labels "${LABELS}" \ - >> "${LOG_FILE}" 2>&1 & + --log-level debug \ + >> "${LOG_FILE}" 2>&1 + + local exit_code=$? + log_debug "Bacalhau exit code: ${exit_code}" - local PID=$! - log "Bacalhau worker node started with PID ${PID}" - log "Labels: ${LABELS}" + return ${exit_code} } stop_bacalhau() { @@ -104,8 +119,8 @@ main() { case "${cmd}" in start) - check_orchestrators start_bacalhau + exit $? ;; stop) stop_bacalhau @@ -113,11 +128,11 @@ main() { restart) stop_bacalhau sleep 2 - check_orchestrators start_bacalhau + exit $? ;; *) - echo "Usage: $0 {start|stop|restart}" + log_error "Usage: $0 {start|stop|restart}" exit 1 ;; esac diff --git a/internal/clouds/general/bacalhau.service b/internal/clouds/general/bacalhau.service index 93e685e0..22539a99 100644 --- a/internal/clouds/general/bacalhau.service +++ b/internal/clouds/general/bacalhau.service @@ -3,14 +3,15 @@ Description=Bacalhau Compute Node After=network.target [Service] -Type=forking +Type=simple User=root Group=root EnvironmentFile=/etc/node-config ExecStart=/root/run_bacalhau.sh start ExecStop=/root/run_bacalhau.sh stop -Restart=on-failure +Restart=always RestartSec=5 +KillMode=process [Install] WantedBy=multi-user.target \ No newline at end of file diff --git a/internal/generate_cloud_data.go b/internal/generate_cloud_data.go index 3ff87f60..32c12f64 100644 --- a/internal/generate_cloud_data.go +++ b/internal/generate_cloud_data.go @@ -31,7 +31,6 @@ type CloudData struct { Locations map[string][]string `yaml:"locations"` DiskImages []DiskImage `yaml:"diskImages,omitempty"` RemovedZones []string `yaml:"removedZones"` - UbuntuAMIs map[string]string `yaml:"ubuntu_amis,omitempty"` } type lineSpinner struct { @@ -194,8 +193,7 @@ func generateAWSData(removedZones chan<- string, s *lineSpinner) error { sort.Strings(awsLocations) awsData := CloudData{ - Locations: make(map[string][]string), - UbuntuAMIs: make(map[string]string), + Locations: make(map[string][]string), } var wg sync.WaitGroup @@ -210,7 +208,6 @@ func generateAWSData(removedZones chan<- string, s *lineSpinner) error { go func() { defer wg.Done() for location := range locationChan { - amiID, err := getUbuntuAMI(location) if err != nil { errorChan <- fmt.Errorf("failed to get Ubuntu AMI for region %s: %v", location, err) continue @@ -223,7 +220,6 @@ func generateAWSData(removedZones chan<- string, s *lineSpinner) error { } mu.Lock() - awsData.UbuntuAMIs[location] = amiID awsData.Locations[location] = vmSizes mu.Unlock() } diff --git a/internal/testdata/aws.go b/internal/testdata/aws.go new file mode 100644 index 00000000..ee326690 --- /dev/null +++ b/internal/testdata/aws.go @@ -0,0 +1,262 @@ +package testdata + +import ( + "fmt" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/service/ec2" + "github.com/aws/aws-sdk-go-v2/service/ec2/types" +) + +func FakeEC2DescribeAvailabilityZonesOutput(region string) *ec2.DescribeAvailabilityZonesOutput { + return &ec2.DescribeAvailabilityZonesOutput{ + AvailabilityZones: []types.AvailabilityZone{ + { + ZoneName: aws.String(fmt.Sprintf("%sa", region)), + }, + { + ZoneName: aws.String(fmt.Sprintf("%sb", region)), + }, + }, + } +} + +func FakeEC2RunInstancesOutput() *ec2.RunInstancesOutput { + return &ec2.RunInstancesOutput{ + Instances: []types.Instance{ + { + InstanceId: aws.String("i-1234567890abcdef0"), + InstanceType: types.InstanceTypeT3Medium, + PublicIpAddress: aws.String("203.0.113.1"), + SubnetId: aws.String("subnet-12345"), + VpcId: aws.String("vpc-12345"), + State: &types.InstanceState{ + Name: types.InstanceStateNameRunning, + }, + Tags: []types.Tag{ + { + Key: aws.String("Name"), + Value: aws.String("test-instance"), + }, + }, + }, + }, + } +} + +func FakeEC2DescribeInstancesOutput() *ec2.DescribeInstancesOutput { + return &ec2.DescribeInstancesOutput{ + Reservations: []types.Reservation{ + { + Instances: []types.Instance{ + { + InstanceId: aws.String("i-1234567890abcdef0"), + InstanceType: types.InstanceTypeT3Medium, + PublicIpAddress: aws.String("203.0.113.1"), + PrivateIpAddress: aws.String("10.0.0.1"), + SubnetId: aws.String("subnet-12345"), + VpcId: aws.String("vpc-12345"), + State: &types.InstanceState{ + Name: types.InstanceStateNameRunning, + }, + Tags: []types.Tag{ + { + Key: aws.String("Name"), + Value: aws.String("test-instance"), + }, + }, + }, + }, + }, + }, + } +} + +func FakeEC2CreateVpcOutput() *ec2.CreateVpcOutput { + return &ec2.CreateVpcOutput{ + Vpc: &types.Vpc{ + VpcId: aws.String("vpc-12345"), + CidrBlock: aws.String("10.0.0.0/16"), + State: types.VpcStateAvailable, + }, + } +} + +func FakeEC2DescribeVpcsOutput() *ec2.DescribeVpcsOutput { + return &ec2.DescribeVpcsOutput{ + Vpcs: []types.Vpc{ + { + VpcId: aws.String("vpc-12345"), + CidrBlock: aws.String("10.0.0.0/16"), + State: types.VpcStateAvailable, + }, + }, + } +} + +func FakeEC2CreateSubnetOutput() *ec2.CreateSubnetOutput { + return &ec2.CreateSubnetOutput{ + Subnet: &types.Subnet{ + SubnetId: aws.String("subnet-12345"), + VpcId: aws.String("vpc-12345"), + CidrBlock: aws.String("10.0.1.0/24"), + State: types.SubnetStateAvailable, + Tags: []types.Tag{ + { + Key: aws.String("Name"), + Value: aws.String("test-subnet"), + }, + }, + }, + } +} + +func FakeEC2DescribeSubnetsOutput() *ec2.DescribeSubnetsOutput { + return &ec2.DescribeSubnetsOutput{ + Subnets: []types.Subnet{ + { + SubnetId: aws.String("subnet-12345"), + VpcId: aws.String("vpc-12345"), + CidrBlock: aws.String("10.0.1.0/24"), + State: types.SubnetStateAvailable, + Tags: []types.Tag{ + { + Key: aws.String("Name"), + Value: aws.String("test-subnet"), + }, + }, + }, + }, + } +} + +func FakeEC2CreateSecurityGroupOutput() *ec2.CreateSecurityGroupOutput { + return &ec2.CreateSecurityGroupOutput{ + GroupId: aws.String("sg-1234567890abcdef0"), + } +} + +func FakeEC2DescribeSecurityGroupsOutput() *ec2.DescribeSecurityGroupsOutput { + return &ec2.DescribeSecurityGroupsOutput{ + SecurityGroups: []types.SecurityGroup{ + { + GroupId: aws.String("sg-1234567890abcdef0"), + }, + }, + } +} + +func FakeAuthorizeSecurityGroupIngressOutput() *ec2.AuthorizeSecurityGroupIngressOutput { + return &ec2.AuthorizeSecurityGroupIngressOutput{ + Return: aws.Bool(true), + } +} + +func FakeEC2CreateInternetGatewayOutput() *ec2.CreateInternetGatewayOutput { + return &ec2.CreateInternetGatewayOutput{ + InternetGateway: &types.InternetGateway{ + InternetGatewayId: aws.String("igw-12345"), + Tags: []types.Tag{ + { + Key: aws.String("Name"), + Value: aws.String("test-igw"), + }, + }, + }, + } +} + +func FakeEC2AttachInternetGatewayOutput() *ec2.AttachInternetGatewayOutput { + return &ec2.AttachInternetGatewayOutput{} +} + +func FakeEC2CreateRouteTableOutput() *ec2.CreateRouteTableOutput { + return &ec2.CreateRouteTableOutput{ + RouteTable: &types.RouteTable{ + RouteTableId: aws.String("rtb-12345"), + VpcId: aws.String("vpc-12345"), + Routes: []types.Route{ + { + DestinationCidrBlock: aws.String("0.0.0.0/0"), + GatewayId: aws.String("igw-12345"), + State: types.RouteStateActive, + }, + }, + }, + } +} + +func FakeEC2CreateRouteOutput() *ec2.CreateRouteOutput { + return &ec2.CreateRouteOutput{ + Return: aws.Bool(true), + } +} + +func FakeEC2AssociateRouteTableOutput() *ec2.AssociateRouteTableOutput { + return &ec2.AssociateRouteTableOutput{ + AssociationId: aws.String("rtbassoc-12345"), + } +} + +func FakeEC2DescribeRouteTablesOutput() *ec2.DescribeRouteTablesOutput { + return &ec2.DescribeRouteTablesOutput{ + RouteTables: []types.RouteTable{ + { + RouteTableId: aws.String("rtb-12345"), + VpcId: aws.String("vpc-12345"), + Routes: []types.Route{ + { + DestinationCidrBlock: aws.String("0.0.0.0/0"), + GatewayId: aws.String("igw-12345"), + State: types.RouteStateActive, + }, + }, + Associations: []types.RouteTableAssociation{ + { + RouteTableId: aws.String("rtb-12345"), + RouteTableAssociationId: aws.String("rtbassoc-12345"), + Main: aws.Bool(true), + }, + }, + }, + }, + } +} + +func FakeEC2DescribeImagesOutput() *ec2.DescribeImagesOutput { + return &ec2.DescribeImagesOutput{ + Images: []types.Image{ + { + ImageId: aws.String("ami-12345"), + }, + }, + } +} + +func FakeEC2DescribeRegionsOutput() *ec2.DescribeRegionsOutput { + return &ec2.DescribeRegionsOutput{ + Regions: []types.Region{ + { + RegionName: aws.String("us-east-1"), + }, + { + RegionName: aws.String("us-east-2"), + }, + }, + } +} + +func FakeEC2DescribeVpcAttributeOutput() *ec2.DescribeVpcAttributeOutput { + return &ec2.DescribeVpcAttributeOutput{ + EnableDnsSupport: &types.AttributeBooleanValue{ + Value: aws.Bool(true), + }, + EnableDnsHostnames: &types.AttributeBooleanValue{ + Value: aws.Bool(true), + }, + } +} + +func FakeEC2ModifyVpcAttributeOutput() *ec2.ModifyVpcAttributeOutput { + return &ec2.ModifyVpcAttributeOutput{} +} diff --git a/internal/testdata/configs/aws.yaml b/internal/testdata/configs/aws.yaml new file mode 100644 index 00000000..c0fc4737 --- /dev/null +++ b/internal/testdata/configs/aws.yaml @@ -0,0 +1,40 @@ +aws: + account_id: FAKE-ACCOUNT-ID + region: us-east-1 + default_count_per_zone: 1 + default_machine_type: t3.small + disk_size_gb: 30 + machines: + - location: us-east-1 + parameters: + count: 2 + type: t3.small + - location: us-west-1 + parameters: + count: 4 + - location: us-west-2 + parameters: + type: t3.small + - location: eu-central-1 + parameters: + orchestrator: true + - location: eu-west-1 +general: + project_prefix: andaime + ssh_public_key_path: ./testdata/dummy_keys/id_ed25519.pub + ssh_private_key_path: ./testdata/dummy_keys/id_ed25519 + bacalhau_settings: + - key: compute.allowlistedlocalpaths + value: + - /tmp + - /data:rw + - key: compute.heartbeat.interval + value: 5s + - key: compute.heartbeat.infoupdateinterval + value: 6s + - key: compute.heartbeat.resourceupdateinterval + value: 7s + - key: orchestrator.nodemanager.disconnecttimeout + value: 8s + - key: jobadmissioncontrol.acceptnetworkedjobs + value: true diff --git a/internal/testdata/embed.go b/internal/testdata/embed.go index 8e0fe726..ca21a670 100644 --- a/internal/testdata/embed.go +++ b/internal/testdata/embed.go @@ -30,5 +30,16 @@ func ReadTestGCPConfig() (string, error) { return TestGCPConfig, nil } +//go:embed configs/aws.yaml +var TestAWSConfig string + +func ReadTestAWSConfig() (string, error) { + return TestAWSConfig, nil +} + //go:embed configs/config.yaml var TestGenericConfig string + +func ReadTestGenericConfig() (string, error) { + return TestGenericConfig, nil +} diff --git a/internal/testutil/ssh_utils.go b/internal/testutil/ssh_utils.go index 397f93b9..664f544c 100644 --- a/internal/testutil/ssh_utils.go +++ b/internal/testutil/ssh_utils.go @@ -6,6 +6,21 @@ import ( "github.com/bacalhau-project/andaime/internal/testdata" ) +// CreateSSHPublicPrivateKeyPairOnDisk creates temporary SSH key files for testing purposes. +// It writes predefined SSH key material to temporary files and returns their paths along with cleanup functions. +// +// Returns: +// - string: Path to the public key file +// - func(): Cleanup function for the public key file +// - string: Path to the private key file +// - func(): Cleanup function for the private key file +// +// The caller is responsible for calling both cleanup functions to remove the temporary files +// when they are no longer needed. Typically, this should be done using defer: +// +// publicKeyPath, cleanupPublic, privateKeyPath, cleanupPrivate := CreateSSHPublicPrivateKeyPairOnDisk() +// defer cleanupPublic() +// defer cleanupPrivate() func CreateSSHPublicPrivateKeyPairOnDisk() (string, func(), string, func()) { testSSHPublicKeyPath, cleanupPublicKey, err := WriteStringToTempFile( testdata.TestPublicSSHKeyMaterial, diff --git a/mocks/aws/mock_AWSInfraProviderer.go b/mocks/aws/mock_AWSInfraProviderer.go deleted file mode 100644 index f2779b8d..00000000 --- a/mocks/aws/mock_AWSInfraProviderer.go +++ /dev/null @@ -1,240 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import ( - awscdk "github.com/aws/aws-cdk-go/awscdk/v2" - aws "github.com/bacalhau-project/andaime/pkg/models/interfaces/aws" - - awsec2 "github.com/aws/aws-cdk-go/awscdk/v2/awsec2" - - mock "github.com/stretchr/testify/mock" -) - -// MockAWSInfraProviderer is an autogenerated mock type for the AWSInfraProviderer type -type MockAWSInfraProviderer struct { - mock.Mock -} - -type MockAWSInfraProviderer_Expecter struct { - mock *mock.Mock -} - -func (_m *MockAWSInfraProviderer) EXPECT() *MockAWSInfraProviderer_Expecter { - return &MockAWSInfraProviderer_Expecter{mock: &_m.Mock} -} - -// CreateVPC provides a mock function with given fields: stack -func (_m *MockAWSInfraProviderer) CreateVPC(stack awscdk.Stack) awsec2.IVpc { - ret := _m.Called(stack) - - if len(ret) == 0 { - panic("no return value specified for CreateVPC") - } - - var r0 awsec2.IVpc - if rf, ok := ret.Get(0).(func(awscdk.Stack) awsec2.IVpc); ok { - r0 = rf(stack) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(awsec2.IVpc) - } - } - - return r0 -} - -// MockAWSInfraProviderer_CreateVPC_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateVPC' -type MockAWSInfraProviderer_CreateVPC_Call struct { - *mock.Call -} - -// CreateVPC is a helper method to define mock.On call -// - stack awscdk.Stack -func (_e *MockAWSInfraProviderer_Expecter) CreateVPC(stack interface{}) *MockAWSInfraProviderer_CreateVPC_Call { - return &MockAWSInfraProviderer_CreateVPC_Call{Call: _e.mock.On("CreateVPC", stack)} -} - -func (_c *MockAWSInfraProviderer_CreateVPC_Call) Run(run func(stack awscdk.Stack)) *MockAWSInfraProviderer_CreateVPC_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(awscdk.Stack)) - }) - return _c -} - -func (_c *MockAWSInfraProviderer_CreateVPC_Call) Return(_a0 awsec2.IVpc) *MockAWSInfraProviderer_CreateVPC_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockAWSInfraProviderer_CreateVPC_Call) RunAndReturn(run func(awscdk.Stack) awsec2.IVpc) *MockAWSInfraProviderer_CreateVPC_Call { - _c.Call.Return(run) - return _c -} - -// GetCloudFormationClient provides a mock function with given fields: -func (_m *MockAWSInfraProviderer) GetCloudFormationClient() aws.CloudFormationAPIer { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetCloudFormationClient") - } - - var r0 aws.CloudFormationAPIer - if rf, ok := ret.Get(0).(func() aws.CloudFormationAPIer); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(aws.CloudFormationAPIer) - } - } - - return r0 -} - -// MockAWSInfraProviderer_GetCloudFormationClient_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCloudFormationClient' -type MockAWSInfraProviderer_GetCloudFormationClient_Call struct { - *mock.Call -} - -// GetCloudFormationClient is a helper method to define mock.On call -func (_e *MockAWSInfraProviderer_Expecter) GetCloudFormationClient() *MockAWSInfraProviderer_GetCloudFormationClient_Call { - return &MockAWSInfraProviderer_GetCloudFormationClient_Call{Call: _e.mock.On("GetCloudFormationClient")} -} - -func (_c *MockAWSInfraProviderer_GetCloudFormationClient_Call) Run(run func()) *MockAWSInfraProviderer_GetCloudFormationClient_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockAWSInfraProviderer_GetCloudFormationClient_Call) Return(_a0 aws.CloudFormationAPIer) *MockAWSInfraProviderer_GetCloudFormationClient_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockAWSInfraProviderer_GetCloudFormationClient_Call) RunAndReturn(run func() aws.CloudFormationAPIer) *MockAWSInfraProviderer_GetCloudFormationClient_Call { - _c.Call.Return(run) - return _c -} - -// NewStack provides a mock function with given fields: scope, id, props -func (_m *MockAWSInfraProviderer) NewStack(scope awscdk.App, id string, props *awscdk.StackProps) awscdk.Stack { - ret := _m.Called(scope, id, props) - - if len(ret) == 0 { - panic("no return value specified for NewStack") - } - - var r0 awscdk.Stack - if rf, ok := ret.Get(0).(func(awscdk.App, string, *awscdk.StackProps) awscdk.Stack); ok { - r0 = rf(scope, id, props) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(awscdk.Stack) - } - } - - return r0 -} - -// MockAWSInfraProviderer_NewStack_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewStack' -type MockAWSInfraProviderer_NewStack_Call struct { - *mock.Call -} - -// NewStack is a helper method to define mock.On call -// - scope awscdk.App -// - id string -// - props *awscdk.StackProps -func (_e *MockAWSInfraProviderer_Expecter) NewStack(scope interface{}, id interface{}, props interface{}) *MockAWSInfraProviderer_NewStack_Call { - return &MockAWSInfraProviderer_NewStack_Call{Call: _e.mock.On("NewStack", scope, id, props)} -} - -func (_c *MockAWSInfraProviderer_NewStack_Call) Run(run func(scope awscdk.App, id string, props *awscdk.StackProps)) *MockAWSInfraProviderer_NewStack_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(awscdk.App), args[1].(string), args[2].(*awscdk.StackProps)) - }) - return _c -} - -func (_c *MockAWSInfraProviderer_NewStack_Call) Return(_a0 awscdk.Stack) *MockAWSInfraProviderer_NewStack_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockAWSInfraProviderer_NewStack_Call) RunAndReturn(run func(awscdk.App, string, *awscdk.StackProps) awscdk.Stack) *MockAWSInfraProviderer_NewStack_Call { - _c.Call.Return(run) - return _c -} - -// SynthTemplate provides a mock function with given fields: app -func (_m *MockAWSInfraProviderer) SynthTemplate(app awscdk.App) (string, error) { - ret := _m.Called(app) - - if len(ret) == 0 { - panic("no return value specified for SynthTemplate") - } - - var r0 string - var r1 error - if rf, ok := ret.Get(0).(func(awscdk.App) (string, error)); ok { - return rf(app) - } - if rf, ok := ret.Get(0).(func(awscdk.App) string); ok { - r0 = rf(app) - } else { - r0 = ret.Get(0).(string) - } - - if rf, ok := ret.Get(1).(func(awscdk.App) error); ok { - r1 = rf(app) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockAWSInfraProviderer_SynthTemplate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SynthTemplate' -type MockAWSInfraProviderer_SynthTemplate_Call struct { - *mock.Call -} - -// SynthTemplate is a helper method to define mock.On call -// - app awscdk.App -func (_e *MockAWSInfraProviderer_Expecter) SynthTemplate(app interface{}) *MockAWSInfraProviderer_SynthTemplate_Call { - return &MockAWSInfraProviderer_SynthTemplate_Call{Call: _e.mock.On("SynthTemplate", app)} -} - -func (_c *MockAWSInfraProviderer_SynthTemplate_Call) Run(run func(app awscdk.App)) *MockAWSInfraProviderer_SynthTemplate_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(awscdk.App)) - }) - return _c -} - -func (_c *MockAWSInfraProviderer_SynthTemplate_Call) Return(_a0 string, _a1 error) *MockAWSInfraProviderer_SynthTemplate_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockAWSInfraProviderer_SynthTemplate_Call) RunAndReturn(run func(awscdk.App) (string, error)) *MockAWSInfraProviderer_SynthTemplate_Call { - _c.Call.Return(run) - return _c -} - -// NewMockAWSInfraProviderer creates a new instance of MockAWSInfraProviderer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewMockAWSInfraProviderer(t interface { - mock.TestingT - Cleanup(func()) -}) *MockAWSInfraProviderer { - mock := &MockAWSInfraProviderer{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/aws/mock_AWSProviderer.go b/mocks/aws/mock_AWSProviderer.go deleted file mode 100644 index 2bc78b3a..00000000 --- a/mocks/aws/mock_AWSProviderer.go +++ /dev/null @@ -1,592 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import ( - context "context" - - aws "github.com/bacalhau-project/andaime/pkg/models/interfaces/aws" - - mock "github.com/stretchr/testify/mock" - - types "github.com/aws/aws-sdk-go-v2/service/ec2/types" -) - -// MockAWSProviderer is an autogenerated mock type for the AWSProviderer type -type MockAWSProviderer struct { - mock.Mock -} - -type MockAWSProviderer_Expecter struct { - mock *mock.Mock -} - -func (_m *MockAWSProviderer) EXPECT() *MockAWSProviderer_Expecter { - return &MockAWSProviderer_Expecter{mock: &_m.Mock} -} - -// CreateDeployment provides a mock function with given fields: ctx -func (_m *MockAWSProviderer) CreateDeployment(ctx context.Context) error { - ret := _m.Called(ctx) - - if len(ret) == 0 { - panic("no return value specified for CreateDeployment") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context) error); ok { - r0 = rf(ctx) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// MockAWSProviderer_CreateDeployment_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateDeployment' -type MockAWSProviderer_CreateDeployment_Call struct { - *mock.Call -} - -// CreateDeployment is a helper method to define mock.On call -// - ctx context.Context -func (_e *MockAWSProviderer_Expecter) CreateDeployment(ctx interface{}) *MockAWSProviderer_CreateDeployment_Call { - return &MockAWSProviderer_CreateDeployment_Call{Call: _e.mock.On("CreateDeployment", ctx)} -} - -func (_c *MockAWSProviderer_CreateDeployment_Call) Run(run func(ctx context.Context)) *MockAWSProviderer_CreateDeployment_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context)) - }) - return _c -} - -func (_c *MockAWSProviderer_CreateDeployment_Call) Return(_a0 error) *MockAWSProviderer_CreateDeployment_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockAWSProviderer_CreateDeployment_Call) RunAndReturn(run func(context.Context) error) *MockAWSProviderer_CreateDeployment_Call { - _c.Call.Return(run) - return _c -} - -// CreateVPCAndSubnet provides a mock function with given fields: ctx -func (_m *MockAWSProviderer) CreateVPCAndSubnet(ctx context.Context) error { - ret := _m.Called(ctx) - - if len(ret) == 0 { - panic("no return value specified for CreateVPCAndSubnet") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context) error); ok { - r0 = rf(ctx) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// MockAWSProviderer_CreateVPCAndSubnet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateVPCAndSubnet' -type MockAWSProviderer_CreateVPCAndSubnet_Call struct { - *mock.Call -} - -// CreateVPCAndSubnet is a helper method to define mock.On call -// - ctx context.Context -func (_e *MockAWSProviderer_Expecter) CreateVPCAndSubnet(ctx interface{}) *MockAWSProviderer_CreateVPCAndSubnet_Call { - return &MockAWSProviderer_CreateVPCAndSubnet_Call{Call: _e.mock.On("CreateVPCAndSubnet", ctx)} -} - -func (_c *MockAWSProviderer_CreateVPCAndSubnet_Call) Run(run func(ctx context.Context)) *MockAWSProviderer_CreateVPCAndSubnet_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context)) - }) - return _c -} - -func (_c *MockAWSProviderer_CreateVPCAndSubnet_Call) Return(_a0 error) *MockAWSProviderer_CreateVPCAndSubnet_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockAWSProviderer_CreateVPCAndSubnet_Call) RunAndReturn(run func(context.Context) error) *MockAWSProviderer_CreateVPCAndSubnet_Call { - _c.Call.Return(run) - return _c -} - -// Destroy provides a mock function with given fields: ctx -func (_m *MockAWSProviderer) Destroy(ctx context.Context) error { - ret := _m.Called(ctx) - - if len(ret) == 0 { - panic("no return value specified for Destroy") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context) error); ok { - r0 = rf(ctx) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// MockAWSProviderer_Destroy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Destroy' -type MockAWSProviderer_Destroy_Call struct { - *mock.Call -} - -// Destroy is a helper method to define mock.On call -// - ctx context.Context -func (_e *MockAWSProviderer_Expecter) Destroy(ctx interface{}) *MockAWSProviderer_Destroy_Call { - return &MockAWSProviderer_Destroy_Call{Call: _e.mock.On("Destroy", ctx)} -} - -func (_c *MockAWSProviderer_Destroy_Call) Run(run func(ctx context.Context)) *MockAWSProviderer_Destroy_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context)) - }) - return _c -} - -func (_c *MockAWSProviderer_Destroy_Call) Return(_a0 error) *MockAWSProviderer_Destroy_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockAWSProviderer_Destroy_Call) RunAndReturn(run func(context.Context) error) *MockAWSProviderer_Destroy_Call { - _c.Call.Return(run) - return _c -} - -// GetEC2Client provides a mock function with given fields: -func (_m *MockAWSProviderer) GetEC2Client() (aws.EC2Clienter, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetEC2Client") - } - - var r0 aws.EC2Clienter - var r1 error - if rf, ok := ret.Get(0).(func() (aws.EC2Clienter, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() aws.EC2Clienter); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(aws.EC2Clienter) - } - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockAWSProviderer_GetEC2Client_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEC2Client' -type MockAWSProviderer_GetEC2Client_Call struct { - *mock.Call -} - -// GetEC2Client is a helper method to define mock.On call -func (_e *MockAWSProviderer_Expecter) GetEC2Client() *MockAWSProviderer_GetEC2Client_Call { - return &MockAWSProviderer_GetEC2Client_Call{Call: _e.mock.On("GetEC2Client")} -} - -func (_c *MockAWSProviderer_GetEC2Client_Call) Run(run func()) *MockAWSProviderer_GetEC2Client_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockAWSProviderer_GetEC2Client_Call) Return(_a0 aws.EC2Clienter, _a1 error) *MockAWSProviderer_GetEC2Client_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockAWSProviderer_GetEC2Client_Call) RunAndReturn(run func() (aws.EC2Clienter, error)) *MockAWSProviderer_GetEC2Client_Call { - _c.Call.Return(run) - return _c -} - -// GetLatestUbuntuImage provides a mock function with given fields: ctx, region -func (_m *MockAWSProviderer) GetLatestUbuntuImage(ctx context.Context, region string) (*types.Image, error) { - ret := _m.Called(ctx, region) - - if len(ret) == 0 { - panic("no return value specified for GetLatestUbuntuImage") - } - - var r0 *types.Image - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*types.Image, error)); ok { - return rf(ctx, region) - } - if rf, ok := ret.Get(0).(func(context.Context, string) *types.Image); ok { - r0 = rf(ctx, region) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.Image) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, region) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockAWSProviderer_GetLatestUbuntuImage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLatestUbuntuImage' -type MockAWSProviderer_GetLatestUbuntuImage_Call struct { - *mock.Call -} - -// GetLatestUbuntuImage is a helper method to define mock.On call -// - ctx context.Context -// - region string -func (_e *MockAWSProviderer_Expecter) GetLatestUbuntuImage(ctx interface{}, region interface{}) *MockAWSProviderer_GetLatestUbuntuImage_Call { - return &MockAWSProviderer_GetLatestUbuntuImage_Call{Call: _e.mock.On("GetLatestUbuntuImage", ctx, region)} -} - -func (_c *MockAWSProviderer_GetLatestUbuntuImage_Call) Run(run func(ctx context.Context, region string)) *MockAWSProviderer_GetLatestUbuntuImage_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string)) - }) - return _c -} - -func (_c *MockAWSProviderer_GetLatestUbuntuImage_Call) Return(_a0 *types.Image, _a1 error) *MockAWSProviderer_GetLatestUbuntuImage_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockAWSProviderer_GetLatestUbuntuImage_Call) RunAndReturn(run func(context.Context, string) (*types.Image, error)) *MockAWSProviderer_GetLatestUbuntuImage_Call { - _c.Call.Return(run) - return _c -} - -// GetVMExternalIP provides a mock function with given fields: ctx, instanceID -func (_m *MockAWSProviderer) GetVMExternalIP(ctx context.Context, instanceID string) (string, error) { - ret := _m.Called(ctx, instanceID) - - if len(ret) == 0 { - panic("no return value specified for GetVMExternalIP") - } - - var r0 string - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (string, error)); ok { - return rf(ctx, instanceID) - } - if rf, ok := ret.Get(0).(func(context.Context, string) string); ok { - r0 = rf(ctx, instanceID) - } else { - r0 = ret.Get(0).(string) - } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, instanceID) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockAWSProviderer_GetVMExternalIP_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetVMExternalIP' -type MockAWSProviderer_GetVMExternalIP_Call struct { - *mock.Call -} - -// GetVMExternalIP is a helper method to define mock.On call -// - ctx context.Context -// - instanceID string -func (_e *MockAWSProviderer_Expecter) GetVMExternalIP(ctx interface{}, instanceID interface{}) *MockAWSProviderer_GetVMExternalIP_Call { - return &MockAWSProviderer_GetVMExternalIP_Call{Call: _e.mock.On("GetVMExternalIP", ctx, instanceID)} -} - -func (_c *MockAWSProviderer_GetVMExternalIP_Call) Run(run func(ctx context.Context, instanceID string)) *MockAWSProviderer_GetVMExternalIP_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string)) - }) - return _c -} - -func (_c *MockAWSProviderer_GetVMExternalIP_Call) Return(_a0 string, _a1 error) *MockAWSProviderer_GetVMExternalIP_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockAWSProviderer_GetVMExternalIP_Call) RunAndReturn(run func(context.Context, string) (string, error)) *MockAWSProviderer_GetVMExternalIP_Call { - _c.Call.Return(run) - return _c -} - -// ListDeployments provides a mock function with given fields: ctx -func (_m *MockAWSProviderer) ListDeployments(ctx context.Context) ([]string, error) { - ret := _m.Called(ctx) - - if len(ret) == 0 { - panic("no return value specified for ListDeployments") - } - - var r0 []string - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) ([]string, error)); ok { - return rf(ctx) - } - if rf, ok := ret.Get(0).(func(context.Context) []string); ok { - r0 = rf(ctx) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]string) - } - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(ctx) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockAWSProviderer_ListDeployments_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListDeployments' -type MockAWSProviderer_ListDeployments_Call struct { - *mock.Call -} - -// ListDeployments is a helper method to define mock.On call -// - ctx context.Context -func (_e *MockAWSProviderer_Expecter) ListDeployments(ctx interface{}) *MockAWSProviderer_ListDeployments_Call { - return &MockAWSProviderer_ListDeployments_Call{Call: _e.mock.On("ListDeployments", ctx)} -} - -func (_c *MockAWSProviderer_ListDeployments_Call) Run(run func(ctx context.Context)) *MockAWSProviderer_ListDeployments_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context)) - }) - return _c -} - -func (_c *MockAWSProviderer_ListDeployments_Call) Return(_a0 []string, _a1 error) *MockAWSProviderer_ListDeployments_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockAWSProviderer_ListDeployments_Call) RunAndReturn(run func(context.Context) ([]string, error)) *MockAWSProviderer_ListDeployments_Call { - _c.Call.Return(run) - return _c -} - -// SetEC2Client provides a mock function with given fields: client -func (_m *MockAWSProviderer) SetEC2Client(client aws.EC2Clienter) { - _m.Called(client) -} - -// MockAWSProviderer_SetEC2Client_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetEC2Client' -type MockAWSProviderer_SetEC2Client_Call struct { - *mock.Call -} - -// SetEC2Client is a helper method to define mock.On call -// - client aws.EC2Clienter -func (_e *MockAWSProviderer_Expecter) SetEC2Client(client interface{}) *MockAWSProviderer_SetEC2Client_Call { - return &MockAWSProviderer_SetEC2Client_Call{Call: _e.mock.On("SetEC2Client", client)} -} - -func (_c *MockAWSProviderer_SetEC2Client_Call) Run(run func(client aws.EC2Clienter)) *MockAWSProviderer_SetEC2Client_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(aws.EC2Clienter)) - }) - return _c -} - -func (_c *MockAWSProviderer_SetEC2Client_Call) Return() *MockAWSProviderer_SetEC2Client_Call { - _c.Call.Return() - return _c -} - -func (_c *MockAWSProviderer_SetEC2Client_Call) RunAndReturn(run func(aws.EC2Clienter)) *MockAWSProviderer_SetEC2Client_Call { - _c.Call.Return(run) - return _c -} - -// StartResourcePolling provides a mock function with given fields: ctx -func (_m *MockAWSProviderer) StartResourcePolling(ctx context.Context) error { - ret := _m.Called(ctx) - - if len(ret) == 0 { - panic("no return value specified for StartResourcePolling") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context) error); ok { - r0 = rf(ctx) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// MockAWSProviderer_StartResourcePolling_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StartResourcePolling' -type MockAWSProviderer_StartResourcePolling_Call struct { - *mock.Call -} - -// StartResourcePolling is a helper method to define mock.On call -// - ctx context.Context -func (_e *MockAWSProviderer_Expecter) StartResourcePolling(ctx interface{}) *MockAWSProviderer_StartResourcePolling_Call { - return &MockAWSProviderer_StartResourcePolling_Call{Call: _e.mock.On("StartResourcePolling", ctx)} -} - -func (_c *MockAWSProviderer_StartResourcePolling_Call) Run(run func(ctx context.Context)) *MockAWSProviderer_StartResourcePolling_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context)) - }) - return _c -} - -func (_c *MockAWSProviderer_StartResourcePolling_Call) Return(_a0 error) *MockAWSProviderer_StartResourcePolling_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockAWSProviderer_StartResourcePolling_Call) RunAndReturn(run func(context.Context) error) *MockAWSProviderer_StartResourcePolling_Call { - _c.Call.Return(run) - return _c -} - -// TerminateDeployment provides a mock function with given fields: ctx -func (_m *MockAWSProviderer) TerminateDeployment(ctx context.Context) error { - ret := _m.Called(ctx) - - if len(ret) == 0 { - panic("no return value specified for TerminateDeployment") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context) error); ok { - r0 = rf(ctx) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// MockAWSProviderer_TerminateDeployment_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TerminateDeployment' -type MockAWSProviderer_TerminateDeployment_Call struct { - *mock.Call -} - -// TerminateDeployment is a helper method to define mock.On call -// - ctx context.Context -func (_e *MockAWSProviderer_Expecter) TerminateDeployment(ctx interface{}) *MockAWSProviderer_TerminateDeployment_Call { - return &MockAWSProviderer_TerminateDeployment_Call{Call: _e.mock.On("TerminateDeployment", ctx)} -} - -func (_c *MockAWSProviderer_TerminateDeployment_Call) Run(run func(ctx context.Context)) *MockAWSProviderer_TerminateDeployment_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context)) - }) - return _c -} - -func (_c *MockAWSProviderer_TerminateDeployment_Call) Return(_a0 error) *MockAWSProviderer_TerminateDeployment_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockAWSProviderer_TerminateDeployment_Call) RunAndReturn(run func(context.Context) error) *MockAWSProviderer_TerminateDeployment_Call { - _c.Call.Return(run) - return _c -} - -// ValidateMachineType provides a mock function with given fields: ctx, location, instanceType -func (_m *MockAWSProviderer) ValidateMachineType(ctx context.Context, location string, instanceType string) (bool, error) { - ret := _m.Called(ctx, location, instanceType) - - if len(ret) == 0 { - panic("no return value specified for ValidateMachineType") - } - - var r0 bool - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, string) (bool, error)); ok { - return rf(ctx, location, instanceType) - } - if rf, ok := ret.Get(0).(func(context.Context, string, string) bool); ok { - r0 = rf(ctx, location, instanceType) - } else { - r0 = ret.Get(0).(bool) - } - - if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { - r1 = rf(ctx, location, instanceType) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockAWSProviderer_ValidateMachineType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ValidateMachineType' -type MockAWSProviderer_ValidateMachineType_Call struct { - *mock.Call -} - -// ValidateMachineType is a helper method to define mock.On call -// - ctx context.Context -// - location string -// - instanceType string -func (_e *MockAWSProviderer_Expecter) ValidateMachineType(ctx interface{}, location interface{}, instanceType interface{}) *MockAWSProviderer_ValidateMachineType_Call { - return &MockAWSProviderer_ValidateMachineType_Call{Call: _e.mock.On("ValidateMachineType", ctx, location, instanceType)} -} - -func (_c *MockAWSProviderer_ValidateMachineType_Call) Run(run func(ctx context.Context, location string, instanceType string)) *MockAWSProviderer_ValidateMachineType_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string), args[2].(string)) - }) - return _c -} - -func (_c *MockAWSProviderer_ValidateMachineType_Call) Return(_a0 bool, _a1 error) *MockAWSProviderer_ValidateMachineType_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockAWSProviderer_ValidateMachineType_Call) RunAndReturn(run func(context.Context, string, string) (bool, error)) *MockAWSProviderer_ValidateMachineType_Call { - _c.Call.Return(run) - return _c -} - -// NewMockAWSProviderer creates a new instance of MockAWSProviderer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewMockAWSProviderer(t interface { - mock.TestingT - Cleanup(func()) -}) *MockAWSProviderer { - mock := &MockAWSProviderer{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/aws/mock_CDKStackProviderer.go b/mocks/aws/mock_CDKStackProviderer.go deleted file mode 100644 index 312bfb8b..00000000 --- a/mocks/aws/mock_CDKStackProviderer.go +++ /dev/null @@ -1,141 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import ( - awscdk "github.com/aws/aws-cdk-go/awscdk/v2" - mock "github.com/stretchr/testify/mock" -) - -// MockCDKStackProviderer is an autogenerated mock type for the CDKStackProviderer type -type MockCDKStackProviderer struct { - mock.Mock -} - -type MockCDKStackProviderer_Expecter struct { - mock *mock.Mock -} - -func (_m *MockCDKStackProviderer) EXPECT() *MockCDKStackProviderer_Expecter { - return &MockCDKStackProviderer_Expecter{mock: &_m.Mock} -} - -// GetTemplate provides a mock function with given fields: stack -func (_m *MockCDKStackProviderer) GetTemplate(stack awscdk.Stack) (string, error) { - ret := _m.Called(stack) - - if len(ret) == 0 { - panic("no return value specified for GetTemplate") - } - - var r0 string - var r1 error - if rf, ok := ret.Get(0).(func(awscdk.Stack) (string, error)); ok { - return rf(stack) - } - if rf, ok := ret.Get(0).(func(awscdk.Stack) string); ok { - r0 = rf(stack) - } else { - r0 = ret.Get(0).(string) - } - - if rf, ok := ret.Get(1).(func(awscdk.Stack) error); ok { - r1 = rf(stack) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockCDKStackProviderer_GetTemplate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTemplate' -type MockCDKStackProviderer_GetTemplate_Call struct { - *mock.Call -} - -// GetTemplate is a helper method to define mock.On call -// - stack awscdk.Stack -func (_e *MockCDKStackProviderer_Expecter) GetTemplate(stack interface{}) *MockCDKStackProviderer_GetTemplate_Call { - return &MockCDKStackProviderer_GetTemplate_Call{Call: _e.mock.On("GetTemplate", stack)} -} - -func (_c *MockCDKStackProviderer_GetTemplate_Call) Run(run func(stack awscdk.Stack)) *MockCDKStackProviderer_GetTemplate_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(awscdk.Stack)) - }) - return _c -} - -func (_c *MockCDKStackProviderer_GetTemplate_Call) Return(_a0 string, _a1 error) *MockCDKStackProviderer_GetTemplate_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockCDKStackProviderer_GetTemplate_Call) RunAndReturn(run func(awscdk.Stack) (string, error)) *MockCDKStackProviderer_GetTemplate_Call { - _c.Call.Return(run) - return _c -} - -// NewStack provides a mock function with given fields: scope, id, props -func (_m *MockCDKStackProviderer) NewStack(scope awscdk.App, id string, props *awscdk.StackProps) awscdk.Stack { - ret := _m.Called(scope, id, props) - - if len(ret) == 0 { - panic("no return value specified for NewStack") - } - - var r0 awscdk.Stack - if rf, ok := ret.Get(0).(func(awscdk.App, string, *awscdk.StackProps) awscdk.Stack); ok { - r0 = rf(scope, id, props) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(awscdk.Stack) - } - } - - return r0 -} - -// MockCDKStackProviderer_NewStack_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewStack' -type MockCDKStackProviderer_NewStack_Call struct { - *mock.Call -} - -// NewStack is a helper method to define mock.On call -// - scope awscdk.App -// - id string -// - props *awscdk.StackProps -func (_e *MockCDKStackProviderer_Expecter) NewStack(scope interface{}, id interface{}, props interface{}) *MockCDKStackProviderer_NewStack_Call { - return &MockCDKStackProviderer_NewStack_Call{Call: _e.mock.On("NewStack", scope, id, props)} -} - -func (_c *MockCDKStackProviderer_NewStack_Call) Run(run func(scope awscdk.App, id string, props *awscdk.StackProps)) *MockCDKStackProviderer_NewStack_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(awscdk.App), args[1].(string), args[2].(*awscdk.StackProps)) - }) - return _c -} - -func (_c *MockCDKStackProviderer_NewStack_Call) Return(_a0 awscdk.Stack) *MockCDKStackProviderer_NewStack_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockCDKStackProviderer_NewStack_Call) RunAndReturn(run func(awscdk.App, string, *awscdk.StackProps) awscdk.Stack) *MockCDKStackProviderer_NewStack_Call { - _c.Call.Return(run) - return _c -} - -// NewMockCDKStackProviderer creates a new instance of MockCDKStackProviderer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewMockCDKStackProviderer(t interface { - mock.TestingT - Cleanup(func()) -}) *MockCDKStackProviderer { - mock := &MockCDKStackProviderer{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/aws/mock_CloudFormationAPIer.go b/mocks/aws/mock_CloudFormationAPIer.go deleted file mode 100644 index ae550bed..00000000 --- a/mocks/aws/mock_CloudFormationAPIer.go +++ /dev/null @@ -1,556 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import ( - context "context" - - cloudformation "github.com/aws/aws-sdk-go-v2/service/cloudformation" - - mock "github.com/stretchr/testify/mock" -) - -// MockCloudFormationAPIer is an autogenerated mock type for the CloudFormationAPIer type -type MockCloudFormationAPIer struct { - mock.Mock -} - -type MockCloudFormationAPIer_Expecter struct { - mock *mock.Mock -} - -func (_m *MockCloudFormationAPIer) EXPECT() *MockCloudFormationAPIer_Expecter { - return &MockCloudFormationAPIer_Expecter{mock: &_m.Mock} -} - -// CreateStack provides a mock function with given fields: ctx, params, opts -func (_m *MockCloudFormationAPIer) CreateStack(ctx context.Context, params *cloudformation.CreateStackInput, opts ...func(*cloudformation.Options)) (*cloudformation.CreateStackOutput, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] - } - var _ca []interface{} - _ca = append(_ca, ctx, params) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - if len(ret) == 0 { - panic("no return value specified for CreateStack") - } - - var r0 *cloudformation.CreateStackOutput - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *cloudformation.CreateStackInput, ...func(*cloudformation.Options)) (*cloudformation.CreateStackOutput, error)); ok { - return rf(ctx, params, opts...) - } - if rf, ok := ret.Get(0).(func(context.Context, *cloudformation.CreateStackInput, ...func(*cloudformation.Options)) *cloudformation.CreateStackOutput); ok { - r0 = rf(ctx, params, opts...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*cloudformation.CreateStackOutput) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *cloudformation.CreateStackInput, ...func(*cloudformation.Options)) error); ok { - r1 = rf(ctx, params, opts...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockCloudFormationAPIer_CreateStack_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateStack' -type MockCloudFormationAPIer_CreateStack_Call struct { - *mock.Call -} - -// CreateStack is a helper method to define mock.On call -// - ctx context.Context -// - params *cloudformation.CreateStackInput -// - opts ...func(*cloudformation.Options) -func (_e *MockCloudFormationAPIer_Expecter) CreateStack(ctx interface{}, params interface{}, opts ...interface{}) *MockCloudFormationAPIer_CreateStack_Call { - return &MockCloudFormationAPIer_CreateStack_Call{Call: _e.mock.On("CreateStack", - append([]interface{}{ctx, params}, opts...)...)} -} - -func (_c *MockCloudFormationAPIer_CreateStack_Call) Run(run func(ctx context.Context, params *cloudformation.CreateStackInput, opts ...func(*cloudformation.Options))) *MockCloudFormationAPIer_CreateStack_Call { - _c.Call.Run(func(args mock.Arguments) { - variadicArgs := make([]func(*cloudformation.Options), len(args)-2) - for i, a := range args[2:] { - if a != nil { - variadicArgs[i] = a.(func(*cloudformation.Options)) - } - } - run(args[0].(context.Context), args[1].(*cloudformation.CreateStackInput), variadicArgs...) - }) - return _c -} - -func (_c *MockCloudFormationAPIer_CreateStack_Call) Return(_a0 *cloudformation.CreateStackOutput, _a1 error) *MockCloudFormationAPIer_CreateStack_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockCloudFormationAPIer_CreateStack_Call) RunAndReturn(run func(context.Context, *cloudformation.CreateStackInput, ...func(*cloudformation.Options)) (*cloudformation.CreateStackOutput, error)) *MockCloudFormationAPIer_CreateStack_Call { - _c.Call.Return(run) - return _c -} - -// DeleteStack provides a mock function with given fields: ctx, params, opts -func (_m *MockCloudFormationAPIer) DeleteStack(ctx context.Context, params *cloudformation.DeleteStackInput, opts ...func(*cloudformation.Options)) (*cloudformation.DeleteStackOutput, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] - } - var _ca []interface{} - _ca = append(_ca, ctx, params) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - if len(ret) == 0 { - panic("no return value specified for DeleteStack") - } - - var r0 *cloudformation.DeleteStackOutput - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *cloudformation.DeleteStackInput, ...func(*cloudformation.Options)) (*cloudformation.DeleteStackOutput, error)); ok { - return rf(ctx, params, opts...) - } - if rf, ok := ret.Get(0).(func(context.Context, *cloudformation.DeleteStackInput, ...func(*cloudformation.Options)) *cloudformation.DeleteStackOutput); ok { - r0 = rf(ctx, params, opts...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*cloudformation.DeleteStackOutput) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *cloudformation.DeleteStackInput, ...func(*cloudformation.Options)) error); ok { - r1 = rf(ctx, params, opts...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockCloudFormationAPIer_DeleteStack_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteStack' -type MockCloudFormationAPIer_DeleteStack_Call struct { - *mock.Call -} - -// DeleteStack is a helper method to define mock.On call -// - ctx context.Context -// - params *cloudformation.DeleteStackInput -// - opts ...func(*cloudformation.Options) -func (_e *MockCloudFormationAPIer_Expecter) DeleteStack(ctx interface{}, params interface{}, opts ...interface{}) *MockCloudFormationAPIer_DeleteStack_Call { - return &MockCloudFormationAPIer_DeleteStack_Call{Call: _e.mock.On("DeleteStack", - append([]interface{}{ctx, params}, opts...)...)} -} - -func (_c *MockCloudFormationAPIer_DeleteStack_Call) Run(run func(ctx context.Context, params *cloudformation.DeleteStackInput, opts ...func(*cloudformation.Options))) *MockCloudFormationAPIer_DeleteStack_Call { - _c.Call.Run(func(args mock.Arguments) { - variadicArgs := make([]func(*cloudformation.Options), len(args)-2) - for i, a := range args[2:] { - if a != nil { - variadicArgs[i] = a.(func(*cloudformation.Options)) - } - } - run(args[0].(context.Context), args[1].(*cloudformation.DeleteStackInput), variadicArgs...) - }) - return _c -} - -func (_c *MockCloudFormationAPIer_DeleteStack_Call) Return(_a0 *cloudformation.DeleteStackOutput, _a1 error) *MockCloudFormationAPIer_DeleteStack_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockCloudFormationAPIer_DeleteStack_Call) RunAndReturn(run func(context.Context, *cloudformation.DeleteStackInput, ...func(*cloudformation.Options)) (*cloudformation.DeleteStackOutput, error)) *MockCloudFormationAPIer_DeleteStack_Call { - _c.Call.Return(run) - return _c -} - -// DescribeStackEvents provides a mock function with given fields: ctx, params, opts -func (_m *MockCloudFormationAPIer) DescribeStackEvents(ctx context.Context, params *cloudformation.DescribeStackEventsInput, opts ...func(*cloudformation.Options)) (*cloudformation.DescribeStackEventsOutput, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] - } - var _ca []interface{} - _ca = append(_ca, ctx, params) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - if len(ret) == 0 { - panic("no return value specified for DescribeStackEvents") - } - - var r0 *cloudformation.DescribeStackEventsOutput - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *cloudformation.DescribeStackEventsInput, ...func(*cloudformation.Options)) (*cloudformation.DescribeStackEventsOutput, error)); ok { - return rf(ctx, params, opts...) - } - if rf, ok := ret.Get(0).(func(context.Context, *cloudformation.DescribeStackEventsInput, ...func(*cloudformation.Options)) *cloudformation.DescribeStackEventsOutput); ok { - r0 = rf(ctx, params, opts...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*cloudformation.DescribeStackEventsOutput) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *cloudformation.DescribeStackEventsInput, ...func(*cloudformation.Options)) error); ok { - r1 = rf(ctx, params, opts...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockCloudFormationAPIer_DescribeStackEvents_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DescribeStackEvents' -type MockCloudFormationAPIer_DescribeStackEvents_Call struct { - *mock.Call -} - -// DescribeStackEvents is a helper method to define mock.On call -// - ctx context.Context -// - params *cloudformation.DescribeStackEventsInput -// - opts ...func(*cloudformation.Options) -func (_e *MockCloudFormationAPIer_Expecter) DescribeStackEvents(ctx interface{}, params interface{}, opts ...interface{}) *MockCloudFormationAPIer_DescribeStackEvents_Call { - return &MockCloudFormationAPIer_DescribeStackEvents_Call{Call: _e.mock.On("DescribeStackEvents", - append([]interface{}{ctx, params}, opts...)...)} -} - -func (_c *MockCloudFormationAPIer_DescribeStackEvents_Call) Run(run func(ctx context.Context, params *cloudformation.DescribeStackEventsInput, opts ...func(*cloudformation.Options))) *MockCloudFormationAPIer_DescribeStackEvents_Call { - _c.Call.Run(func(args mock.Arguments) { - variadicArgs := make([]func(*cloudformation.Options), len(args)-2) - for i, a := range args[2:] { - if a != nil { - variadicArgs[i] = a.(func(*cloudformation.Options)) - } - } - run(args[0].(context.Context), args[1].(*cloudformation.DescribeStackEventsInput), variadicArgs...) - }) - return _c -} - -func (_c *MockCloudFormationAPIer_DescribeStackEvents_Call) Return(_a0 *cloudformation.DescribeStackEventsOutput, _a1 error) *MockCloudFormationAPIer_DescribeStackEvents_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockCloudFormationAPIer_DescribeStackEvents_Call) RunAndReturn(run func(context.Context, *cloudformation.DescribeStackEventsInput, ...func(*cloudformation.Options)) (*cloudformation.DescribeStackEventsOutput, error)) *MockCloudFormationAPIer_DescribeStackEvents_Call { - _c.Call.Return(run) - return _c -} - -// DescribeStacks provides a mock function with given fields: ctx, params, opts -func (_m *MockCloudFormationAPIer) DescribeStacks(ctx context.Context, params *cloudformation.DescribeStacksInput, opts ...func(*cloudformation.Options)) (*cloudformation.DescribeStacksOutput, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] - } - var _ca []interface{} - _ca = append(_ca, ctx, params) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - if len(ret) == 0 { - panic("no return value specified for DescribeStacks") - } - - var r0 *cloudformation.DescribeStacksOutput - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *cloudformation.DescribeStacksInput, ...func(*cloudformation.Options)) (*cloudformation.DescribeStacksOutput, error)); ok { - return rf(ctx, params, opts...) - } - if rf, ok := ret.Get(0).(func(context.Context, *cloudformation.DescribeStacksInput, ...func(*cloudformation.Options)) *cloudformation.DescribeStacksOutput); ok { - r0 = rf(ctx, params, opts...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*cloudformation.DescribeStacksOutput) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *cloudformation.DescribeStacksInput, ...func(*cloudformation.Options)) error); ok { - r1 = rf(ctx, params, opts...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockCloudFormationAPIer_DescribeStacks_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DescribeStacks' -type MockCloudFormationAPIer_DescribeStacks_Call struct { - *mock.Call -} - -// DescribeStacks is a helper method to define mock.On call -// - ctx context.Context -// - params *cloudformation.DescribeStacksInput -// - opts ...func(*cloudformation.Options) -func (_e *MockCloudFormationAPIer_Expecter) DescribeStacks(ctx interface{}, params interface{}, opts ...interface{}) *MockCloudFormationAPIer_DescribeStacks_Call { - return &MockCloudFormationAPIer_DescribeStacks_Call{Call: _e.mock.On("DescribeStacks", - append([]interface{}{ctx, params}, opts...)...)} -} - -func (_c *MockCloudFormationAPIer_DescribeStacks_Call) Run(run func(ctx context.Context, params *cloudformation.DescribeStacksInput, opts ...func(*cloudformation.Options))) *MockCloudFormationAPIer_DescribeStacks_Call { - _c.Call.Run(func(args mock.Arguments) { - variadicArgs := make([]func(*cloudformation.Options), len(args)-2) - for i, a := range args[2:] { - if a != nil { - variadicArgs[i] = a.(func(*cloudformation.Options)) - } - } - run(args[0].(context.Context), args[1].(*cloudformation.DescribeStacksInput), variadicArgs...) - }) - return _c -} - -func (_c *MockCloudFormationAPIer_DescribeStacks_Call) Return(_a0 *cloudformation.DescribeStacksOutput, _a1 error) *MockCloudFormationAPIer_DescribeStacks_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockCloudFormationAPIer_DescribeStacks_Call) RunAndReturn(run func(context.Context, *cloudformation.DescribeStacksInput, ...func(*cloudformation.Options)) (*cloudformation.DescribeStacksOutput, error)) *MockCloudFormationAPIer_DescribeStacks_Call { - _c.Call.Return(run) - return _c -} - -// GetTemplate provides a mock function with given fields: ctx, params, opts -func (_m *MockCloudFormationAPIer) GetTemplate(ctx context.Context, params *cloudformation.GetTemplateInput, opts ...func(*cloudformation.Options)) (*cloudformation.GetTemplateOutput, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] - } - var _ca []interface{} - _ca = append(_ca, ctx, params) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - if len(ret) == 0 { - panic("no return value specified for GetTemplate") - } - - var r0 *cloudformation.GetTemplateOutput - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *cloudformation.GetTemplateInput, ...func(*cloudformation.Options)) (*cloudformation.GetTemplateOutput, error)); ok { - return rf(ctx, params, opts...) - } - if rf, ok := ret.Get(0).(func(context.Context, *cloudformation.GetTemplateInput, ...func(*cloudformation.Options)) *cloudformation.GetTemplateOutput); ok { - r0 = rf(ctx, params, opts...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*cloudformation.GetTemplateOutput) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *cloudformation.GetTemplateInput, ...func(*cloudformation.Options)) error); ok { - r1 = rf(ctx, params, opts...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockCloudFormationAPIer_GetTemplate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTemplate' -type MockCloudFormationAPIer_GetTemplate_Call struct { - *mock.Call -} - -// GetTemplate is a helper method to define mock.On call -// - ctx context.Context -// - params *cloudformation.GetTemplateInput -// - opts ...func(*cloudformation.Options) -func (_e *MockCloudFormationAPIer_Expecter) GetTemplate(ctx interface{}, params interface{}, opts ...interface{}) *MockCloudFormationAPIer_GetTemplate_Call { - return &MockCloudFormationAPIer_GetTemplate_Call{Call: _e.mock.On("GetTemplate", - append([]interface{}{ctx, params}, opts...)...)} -} - -func (_c *MockCloudFormationAPIer_GetTemplate_Call) Run(run func(ctx context.Context, params *cloudformation.GetTemplateInput, opts ...func(*cloudformation.Options))) *MockCloudFormationAPIer_GetTemplate_Call { - _c.Call.Run(func(args mock.Arguments) { - variadicArgs := make([]func(*cloudformation.Options), len(args)-2) - for i, a := range args[2:] { - if a != nil { - variadicArgs[i] = a.(func(*cloudformation.Options)) - } - } - run(args[0].(context.Context), args[1].(*cloudformation.GetTemplateInput), variadicArgs...) - }) - return _c -} - -func (_c *MockCloudFormationAPIer_GetTemplate_Call) Return(_a0 *cloudformation.GetTemplateOutput, _a1 error) *MockCloudFormationAPIer_GetTemplate_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockCloudFormationAPIer_GetTemplate_Call) RunAndReturn(run func(context.Context, *cloudformation.GetTemplateInput, ...func(*cloudformation.Options)) (*cloudformation.GetTemplateOutput, error)) *MockCloudFormationAPIer_GetTemplate_Call { - _c.Call.Return(run) - return _c -} - -// ListStacks provides a mock function with given fields: ctx, params, opts -func (_m *MockCloudFormationAPIer) ListStacks(ctx context.Context, params *cloudformation.ListStacksInput, opts ...func(*cloudformation.Options)) (*cloudformation.ListStacksOutput, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] - } - var _ca []interface{} - _ca = append(_ca, ctx, params) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - if len(ret) == 0 { - panic("no return value specified for ListStacks") - } - - var r0 *cloudformation.ListStacksOutput - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *cloudformation.ListStacksInput, ...func(*cloudformation.Options)) (*cloudformation.ListStacksOutput, error)); ok { - return rf(ctx, params, opts...) - } - if rf, ok := ret.Get(0).(func(context.Context, *cloudformation.ListStacksInput, ...func(*cloudformation.Options)) *cloudformation.ListStacksOutput); ok { - r0 = rf(ctx, params, opts...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*cloudformation.ListStacksOutput) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *cloudformation.ListStacksInput, ...func(*cloudformation.Options)) error); ok { - r1 = rf(ctx, params, opts...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockCloudFormationAPIer_ListStacks_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListStacks' -type MockCloudFormationAPIer_ListStacks_Call struct { - *mock.Call -} - -// ListStacks is a helper method to define mock.On call -// - ctx context.Context -// - params *cloudformation.ListStacksInput -// - opts ...func(*cloudformation.Options) -func (_e *MockCloudFormationAPIer_Expecter) ListStacks(ctx interface{}, params interface{}, opts ...interface{}) *MockCloudFormationAPIer_ListStacks_Call { - return &MockCloudFormationAPIer_ListStacks_Call{Call: _e.mock.On("ListStacks", - append([]interface{}{ctx, params}, opts...)...)} -} - -func (_c *MockCloudFormationAPIer_ListStacks_Call) Run(run func(ctx context.Context, params *cloudformation.ListStacksInput, opts ...func(*cloudformation.Options))) *MockCloudFormationAPIer_ListStacks_Call { - _c.Call.Run(func(args mock.Arguments) { - variadicArgs := make([]func(*cloudformation.Options), len(args)-2) - for i, a := range args[2:] { - if a != nil { - variadicArgs[i] = a.(func(*cloudformation.Options)) - } - } - run(args[0].(context.Context), args[1].(*cloudformation.ListStacksInput), variadicArgs...) - }) - return _c -} - -func (_c *MockCloudFormationAPIer_ListStacks_Call) Return(_a0 *cloudformation.ListStacksOutput, _a1 error) *MockCloudFormationAPIer_ListStacks_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockCloudFormationAPIer_ListStacks_Call) RunAndReturn(run func(context.Context, *cloudformation.ListStacksInput, ...func(*cloudformation.Options)) (*cloudformation.ListStacksOutput, error)) *MockCloudFormationAPIer_ListStacks_Call { - _c.Call.Return(run) - return _c -} - -// UpdateStack provides a mock function with given fields: ctx, params, opts -func (_m *MockCloudFormationAPIer) UpdateStack(ctx context.Context, params *cloudformation.UpdateStackInput, opts ...func(*cloudformation.Options)) (*cloudformation.UpdateStackOutput, error) { - _va := make([]interface{}, len(opts)) - for _i := range opts { - _va[_i] = opts[_i] - } - var _ca []interface{} - _ca = append(_ca, ctx, params) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - if len(ret) == 0 { - panic("no return value specified for UpdateStack") - } - - var r0 *cloudformation.UpdateStackOutput - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *cloudformation.UpdateStackInput, ...func(*cloudformation.Options)) (*cloudformation.UpdateStackOutput, error)); ok { - return rf(ctx, params, opts...) - } - if rf, ok := ret.Get(0).(func(context.Context, *cloudformation.UpdateStackInput, ...func(*cloudformation.Options)) *cloudformation.UpdateStackOutput); ok { - r0 = rf(ctx, params, opts...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*cloudformation.UpdateStackOutput) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *cloudformation.UpdateStackInput, ...func(*cloudformation.Options)) error); ok { - r1 = rf(ctx, params, opts...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockCloudFormationAPIer_UpdateStack_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateStack' -type MockCloudFormationAPIer_UpdateStack_Call struct { - *mock.Call -} - -// UpdateStack is a helper method to define mock.On call -// - ctx context.Context -// - params *cloudformation.UpdateStackInput -// - opts ...func(*cloudformation.Options) -func (_e *MockCloudFormationAPIer_Expecter) UpdateStack(ctx interface{}, params interface{}, opts ...interface{}) *MockCloudFormationAPIer_UpdateStack_Call { - return &MockCloudFormationAPIer_UpdateStack_Call{Call: _e.mock.On("UpdateStack", - append([]interface{}{ctx, params}, opts...)...)} -} - -func (_c *MockCloudFormationAPIer_UpdateStack_Call) Run(run func(ctx context.Context, params *cloudformation.UpdateStackInput, opts ...func(*cloudformation.Options))) *MockCloudFormationAPIer_UpdateStack_Call { - _c.Call.Run(func(args mock.Arguments) { - variadicArgs := make([]func(*cloudformation.Options), len(args)-2) - for i, a := range args[2:] { - if a != nil { - variadicArgs[i] = a.(func(*cloudformation.Options)) - } - } - run(args[0].(context.Context), args[1].(*cloudformation.UpdateStackInput), variadicArgs...) - }) - return _c -} - -func (_c *MockCloudFormationAPIer_UpdateStack_Call) Return(_a0 *cloudformation.UpdateStackOutput, _a1 error) *MockCloudFormationAPIer_UpdateStack_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockCloudFormationAPIer_UpdateStack_Call) RunAndReturn(run func(context.Context, *cloudformation.UpdateStackInput, ...func(*cloudformation.Options)) (*cloudformation.UpdateStackOutput, error)) *MockCloudFormationAPIer_UpdateStack_Call { - _c.Call.Return(run) - return _c -} - -// NewMockCloudFormationAPIer creates a new instance of MockCloudFormationAPIer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewMockCloudFormationAPIer(t interface { - mock.TestingT - Cleanup(func()) -}) *MockCloudFormationAPIer { - mock := &MockCloudFormationAPIer{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/aws/mock_ConfigInterfacer.go b/mocks/aws/mock_ConfigInterfacer.go deleted file mode 100644 index b9c6b36e..00000000 --- a/mocks/aws/mock_ConfigInterfacer.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by mockery v2.46.0. DO NOT EDIT. - -package mocks - -import mock "github.com/stretchr/testify/mock" - -// MockConfigInterfacer is an autogenerated mock type for the ConfigInterfacer type -type MockConfigInterfacer struct { - mock.Mock -} - -type MockConfigInterfacer_Expecter struct { - mock *mock.Mock -} - -func (_m *MockConfigInterfacer) EXPECT() *MockConfigInterfacer_Expecter { - return &MockConfigInterfacer_Expecter{mock: &_m.Mock} -} - -// GetString provides a mock function with given fields: key -func (_m *MockConfigInterfacer) GetString(key string) string { - ret := _m.Called(key) - - if len(ret) == 0 { - panic("no return value specified for GetString") - } - - var r0 string - if rf, ok := ret.Get(0).(func(string) string); ok { - r0 = rf(key) - } else { - r0 = ret.Get(0).(string) - } - - return r0 -} - -// MockConfigInterfacer_GetString_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetString' -type MockConfigInterfacer_GetString_Call struct { - *mock.Call -} - -// GetString is a helper method to define mock.On call -// - key string -func (_e *MockConfigInterfacer_Expecter) GetString(key interface{}) *MockConfigInterfacer_GetString_Call { - return &MockConfigInterfacer_GetString_Call{Call: _e.mock.On("GetString", key)} -} - -func (_c *MockConfigInterfacer_GetString_Call) Run(run func(key string)) *MockConfigInterfacer_GetString_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string)) - }) - return _c -} - -func (_c *MockConfigInterfacer_GetString_Call) Return(_a0 string) *MockConfigInterfacer_GetString_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockConfigInterfacer_GetString_Call) RunAndReturn(run func(string) string) *MockConfigInterfacer_GetString_Call { - _c.Call.Return(run) - return _c -} - -// NewMockConfigInterfacer creates a new instance of MockConfigInterfacer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewMockConfigInterfacer(t interface { - mock.TestingT - Cleanup(func()) -}) *MockConfigInterfacer { - mock := &MockConfigInterfacer{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/aws/mock_EC2Clienter.go b/mocks/aws/mock_EC2Clienter.go index 55c3bcf2..94a6146f 100644 --- a/mocks/aws/mock_EC2Clienter.go +++ b/mocks/aws/mock_EC2Clienter.go @@ -170,6 +170,80 @@ func (_c *MockEC2Clienter_AttachInternetGateway_Call) RunAndReturn(run func(cont return _c } +// AuthorizeSecurityGroupIngress provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) AuthorizeSecurityGroupIngress(ctx context.Context, params *ec2.AuthorizeSecurityGroupIngressInput, optFns ...func(*ec2.Options)) (*ec2.AuthorizeSecurityGroupIngressOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for AuthorizeSecurityGroupIngress") + } + + var r0 *ec2.AuthorizeSecurityGroupIngressOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.AuthorizeSecurityGroupIngressInput, ...func(*ec2.Options)) (*ec2.AuthorizeSecurityGroupIngressOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.AuthorizeSecurityGroupIngressInput, ...func(*ec2.Options)) *ec2.AuthorizeSecurityGroupIngressOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.AuthorizeSecurityGroupIngressOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.AuthorizeSecurityGroupIngressInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_AuthorizeSecurityGroupIngress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AuthorizeSecurityGroupIngress' +type MockEC2Clienter_AuthorizeSecurityGroupIngress_Call struct { + *mock.Call +} + +// AuthorizeSecurityGroupIngress is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.AuthorizeSecurityGroupIngressInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) AuthorizeSecurityGroupIngress(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_AuthorizeSecurityGroupIngress_Call { + return &MockEC2Clienter_AuthorizeSecurityGroupIngress_Call{Call: _e.mock.On("AuthorizeSecurityGroupIngress", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_AuthorizeSecurityGroupIngress_Call) Run(run func(ctx context.Context, params *ec2.AuthorizeSecurityGroupIngressInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_AuthorizeSecurityGroupIngress_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.AuthorizeSecurityGroupIngressInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_AuthorizeSecurityGroupIngress_Call) Return(_a0 *ec2.AuthorizeSecurityGroupIngressOutput, _a1 error) *MockEC2Clienter_AuthorizeSecurityGroupIngress_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_AuthorizeSecurityGroupIngress_Call) RunAndReturn(run func(context.Context, *ec2.AuthorizeSecurityGroupIngressInput, ...func(*ec2.Options)) (*ec2.AuthorizeSecurityGroupIngressOutput, error)) *MockEC2Clienter_AuthorizeSecurityGroupIngress_Call { + _c.Call.Return(run) + return _c +} + // CreateInternetGateway provides a mock function with given fields: ctx, params, optFns func (_m *MockEC2Clienter) CreateInternetGateway(ctx context.Context, params *ec2.CreateInternetGatewayInput, optFns ...func(*ec2.Options)) (*ec2.CreateInternetGatewayOutput, error) { _va := make([]interface{}, len(optFns)) @@ -392,6 +466,80 @@ func (_c *MockEC2Clienter_CreateRouteTable_Call) RunAndReturn(run func(context.C return _c } +// CreateSecurityGroup provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) CreateSecurityGroup(ctx context.Context, params *ec2.CreateSecurityGroupInput, optFns ...func(*ec2.Options)) (*ec2.CreateSecurityGroupOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for CreateSecurityGroup") + } + + var r0 *ec2.CreateSecurityGroupOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.CreateSecurityGroupInput, ...func(*ec2.Options)) (*ec2.CreateSecurityGroupOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.CreateSecurityGroupInput, ...func(*ec2.Options)) *ec2.CreateSecurityGroupOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.CreateSecurityGroupOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.CreateSecurityGroupInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_CreateSecurityGroup_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateSecurityGroup' +type MockEC2Clienter_CreateSecurityGroup_Call struct { + *mock.Call +} + +// CreateSecurityGroup is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.CreateSecurityGroupInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) CreateSecurityGroup(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_CreateSecurityGroup_Call { + return &MockEC2Clienter_CreateSecurityGroup_Call{Call: _e.mock.On("CreateSecurityGroup", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_CreateSecurityGroup_Call) Run(run func(ctx context.Context, params *ec2.CreateSecurityGroupInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_CreateSecurityGroup_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.CreateSecurityGroupInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_CreateSecurityGroup_Call) Return(_a0 *ec2.CreateSecurityGroupOutput, _a1 error) *MockEC2Clienter_CreateSecurityGroup_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_CreateSecurityGroup_Call) RunAndReturn(run func(context.Context, *ec2.CreateSecurityGroupInput, ...func(*ec2.Options)) (*ec2.CreateSecurityGroupOutput, error)) *MockEC2Clienter_CreateSecurityGroup_Call { + _c.Call.Return(run) + return _c +} + // CreateSubnet provides a mock function with given fields: ctx, params, optFns func (_m *MockEC2Clienter) CreateSubnet(ctx context.Context, params *ec2.CreateSubnetInput, optFns ...func(*ec2.Options)) (*ec2.CreateSubnetOutput, error) { _va := make([]interface{}, len(optFns)) @@ -466,8 +614,8 @@ func (_c *MockEC2Clienter_CreateSubnet_Call) RunAndReturn(run func(context.Conte return _c } -// CreateVPC provides a mock function with given fields: ctx, params, optFns -func (_m *MockEC2Clienter) CreateVPC(ctx context.Context, params *ec2.CreateVpcInput, optFns ...func(*ec2.Options)) (*ec2.CreateVpcOutput, error) { +// CreateVpc provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) CreateVpc(ctx context.Context, params *ec2.CreateVpcInput, optFns ...func(*ec2.Options)) (*ec2.CreateVpcOutput, error) { _va := make([]interface{}, len(optFns)) for _i := range optFns { _va[_i] = optFns[_i] @@ -478,7 +626,7 @@ func (_m *MockEC2Clienter) CreateVPC(ctx context.Context, params *ec2.CreateVpcI ret := _m.Called(_ca...) if len(ret) == 0 { - panic("no return value specified for CreateVPC") + panic("no return value specified for CreateVpc") } var r0 *ec2.CreateVpcOutput @@ -503,21 +651,21 @@ func (_m *MockEC2Clienter) CreateVPC(ctx context.Context, params *ec2.CreateVpcI return r0, r1 } -// MockEC2Clienter_CreateVPC_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateVPC' -type MockEC2Clienter_CreateVPC_Call struct { +// MockEC2Clienter_CreateVpc_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateVpc' +type MockEC2Clienter_CreateVpc_Call struct { *mock.Call } -// CreateVPC is a helper method to define mock.On call +// CreateVpc is a helper method to define mock.On call // - ctx context.Context // - params *ec2.CreateVpcInput // - optFns ...func(*ec2.Options) -func (_e *MockEC2Clienter_Expecter) CreateVPC(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_CreateVPC_Call { - return &MockEC2Clienter_CreateVPC_Call{Call: _e.mock.On("CreateVPC", +func (_e *MockEC2Clienter_Expecter) CreateVpc(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_CreateVpc_Call { + return &MockEC2Clienter_CreateVpc_Call{Call: _e.mock.On("CreateVpc", append([]interface{}{ctx, params}, optFns...)...)} } -func (_c *MockEC2Clienter_CreateVPC_Call) Run(run func(ctx context.Context, params *ec2.CreateVpcInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_CreateVPC_Call { +func (_c *MockEC2Clienter_CreateVpc_Call) Run(run func(ctx context.Context, params *ec2.CreateVpcInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_CreateVpc_Call { _c.Call.Run(func(args mock.Arguments) { variadicArgs := make([]func(*ec2.Options), len(args)-2) for i, a := range args[2:] { @@ -530,18 +678,18 @@ func (_c *MockEC2Clienter_CreateVPC_Call) Run(run func(ctx context.Context, para return _c } -func (_c *MockEC2Clienter_CreateVPC_Call) Return(_a0 *ec2.CreateVpcOutput, _a1 error) *MockEC2Clienter_CreateVPC_Call { +func (_c *MockEC2Clienter_CreateVpc_Call) Return(_a0 *ec2.CreateVpcOutput, _a1 error) *MockEC2Clienter_CreateVpc_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *MockEC2Clienter_CreateVPC_Call) RunAndReturn(run func(context.Context, *ec2.CreateVpcInput, ...func(*ec2.Options)) (*ec2.CreateVpcOutput, error)) *MockEC2Clienter_CreateVPC_Call { +func (_c *MockEC2Clienter_CreateVpc_Call) RunAndReturn(run func(context.Context, *ec2.CreateVpcInput, ...func(*ec2.Options)) (*ec2.CreateVpcOutput, error)) *MockEC2Clienter_CreateVpc_Call { _c.Call.Return(run) return _c } -// DescribeImages provides a mock function with given fields: ctx, params, optFns -func (_m *MockEC2Clienter) DescribeImages(ctx context.Context, params *ec2.DescribeImagesInput, optFns ...func(*ec2.Options)) (*ec2.DescribeImagesOutput, error) { +// DeleteInternetGateway provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) DeleteInternetGateway(ctx context.Context, params *ec2.DeleteInternetGatewayInput, optFns ...func(*ec2.Options)) (*ec2.DeleteInternetGatewayOutput, error) { _va := make([]interface{}, len(optFns)) for _i := range optFns { _va[_i] = optFns[_i] @@ -552,23 +700,23 @@ func (_m *MockEC2Clienter) DescribeImages(ctx context.Context, params *ec2.Descr ret := _m.Called(_ca...) if len(ret) == 0 { - panic("no return value specified for DescribeImages") + panic("no return value specified for DeleteInternetGateway") } - var r0 *ec2.DescribeImagesOutput + var r0 *ec2.DeleteInternetGatewayOutput var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeImagesInput, ...func(*ec2.Options)) (*ec2.DescribeImagesOutput, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DeleteInternetGatewayInput, ...func(*ec2.Options)) (*ec2.DeleteInternetGatewayOutput, error)); ok { return rf(ctx, params, optFns...) } - if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeImagesInput, ...func(*ec2.Options)) *ec2.DescribeImagesOutput); ok { + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DeleteInternetGatewayInput, ...func(*ec2.Options)) *ec2.DeleteInternetGatewayOutput); ok { r0 = rf(ctx, params, optFns...) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*ec2.DescribeImagesOutput) + r0 = ret.Get(0).(*ec2.DeleteInternetGatewayOutput) } } - if rf, ok := ret.Get(1).(func(context.Context, *ec2.DescribeImagesInput, ...func(*ec2.Options)) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *ec2.DeleteInternetGatewayInput, ...func(*ec2.Options)) error); ok { r1 = rf(ctx, params, optFns...) } else { r1 = ret.Error(1) @@ -577,21 +725,21 @@ func (_m *MockEC2Clienter) DescribeImages(ctx context.Context, params *ec2.Descr return r0, r1 } -// MockEC2Clienter_DescribeImages_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DescribeImages' -type MockEC2Clienter_DescribeImages_Call struct { +// MockEC2Clienter_DeleteInternetGateway_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteInternetGateway' +type MockEC2Clienter_DeleteInternetGateway_Call struct { *mock.Call } -// DescribeImages is a helper method to define mock.On call +// DeleteInternetGateway is a helper method to define mock.On call // - ctx context.Context -// - params *ec2.DescribeImagesInput +// - params *ec2.DeleteInternetGatewayInput // - optFns ...func(*ec2.Options) -func (_e *MockEC2Clienter_Expecter) DescribeImages(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_DescribeImages_Call { - return &MockEC2Clienter_DescribeImages_Call{Call: _e.mock.On("DescribeImages", +func (_e *MockEC2Clienter_Expecter) DeleteInternetGateway(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_DeleteInternetGateway_Call { + return &MockEC2Clienter_DeleteInternetGateway_Call{Call: _e.mock.On("DeleteInternetGateway", append([]interface{}{ctx, params}, optFns...)...)} } -func (_c *MockEC2Clienter_DescribeImages_Call) Run(run func(ctx context.Context, params *ec2.DescribeImagesInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_DescribeImages_Call { +func (_c *MockEC2Clienter_DeleteInternetGateway_Call) Run(run func(ctx context.Context, params *ec2.DeleteInternetGatewayInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_DeleteInternetGateway_Call { _c.Call.Run(func(args mock.Arguments) { variadicArgs := make([]func(*ec2.Options), len(args)-2) for i, a := range args[2:] { @@ -599,23 +747,23 @@ func (_c *MockEC2Clienter_DescribeImages_Call) Run(run func(ctx context.Context, variadicArgs[i] = a.(func(*ec2.Options)) } } - run(args[0].(context.Context), args[1].(*ec2.DescribeImagesInput), variadicArgs...) + run(args[0].(context.Context), args[1].(*ec2.DeleteInternetGatewayInput), variadicArgs...) }) return _c } -func (_c *MockEC2Clienter_DescribeImages_Call) Return(_a0 *ec2.DescribeImagesOutput, _a1 error) *MockEC2Clienter_DescribeImages_Call { +func (_c *MockEC2Clienter_DeleteInternetGateway_Call) Return(_a0 *ec2.DeleteInternetGatewayOutput, _a1 error) *MockEC2Clienter_DeleteInternetGateway_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *MockEC2Clienter_DescribeImages_Call) RunAndReturn(run func(context.Context, *ec2.DescribeImagesInput, ...func(*ec2.Options)) (*ec2.DescribeImagesOutput, error)) *MockEC2Clienter_DescribeImages_Call { +func (_c *MockEC2Clienter_DeleteInternetGateway_Call) RunAndReturn(run func(context.Context, *ec2.DeleteInternetGatewayInput, ...func(*ec2.Options)) (*ec2.DeleteInternetGatewayOutput, error)) *MockEC2Clienter_DeleteInternetGateway_Call { _c.Call.Return(run) return _c } -// DescribeInstances provides a mock function with given fields: ctx, params, optFns -func (_m *MockEC2Clienter) DescribeInstances(ctx context.Context, params *ec2.DescribeInstancesInput, optFns ...func(*ec2.Options)) (*ec2.DescribeInstancesOutput, error) { +// DeleteRouteTable provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) DeleteRouteTable(ctx context.Context, params *ec2.DeleteRouteTableInput, optFns ...func(*ec2.Options)) (*ec2.DeleteRouteTableOutput, error) { _va := make([]interface{}, len(optFns)) for _i := range optFns { _va[_i] = optFns[_i] @@ -626,23 +774,23 @@ func (_m *MockEC2Clienter) DescribeInstances(ctx context.Context, params *ec2.De ret := _m.Called(_ca...) if len(ret) == 0 { - panic("no return value specified for DescribeInstances") + panic("no return value specified for DeleteRouteTable") } - var r0 *ec2.DescribeInstancesOutput + var r0 *ec2.DeleteRouteTableOutput var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeInstancesInput, ...func(*ec2.Options)) (*ec2.DescribeInstancesOutput, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DeleteRouteTableInput, ...func(*ec2.Options)) (*ec2.DeleteRouteTableOutput, error)); ok { return rf(ctx, params, optFns...) } - if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeInstancesInput, ...func(*ec2.Options)) *ec2.DescribeInstancesOutput); ok { + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DeleteRouteTableInput, ...func(*ec2.Options)) *ec2.DeleteRouteTableOutput); ok { r0 = rf(ctx, params, optFns...) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*ec2.DescribeInstancesOutput) + r0 = ret.Get(0).(*ec2.DeleteRouteTableOutput) } } - if rf, ok := ret.Get(1).(func(context.Context, *ec2.DescribeInstancesInput, ...func(*ec2.Options)) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *ec2.DeleteRouteTableInput, ...func(*ec2.Options)) error); ok { r1 = rf(ctx, params, optFns...) } else { r1 = ret.Error(1) @@ -651,21 +799,21 @@ func (_m *MockEC2Clienter) DescribeInstances(ctx context.Context, params *ec2.De return r0, r1 } -// MockEC2Clienter_DescribeInstances_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DescribeInstances' -type MockEC2Clienter_DescribeInstances_Call struct { +// MockEC2Clienter_DeleteRouteTable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteRouteTable' +type MockEC2Clienter_DeleteRouteTable_Call struct { *mock.Call } -// DescribeInstances is a helper method to define mock.On call +// DeleteRouteTable is a helper method to define mock.On call // - ctx context.Context -// - params *ec2.DescribeInstancesInput +// - params *ec2.DeleteRouteTableInput // - optFns ...func(*ec2.Options) -func (_e *MockEC2Clienter_Expecter) DescribeInstances(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_DescribeInstances_Call { - return &MockEC2Clienter_DescribeInstances_Call{Call: _e.mock.On("DescribeInstances", +func (_e *MockEC2Clienter_Expecter) DeleteRouteTable(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_DeleteRouteTable_Call { + return &MockEC2Clienter_DeleteRouteTable_Call{Call: _e.mock.On("DeleteRouteTable", append([]interface{}{ctx, params}, optFns...)...)} } -func (_c *MockEC2Clienter_DescribeInstances_Call) Run(run func(ctx context.Context, params *ec2.DescribeInstancesInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_DescribeInstances_Call { +func (_c *MockEC2Clienter_DeleteRouteTable_Call) Run(run func(ctx context.Context, params *ec2.DeleteRouteTableInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_DeleteRouteTable_Call { _c.Call.Run(func(args mock.Arguments) { variadicArgs := make([]func(*ec2.Options), len(args)-2) for i, a := range args[2:] { @@ -673,23 +821,23 @@ func (_c *MockEC2Clienter_DescribeInstances_Call) Run(run func(ctx context.Conte variadicArgs[i] = a.(func(*ec2.Options)) } } - run(args[0].(context.Context), args[1].(*ec2.DescribeInstancesInput), variadicArgs...) + run(args[0].(context.Context), args[1].(*ec2.DeleteRouteTableInput), variadicArgs...) }) return _c } -func (_c *MockEC2Clienter_DescribeInstances_Call) Return(_a0 *ec2.DescribeInstancesOutput, _a1 error) *MockEC2Clienter_DescribeInstances_Call { +func (_c *MockEC2Clienter_DeleteRouteTable_Call) Return(_a0 *ec2.DeleteRouteTableOutput, _a1 error) *MockEC2Clienter_DeleteRouteTable_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *MockEC2Clienter_DescribeInstances_Call) RunAndReturn(run func(context.Context, *ec2.DescribeInstancesInput, ...func(*ec2.Options)) (*ec2.DescribeInstancesOutput, error)) *MockEC2Clienter_DescribeInstances_Call { +func (_c *MockEC2Clienter_DeleteRouteTable_Call) RunAndReturn(run func(context.Context, *ec2.DeleteRouteTableInput, ...func(*ec2.Options)) (*ec2.DeleteRouteTableOutput, error)) *MockEC2Clienter_DeleteRouteTable_Call { _c.Call.Return(run) return _c } -// DescribeVPCs provides a mock function with given fields: ctx, params, optFns -func (_m *MockEC2Clienter) DescribeVPCs(ctx context.Context, params *ec2.DescribeVpcsInput, optFns ...func(*ec2.Options)) (*ec2.DescribeVpcsOutput, error) { +// DeleteSecurityGroup provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) DeleteSecurityGroup(ctx context.Context, params *ec2.DeleteSecurityGroupInput, optFns ...func(*ec2.Options)) (*ec2.DeleteSecurityGroupOutput, error) { _va := make([]interface{}, len(optFns)) for _i := range optFns { _va[_i] = optFns[_i] @@ -700,23 +848,23 @@ func (_m *MockEC2Clienter) DescribeVPCs(ctx context.Context, params *ec2.Describ ret := _m.Called(_ca...) if len(ret) == 0 { - panic("no return value specified for DescribeVPCs") + panic("no return value specified for DeleteSecurityGroup") } - var r0 *ec2.DescribeVpcsOutput + var r0 *ec2.DeleteSecurityGroupOutput var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeVpcsInput, ...func(*ec2.Options)) (*ec2.DescribeVpcsOutput, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DeleteSecurityGroupInput, ...func(*ec2.Options)) (*ec2.DeleteSecurityGroupOutput, error)); ok { return rf(ctx, params, optFns...) } - if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeVpcsInput, ...func(*ec2.Options)) *ec2.DescribeVpcsOutput); ok { + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DeleteSecurityGroupInput, ...func(*ec2.Options)) *ec2.DeleteSecurityGroupOutput); ok { r0 = rf(ctx, params, optFns...) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*ec2.DescribeVpcsOutput) + r0 = ret.Get(0).(*ec2.DeleteSecurityGroupOutput) } } - if rf, ok := ret.Get(1).(func(context.Context, *ec2.DescribeVpcsInput, ...func(*ec2.Options)) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *ec2.DeleteSecurityGroupInput, ...func(*ec2.Options)) error); ok { r1 = rf(ctx, params, optFns...) } else { r1 = ret.Error(1) @@ -725,21 +873,21 @@ func (_m *MockEC2Clienter) DescribeVPCs(ctx context.Context, params *ec2.Describ return r0, r1 } -// MockEC2Clienter_DescribeVPCs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DescribeVPCs' -type MockEC2Clienter_DescribeVPCs_Call struct { +// MockEC2Clienter_DeleteSecurityGroup_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteSecurityGroup' +type MockEC2Clienter_DeleteSecurityGroup_Call struct { *mock.Call } -// DescribeVPCs is a helper method to define mock.On call +// DeleteSecurityGroup is a helper method to define mock.On call // - ctx context.Context -// - params *ec2.DescribeVpcsInput +// - params *ec2.DeleteSecurityGroupInput // - optFns ...func(*ec2.Options) -func (_e *MockEC2Clienter_Expecter) DescribeVPCs(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_DescribeVPCs_Call { - return &MockEC2Clienter_DescribeVPCs_Call{Call: _e.mock.On("DescribeVPCs", +func (_e *MockEC2Clienter_Expecter) DeleteSecurityGroup(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_DeleteSecurityGroup_Call { + return &MockEC2Clienter_DeleteSecurityGroup_Call{Call: _e.mock.On("DeleteSecurityGroup", append([]interface{}{ctx, params}, optFns...)...)} } -func (_c *MockEC2Clienter_DescribeVPCs_Call) Run(run func(ctx context.Context, params *ec2.DescribeVpcsInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_DescribeVPCs_Call { +func (_c *MockEC2Clienter_DeleteSecurityGroup_Call) Run(run func(ctx context.Context, params *ec2.DeleteSecurityGroupInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_DeleteSecurityGroup_Call { _c.Call.Run(func(args mock.Arguments) { variadicArgs := make([]func(*ec2.Options), len(args)-2) for i, a := range args[2:] { @@ -747,17 +895,1053 @@ func (_c *MockEC2Clienter_DescribeVPCs_Call) Run(run func(ctx context.Context, p variadicArgs[i] = a.(func(*ec2.Options)) } } - run(args[0].(context.Context), args[1].(*ec2.DescribeVpcsInput), variadicArgs...) + run(args[0].(context.Context), args[1].(*ec2.DeleteSecurityGroupInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_DeleteSecurityGroup_Call) Return(_a0 *ec2.DeleteSecurityGroupOutput, _a1 error) *MockEC2Clienter_DeleteSecurityGroup_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_DeleteSecurityGroup_Call) RunAndReturn(run func(context.Context, *ec2.DeleteSecurityGroupInput, ...func(*ec2.Options)) (*ec2.DeleteSecurityGroupOutput, error)) *MockEC2Clienter_DeleteSecurityGroup_Call { + _c.Call.Return(run) + return _c +} + +// DeleteSubnet provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) DeleteSubnet(ctx context.Context, params *ec2.DeleteSubnetInput, optFns ...func(*ec2.Options)) (*ec2.DeleteSubnetOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for DeleteSubnet") + } + + var r0 *ec2.DeleteSubnetOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DeleteSubnetInput, ...func(*ec2.Options)) (*ec2.DeleteSubnetOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DeleteSubnetInput, ...func(*ec2.Options)) *ec2.DeleteSubnetOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.DeleteSubnetOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.DeleteSubnetInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_DeleteSubnet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteSubnet' +type MockEC2Clienter_DeleteSubnet_Call struct { + *mock.Call +} + +// DeleteSubnet is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.DeleteSubnetInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) DeleteSubnet(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_DeleteSubnet_Call { + return &MockEC2Clienter_DeleteSubnet_Call{Call: _e.mock.On("DeleteSubnet", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_DeleteSubnet_Call) Run(run func(ctx context.Context, params *ec2.DeleteSubnetInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_DeleteSubnet_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.DeleteSubnetInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_DeleteSubnet_Call) Return(_a0 *ec2.DeleteSubnetOutput, _a1 error) *MockEC2Clienter_DeleteSubnet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_DeleteSubnet_Call) RunAndReturn(run func(context.Context, *ec2.DeleteSubnetInput, ...func(*ec2.Options)) (*ec2.DeleteSubnetOutput, error)) *MockEC2Clienter_DeleteSubnet_Call { + _c.Call.Return(run) + return _c +} + +// DeleteVpc provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) DeleteVpc(ctx context.Context, params *ec2.DeleteVpcInput, optFns ...func(*ec2.Options)) (*ec2.DeleteVpcOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for DeleteVpc") + } + + var r0 *ec2.DeleteVpcOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DeleteVpcInput, ...func(*ec2.Options)) (*ec2.DeleteVpcOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DeleteVpcInput, ...func(*ec2.Options)) *ec2.DeleteVpcOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.DeleteVpcOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.DeleteVpcInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_DeleteVpc_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteVpc' +type MockEC2Clienter_DeleteVpc_Call struct { + *mock.Call +} + +// DeleteVpc is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.DeleteVpcInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) DeleteVpc(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_DeleteVpc_Call { + return &MockEC2Clienter_DeleteVpc_Call{Call: _e.mock.On("DeleteVpc", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_DeleteVpc_Call) Run(run func(ctx context.Context, params *ec2.DeleteVpcInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_DeleteVpc_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.DeleteVpcInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_DeleteVpc_Call) Return(_a0 *ec2.DeleteVpcOutput, _a1 error) *MockEC2Clienter_DeleteVpc_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_DeleteVpc_Call) RunAndReturn(run func(context.Context, *ec2.DeleteVpcInput, ...func(*ec2.Options)) (*ec2.DeleteVpcOutput, error)) *MockEC2Clienter_DeleteVpc_Call { + _c.Call.Return(run) + return _c +} + +// DescribeAvailabilityZones provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) DescribeAvailabilityZones(ctx context.Context, params *ec2.DescribeAvailabilityZonesInput, optFns ...func(*ec2.Options)) (*ec2.DescribeAvailabilityZonesOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for DescribeAvailabilityZones") + } + + var r0 *ec2.DescribeAvailabilityZonesOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeAvailabilityZonesInput, ...func(*ec2.Options)) (*ec2.DescribeAvailabilityZonesOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeAvailabilityZonesInput, ...func(*ec2.Options)) *ec2.DescribeAvailabilityZonesOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.DescribeAvailabilityZonesOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.DescribeAvailabilityZonesInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_DescribeAvailabilityZones_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DescribeAvailabilityZones' +type MockEC2Clienter_DescribeAvailabilityZones_Call struct { + *mock.Call +} + +// DescribeAvailabilityZones is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.DescribeAvailabilityZonesInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) DescribeAvailabilityZones(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_DescribeAvailabilityZones_Call { + return &MockEC2Clienter_DescribeAvailabilityZones_Call{Call: _e.mock.On("DescribeAvailabilityZones", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_DescribeAvailabilityZones_Call) Run(run func(ctx context.Context, params *ec2.DescribeAvailabilityZonesInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_DescribeAvailabilityZones_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.DescribeAvailabilityZonesInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_DescribeAvailabilityZones_Call) Return(_a0 *ec2.DescribeAvailabilityZonesOutput, _a1 error) *MockEC2Clienter_DescribeAvailabilityZones_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_DescribeAvailabilityZones_Call) RunAndReturn(run func(context.Context, *ec2.DescribeAvailabilityZonesInput, ...func(*ec2.Options)) (*ec2.DescribeAvailabilityZonesOutput, error)) *MockEC2Clienter_DescribeAvailabilityZones_Call { + _c.Call.Return(run) + return _c +} + +// DescribeImages provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) DescribeImages(ctx context.Context, params *ec2.DescribeImagesInput, optFns ...func(*ec2.Options)) (*ec2.DescribeImagesOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for DescribeImages") + } + + var r0 *ec2.DescribeImagesOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeImagesInput, ...func(*ec2.Options)) (*ec2.DescribeImagesOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeImagesInput, ...func(*ec2.Options)) *ec2.DescribeImagesOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.DescribeImagesOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.DescribeImagesInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_DescribeImages_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DescribeImages' +type MockEC2Clienter_DescribeImages_Call struct { + *mock.Call +} + +// DescribeImages is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.DescribeImagesInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) DescribeImages(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_DescribeImages_Call { + return &MockEC2Clienter_DescribeImages_Call{Call: _e.mock.On("DescribeImages", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_DescribeImages_Call) Run(run func(ctx context.Context, params *ec2.DescribeImagesInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_DescribeImages_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.DescribeImagesInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_DescribeImages_Call) Return(_a0 *ec2.DescribeImagesOutput, _a1 error) *MockEC2Clienter_DescribeImages_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_DescribeImages_Call) RunAndReturn(run func(context.Context, *ec2.DescribeImagesInput, ...func(*ec2.Options)) (*ec2.DescribeImagesOutput, error)) *MockEC2Clienter_DescribeImages_Call { + _c.Call.Return(run) + return _c +} + +// DescribeInstances provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) DescribeInstances(ctx context.Context, params *ec2.DescribeInstancesInput, optFns ...func(*ec2.Options)) (*ec2.DescribeInstancesOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for DescribeInstances") + } + + var r0 *ec2.DescribeInstancesOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeInstancesInput, ...func(*ec2.Options)) (*ec2.DescribeInstancesOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeInstancesInput, ...func(*ec2.Options)) *ec2.DescribeInstancesOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.DescribeInstancesOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.DescribeInstancesInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_DescribeInstances_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DescribeInstances' +type MockEC2Clienter_DescribeInstances_Call struct { + *mock.Call +} + +// DescribeInstances is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.DescribeInstancesInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) DescribeInstances(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_DescribeInstances_Call { + return &MockEC2Clienter_DescribeInstances_Call{Call: _e.mock.On("DescribeInstances", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_DescribeInstances_Call) Run(run func(ctx context.Context, params *ec2.DescribeInstancesInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_DescribeInstances_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.DescribeInstancesInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_DescribeInstances_Call) Return(_a0 *ec2.DescribeInstancesOutput, _a1 error) *MockEC2Clienter_DescribeInstances_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_DescribeInstances_Call) RunAndReturn(run func(context.Context, *ec2.DescribeInstancesInput, ...func(*ec2.Options)) (*ec2.DescribeInstancesOutput, error)) *MockEC2Clienter_DescribeInstances_Call { + _c.Call.Return(run) + return _c +} + +// DescribeInternetGateways provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) DescribeInternetGateways(ctx context.Context, params *ec2.DescribeInternetGatewaysInput, optFns ...func(*ec2.Options)) (*ec2.DescribeInternetGatewaysOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for DescribeInternetGateways") + } + + var r0 *ec2.DescribeInternetGatewaysOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeInternetGatewaysInput, ...func(*ec2.Options)) (*ec2.DescribeInternetGatewaysOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeInternetGatewaysInput, ...func(*ec2.Options)) *ec2.DescribeInternetGatewaysOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.DescribeInternetGatewaysOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.DescribeInternetGatewaysInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_DescribeInternetGateways_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DescribeInternetGateways' +type MockEC2Clienter_DescribeInternetGateways_Call struct { + *mock.Call +} + +// DescribeInternetGateways is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.DescribeInternetGatewaysInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) DescribeInternetGateways(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_DescribeInternetGateways_Call { + return &MockEC2Clienter_DescribeInternetGateways_Call{Call: _e.mock.On("DescribeInternetGateways", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_DescribeInternetGateways_Call) Run(run func(ctx context.Context, params *ec2.DescribeInternetGatewaysInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_DescribeInternetGateways_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.DescribeInternetGatewaysInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_DescribeInternetGateways_Call) Return(_a0 *ec2.DescribeInternetGatewaysOutput, _a1 error) *MockEC2Clienter_DescribeInternetGateways_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_DescribeInternetGateways_Call) RunAndReturn(run func(context.Context, *ec2.DescribeInternetGatewaysInput, ...func(*ec2.Options)) (*ec2.DescribeInternetGatewaysOutput, error)) *MockEC2Clienter_DescribeInternetGateways_Call { + _c.Call.Return(run) + return _c +} + +// DescribeRegions provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) DescribeRegions(ctx context.Context, params *ec2.DescribeRegionsInput, optFns ...func(*ec2.Options)) (*ec2.DescribeRegionsOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for DescribeRegions") + } + + var r0 *ec2.DescribeRegionsOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeRegionsInput, ...func(*ec2.Options)) (*ec2.DescribeRegionsOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeRegionsInput, ...func(*ec2.Options)) *ec2.DescribeRegionsOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.DescribeRegionsOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.DescribeRegionsInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_DescribeRegions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DescribeRegions' +type MockEC2Clienter_DescribeRegions_Call struct { + *mock.Call +} + +// DescribeRegions is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.DescribeRegionsInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) DescribeRegions(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_DescribeRegions_Call { + return &MockEC2Clienter_DescribeRegions_Call{Call: _e.mock.On("DescribeRegions", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_DescribeRegions_Call) Run(run func(ctx context.Context, params *ec2.DescribeRegionsInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_DescribeRegions_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.DescribeRegionsInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_DescribeRegions_Call) Return(_a0 *ec2.DescribeRegionsOutput, _a1 error) *MockEC2Clienter_DescribeRegions_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_DescribeRegions_Call) RunAndReturn(run func(context.Context, *ec2.DescribeRegionsInput, ...func(*ec2.Options)) (*ec2.DescribeRegionsOutput, error)) *MockEC2Clienter_DescribeRegions_Call { + _c.Call.Return(run) + return _c +} + +// DescribeRouteTables provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) DescribeRouteTables(ctx context.Context, params *ec2.DescribeRouteTablesInput, optFns ...func(*ec2.Options)) (*ec2.DescribeRouteTablesOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for DescribeRouteTables") + } + + var r0 *ec2.DescribeRouteTablesOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeRouteTablesInput, ...func(*ec2.Options)) (*ec2.DescribeRouteTablesOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeRouteTablesInput, ...func(*ec2.Options)) *ec2.DescribeRouteTablesOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.DescribeRouteTablesOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.DescribeRouteTablesInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_DescribeRouteTables_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DescribeRouteTables' +type MockEC2Clienter_DescribeRouteTables_Call struct { + *mock.Call +} + +// DescribeRouteTables is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.DescribeRouteTablesInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) DescribeRouteTables(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_DescribeRouteTables_Call { + return &MockEC2Clienter_DescribeRouteTables_Call{Call: _e.mock.On("DescribeRouteTables", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_DescribeRouteTables_Call) Run(run func(ctx context.Context, params *ec2.DescribeRouteTablesInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_DescribeRouteTables_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.DescribeRouteTablesInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_DescribeRouteTables_Call) Return(_a0 *ec2.DescribeRouteTablesOutput, _a1 error) *MockEC2Clienter_DescribeRouteTables_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_DescribeRouteTables_Call) RunAndReturn(run func(context.Context, *ec2.DescribeRouteTablesInput, ...func(*ec2.Options)) (*ec2.DescribeRouteTablesOutput, error)) *MockEC2Clienter_DescribeRouteTables_Call { + _c.Call.Return(run) + return _c +} + +// DescribeSecurityGroups provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) DescribeSecurityGroups(ctx context.Context, params *ec2.DescribeSecurityGroupsInput, optFns ...func(*ec2.Options)) (*ec2.DescribeSecurityGroupsOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for DescribeSecurityGroups") + } + + var r0 *ec2.DescribeSecurityGroupsOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeSecurityGroupsInput, ...func(*ec2.Options)) (*ec2.DescribeSecurityGroupsOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeSecurityGroupsInput, ...func(*ec2.Options)) *ec2.DescribeSecurityGroupsOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.DescribeSecurityGroupsOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.DescribeSecurityGroupsInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_DescribeSecurityGroups_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DescribeSecurityGroups' +type MockEC2Clienter_DescribeSecurityGroups_Call struct { + *mock.Call +} + +// DescribeSecurityGroups is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.DescribeSecurityGroupsInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) DescribeSecurityGroups(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_DescribeSecurityGroups_Call { + return &MockEC2Clienter_DescribeSecurityGroups_Call{Call: _e.mock.On("DescribeSecurityGroups", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_DescribeSecurityGroups_Call) Run(run func(ctx context.Context, params *ec2.DescribeSecurityGroupsInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_DescribeSecurityGroups_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.DescribeSecurityGroupsInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_DescribeSecurityGroups_Call) Return(_a0 *ec2.DescribeSecurityGroupsOutput, _a1 error) *MockEC2Clienter_DescribeSecurityGroups_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_DescribeSecurityGroups_Call) RunAndReturn(run func(context.Context, *ec2.DescribeSecurityGroupsInput, ...func(*ec2.Options)) (*ec2.DescribeSecurityGroupsOutput, error)) *MockEC2Clienter_DescribeSecurityGroups_Call { + _c.Call.Return(run) + return _c +} + +// DescribeSubnets provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) DescribeSubnets(ctx context.Context, params *ec2.DescribeSubnetsInput, optFns ...func(*ec2.Options)) (*ec2.DescribeSubnetsOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for DescribeSubnets") + } + + var r0 *ec2.DescribeSubnetsOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeSubnetsInput, ...func(*ec2.Options)) (*ec2.DescribeSubnetsOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeSubnetsInput, ...func(*ec2.Options)) *ec2.DescribeSubnetsOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.DescribeSubnetsOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.DescribeSubnetsInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_DescribeSubnets_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DescribeSubnets' +type MockEC2Clienter_DescribeSubnets_Call struct { + *mock.Call +} + +// DescribeSubnets is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.DescribeSubnetsInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) DescribeSubnets(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_DescribeSubnets_Call { + return &MockEC2Clienter_DescribeSubnets_Call{Call: _e.mock.On("DescribeSubnets", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_DescribeSubnets_Call) Run(run func(ctx context.Context, params *ec2.DescribeSubnetsInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_DescribeSubnets_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.DescribeSubnetsInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_DescribeSubnets_Call) Return(_a0 *ec2.DescribeSubnetsOutput, _a1 error) *MockEC2Clienter_DescribeSubnets_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_DescribeSubnets_Call) RunAndReturn(run func(context.Context, *ec2.DescribeSubnetsInput, ...func(*ec2.Options)) (*ec2.DescribeSubnetsOutput, error)) *MockEC2Clienter_DescribeSubnets_Call { + _c.Call.Return(run) + return _c +} + +// DescribeVpcs provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) DescribeVpcs(ctx context.Context, params *ec2.DescribeVpcsInput, optFns ...func(*ec2.Options)) (*ec2.DescribeVpcsOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for DescribeVpcs") + } + + var r0 *ec2.DescribeVpcsOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeVpcsInput, ...func(*ec2.Options)) (*ec2.DescribeVpcsOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeVpcsInput, ...func(*ec2.Options)) *ec2.DescribeVpcsOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.DescribeVpcsOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.DescribeVpcsInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_DescribeVpcs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DescribeVpcs' +type MockEC2Clienter_DescribeVpcs_Call struct { + *mock.Call +} + +// DescribeVpcs is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.DescribeVpcsInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) DescribeVpcs(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_DescribeVpcs_Call { + return &MockEC2Clienter_DescribeVpcs_Call{Call: _e.mock.On("DescribeVpcs", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_DescribeVpcs_Call) Run(run func(ctx context.Context, params *ec2.DescribeVpcsInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_DescribeVpcs_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.DescribeVpcsInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_DescribeVpcs_Call) Return(_a0 *ec2.DescribeVpcsOutput, _a1 error) *MockEC2Clienter_DescribeVpcs_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_DescribeVpcs_Call) RunAndReturn(run func(context.Context, *ec2.DescribeVpcsInput, ...func(*ec2.Options)) (*ec2.DescribeVpcsOutput, error)) *MockEC2Clienter_DescribeVpcs_Call { + _c.Call.Return(run) + return _c +} + +// DetachInternetGateway provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) DetachInternetGateway(ctx context.Context, params *ec2.DetachInternetGatewayInput, optFns ...func(*ec2.Options)) (*ec2.DetachInternetGatewayOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for DetachInternetGateway") + } + + var r0 *ec2.DetachInternetGatewayOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DetachInternetGatewayInput, ...func(*ec2.Options)) (*ec2.DetachInternetGatewayOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DetachInternetGatewayInput, ...func(*ec2.Options)) *ec2.DetachInternetGatewayOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.DetachInternetGatewayOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.DetachInternetGatewayInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_DetachInternetGateway_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DetachInternetGateway' +type MockEC2Clienter_DetachInternetGateway_Call struct { + *mock.Call +} + +// DetachInternetGateway is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.DetachInternetGatewayInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) DetachInternetGateway(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_DetachInternetGateway_Call { + return &MockEC2Clienter_DetachInternetGateway_Call{Call: _e.mock.On("DetachInternetGateway", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_DetachInternetGateway_Call) Run(run func(ctx context.Context, params *ec2.DetachInternetGatewayInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_DetachInternetGateway_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.DetachInternetGatewayInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_DetachInternetGateway_Call) Return(_a0 *ec2.DetachInternetGatewayOutput, _a1 error) *MockEC2Clienter_DetachInternetGateway_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_DetachInternetGateway_Call) RunAndReturn(run func(context.Context, *ec2.DetachInternetGatewayInput, ...func(*ec2.Options)) (*ec2.DetachInternetGatewayOutput, error)) *MockEC2Clienter_DetachInternetGateway_Call { + _c.Call.Return(run) + return _c +} + +// DisassociateRouteTable provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) DisassociateRouteTable(ctx context.Context, params *ec2.DisassociateRouteTableInput, optFns ...func(*ec2.Options)) (*ec2.DisassociateRouteTableOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for DisassociateRouteTable") + } + + var r0 *ec2.DisassociateRouteTableOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DisassociateRouteTableInput, ...func(*ec2.Options)) (*ec2.DisassociateRouteTableOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DisassociateRouteTableInput, ...func(*ec2.Options)) *ec2.DisassociateRouteTableOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.DisassociateRouteTableOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.DisassociateRouteTableInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_DisassociateRouteTable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DisassociateRouteTable' +type MockEC2Clienter_DisassociateRouteTable_Call struct { + *mock.Call +} + +// DisassociateRouteTable is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.DisassociateRouteTableInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) DisassociateRouteTable(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_DisassociateRouteTable_Call { + return &MockEC2Clienter_DisassociateRouteTable_Call{Call: _e.mock.On("DisassociateRouteTable", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_DisassociateRouteTable_Call) Run(run func(ctx context.Context, params *ec2.DisassociateRouteTableInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_DisassociateRouteTable_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.DisassociateRouteTableInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_DisassociateRouteTable_Call) Return(_a0 *ec2.DisassociateRouteTableOutput, _a1 error) *MockEC2Clienter_DisassociateRouteTable_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_DisassociateRouteTable_Call) RunAndReturn(run func(context.Context, *ec2.DisassociateRouteTableInput, ...func(*ec2.Options)) (*ec2.DisassociateRouteTableOutput, error)) *MockEC2Clienter_DisassociateRouteTable_Call { + _c.Call.Return(run) + return _c +} + +// ModifyVpcAttribute provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) ModifyVpcAttribute(ctx context.Context, params *ec2.ModifyVpcAttributeInput, optFns ...func(*ec2.Options)) (*ec2.ModifyVpcAttributeOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for ModifyVpcAttribute") + } + + var r0 *ec2.ModifyVpcAttributeOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.ModifyVpcAttributeInput, ...func(*ec2.Options)) (*ec2.ModifyVpcAttributeOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.ModifyVpcAttributeInput, ...func(*ec2.Options)) *ec2.ModifyVpcAttributeOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.ModifyVpcAttributeOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.ModifyVpcAttributeInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_ModifyVpcAttribute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ModifyVpcAttribute' +type MockEC2Clienter_ModifyVpcAttribute_Call struct { + *mock.Call +} + +// ModifyVpcAttribute is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.ModifyVpcAttributeInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) ModifyVpcAttribute(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_ModifyVpcAttribute_Call { + return &MockEC2Clienter_ModifyVpcAttribute_Call{Call: _e.mock.On("ModifyVpcAttribute", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_ModifyVpcAttribute_Call) Run(run func(ctx context.Context, params *ec2.ModifyVpcAttributeInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_ModifyVpcAttribute_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.ModifyVpcAttributeInput), variadicArgs...) }) return _c } -func (_c *MockEC2Clienter_DescribeVPCs_Call) Return(_a0 *ec2.DescribeVpcsOutput, _a1 error) *MockEC2Clienter_DescribeVPCs_Call { +func (_c *MockEC2Clienter_ModifyVpcAttribute_Call) Return(_a0 *ec2.ModifyVpcAttributeOutput, _a1 error) *MockEC2Clienter_ModifyVpcAttribute_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *MockEC2Clienter_DescribeVPCs_Call) RunAndReturn(run func(context.Context, *ec2.DescribeVpcsInput, ...func(*ec2.Options)) (*ec2.DescribeVpcsOutput, error)) *MockEC2Clienter_DescribeVPCs_Call { +func (_c *MockEC2Clienter_ModifyVpcAttribute_Call) RunAndReturn(run func(context.Context, *ec2.ModifyVpcAttributeInput, ...func(*ec2.Options)) (*ec2.ModifyVpcAttributeOutput, error)) *MockEC2Clienter_ModifyVpcAttribute_Call { _c.Call.Return(run) return _c } diff --git a/mocks/common/mock_ClusterDeployerer.go b/mocks/common/mock_ClusterDeployerer.go index b396114b..942ba2b9 100644 --- a/mocks/common/mock_ClusterDeployerer.go +++ b/mocks/common/mock_ClusterDeployerer.go @@ -8,7 +8,7 @@ import ( models "github.com/bacalhau-project/andaime/pkg/models" mock "github.com/stretchr/testify/mock" - sshutils "github.com/bacalhau-project/andaime/pkg/sshutils" + sshutils "github.com/bacalhau-project/andaime/pkg/models/interfaces/sshutils" ) // MockClusterDeployerer is an autogenerated mock type for the ClusterDeployerer type diff --git a/mocks/gcp/mock_CloseableClient.go b/mocks/gcp/mock_CloseableClient.go deleted file mode 100644 index 10787add..00000000 --- a/mocks/gcp/mock_CloseableClient.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by mockery v2.46.0. DO NOT EDIT. - -package mocks - -import mock "github.com/stretchr/testify/mock" - -// MockCloseableClient is an autogenerated mock type for the CloseableClient type -type MockCloseableClient struct { - mock.Mock -} - -type MockCloseableClient_Expecter struct { - mock *mock.Mock -} - -func (_m *MockCloseableClient) EXPECT() *MockCloseableClient_Expecter { - return &MockCloseableClient_Expecter{mock: &_m.Mock} -} - -// Close provides a mock function with given fields: -func (_m *MockCloseableClient) Close() error { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Close") - } - - var r0 error - if rf, ok := ret.Get(0).(func() error); ok { - r0 = rf() - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// MockCloseableClient_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' -type MockCloseableClient_Close_Call struct { - *mock.Call -} - -// Close is a helper method to define mock.On call -func (_e *MockCloseableClient_Expecter) Close() *MockCloseableClient_Close_Call { - return &MockCloseableClient_Close_Call{Call: _e.mock.On("Close")} -} - -func (_c *MockCloseableClient_Close_Call) Run(run func()) *MockCloseableClient_Close_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockCloseableClient_Close_Call) Return(_a0 error) *MockCloseableClient_Close_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockCloseableClient_Close_Call) RunAndReturn(run func() error) *MockCloseableClient_Close_Call { - _c.Call.Return(run) - return _c -} - -// NewMockCloseableClient creates a new instance of MockCloseableClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewMockCloseableClient(t interface { - mock.TestingT - Cleanup(func()) -}) *MockCloseableClient { - mock := &MockCloseableClient{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mocks/sshutils/mock_SFTPClientCreator.go b/mocks/sshutils/mock_SFTPClientCreator.go new file mode 100644 index 00000000..9a7df8b5 --- /dev/null +++ b/mocks/sshutils/mock_SFTPClientCreator.go @@ -0,0 +1,95 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + sftp "github.com/pkg/sftp" + mock "github.com/stretchr/testify/mock" + + sshutils "github.com/bacalhau-project/andaime/pkg/models/interfaces/sshutils" +) + +// MockSFTPClientCreator is an autogenerated mock type for the SFTPClientCreator type +type MockSFTPClientCreator struct { + mock.Mock +} + +type MockSFTPClientCreator_Expecter struct { + mock *mock.Mock +} + +func (_m *MockSFTPClientCreator) EXPECT() *MockSFTPClientCreator_Expecter { + return &MockSFTPClientCreator_Expecter{mock: &_m.Mock} +} + +// NewSFTPClient provides a mock function with given fields: client +func (_m *MockSFTPClientCreator) NewSFTPClient(client sshutils.SSHClienter) (*sftp.Client, error) { + ret := _m.Called(client) + + if len(ret) == 0 { + panic("no return value specified for NewSFTPClient") + } + + var r0 *sftp.Client + var r1 error + if rf, ok := ret.Get(0).(func(sshutils.SSHClienter) (*sftp.Client, error)); ok { + return rf(client) + } + if rf, ok := ret.Get(0).(func(sshutils.SSHClienter) *sftp.Client); ok { + r0 = rf(client) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*sftp.Client) + } + } + + if rf, ok := ret.Get(1).(func(sshutils.SSHClienter) error); ok { + r1 = rf(client) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockSFTPClientCreator_NewSFTPClient_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewSFTPClient' +type MockSFTPClientCreator_NewSFTPClient_Call struct { + *mock.Call +} + +// NewSFTPClient is a helper method to define mock.On call +// - client sshutils.SSHClienter +func (_e *MockSFTPClientCreator_Expecter) NewSFTPClient(client interface{}) *MockSFTPClientCreator_NewSFTPClient_Call { + return &MockSFTPClientCreator_NewSFTPClient_Call{Call: _e.mock.On("NewSFTPClient", client)} +} + +func (_c *MockSFTPClientCreator_NewSFTPClient_Call) Run(run func(client sshutils.SSHClienter)) *MockSFTPClientCreator_NewSFTPClient_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(sshutils.SSHClienter)) + }) + return _c +} + +func (_c *MockSFTPClientCreator_NewSFTPClient_Call) Return(_a0 *sftp.Client, _a1 error) *MockSFTPClientCreator_NewSFTPClient_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockSFTPClientCreator_NewSFTPClient_Call) RunAndReturn(run func(sshutils.SSHClienter) (*sftp.Client, error)) *MockSFTPClientCreator_NewSFTPClient_Call { + _c.Call.Return(run) + return _c +} + +// NewMockSFTPClientCreator creates a new instance of MockSFTPClientCreator. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockSFTPClientCreator(t interface { + mock.TestingT + Cleanup(func()) +}) *MockSFTPClientCreator { + mock := &MockSFTPClientCreator{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/sshutils/mock_SFTPClienter.go b/mocks/sshutils/mock_SFTPClienter.go new file mode 100644 index 00000000..d852541e --- /dev/null +++ b/mocks/sshutils/mock_SFTPClienter.go @@ -0,0 +1,291 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + io "io" + fs "io/fs" + + mock "github.com/stretchr/testify/mock" +) + +// MockSFTPClienter is an autogenerated mock type for the SFTPClienter type +type MockSFTPClienter struct { + mock.Mock +} + +type MockSFTPClienter_Expecter struct { + mock *mock.Mock +} + +func (_m *MockSFTPClienter) EXPECT() *MockSFTPClienter_Expecter { + return &MockSFTPClienter_Expecter{mock: &_m.Mock} +} + +// Chmod provides a mock function with given fields: _a0, _a1 +func (_m *MockSFTPClienter) Chmod(_a0 string, _a1 fs.FileMode) error { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for Chmod") + } + + var r0 error + if rf, ok := ret.Get(0).(func(string, fs.FileMode) error); ok { + r0 = rf(_a0, _a1) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockSFTPClienter_Chmod_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Chmod' +type MockSFTPClienter_Chmod_Call struct { + *mock.Call +} + +// Chmod is a helper method to define mock.On call +// - _a0 string +// - _a1 fs.FileMode +func (_e *MockSFTPClienter_Expecter) Chmod(_a0 interface{}, _a1 interface{}) *MockSFTPClienter_Chmod_Call { + return &MockSFTPClienter_Chmod_Call{Call: _e.mock.On("Chmod", _a0, _a1)} +} + +func (_c *MockSFTPClienter_Chmod_Call) Run(run func(_a0 string, _a1 fs.FileMode)) *MockSFTPClienter_Chmod_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(fs.FileMode)) + }) + return _c +} + +func (_c *MockSFTPClienter_Chmod_Call) Return(_a0 error) *MockSFTPClienter_Chmod_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSFTPClienter_Chmod_Call) RunAndReturn(run func(string, fs.FileMode) error) *MockSFTPClienter_Chmod_Call { + _c.Call.Return(run) + return _c +} + +// Close provides a mock function with given fields: +func (_m *MockSFTPClienter) Close() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Close") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockSFTPClienter_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type MockSFTPClienter_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *MockSFTPClienter_Expecter) Close() *MockSFTPClienter_Close_Call { + return &MockSFTPClienter_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *MockSFTPClienter_Close_Call) Run(run func()) *MockSFTPClienter_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSFTPClienter_Close_Call) Return(_a0 error) *MockSFTPClienter_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSFTPClienter_Close_Call) RunAndReturn(run func() error) *MockSFTPClienter_Close_Call { + _c.Call.Return(run) + return _c +} + +// Create provides a mock function with given fields: _a0 +func (_m *MockSFTPClienter) Create(_a0 string) (io.WriteCloser, error) { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for Create") + } + + var r0 io.WriteCloser + var r1 error + if rf, ok := ret.Get(0).(func(string) (io.WriteCloser, error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(string) io.WriteCloser); ok { + r0 = rf(_a0) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(io.WriteCloser) + } + } + + if rf, ok := ret.Get(1).(func(string) error); ok { + r1 = rf(_a0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockSFTPClienter_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' +type MockSFTPClienter_Create_Call struct { + *mock.Call +} + +// Create is a helper method to define mock.On call +// - _a0 string +func (_e *MockSFTPClienter_Expecter) Create(_a0 interface{}) *MockSFTPClienter_Create_Call { + return &MockSFTPClienter_Create_Call{Call: _e.mock.On("Create", _a0)} +} + +func (_c *MockSFTPClienter_Create_Call) Run(run func(_a0 string)) *MockSFTPClienter_Create_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *MockSFTPClienter_Create_Call) Return(_a0 io.WriteCloser, _a1 error) *MockSFTPClienter_Create_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockSFTPClienter_Create_Call) RunAndReturn(run func(string) (io.WriteCloser, error)) *MockSFTPClienter_Create_Call { + _c.Call.Return(run) + return _c +} + +// MkdirAll provides a mock function with given fields: _a0 +func (_m *MockSFTPClienter) MkdirAll(_a0 string) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for MkdirAll") + } + + var r0 error + if rf, ok := ret.Get(0).(func(string) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockSFTPClienter_MkdirAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MkdirAll' +type MockSFTPClienter_MkdirAll_Call struct { + *mock.Call +} + +// MkdirAll is a helper method to define mock.On call +// - _a0 string +func (_e *MockSFTPClienter_Expecter) MkdirAll(_a0 interface{}) *MockSFTPClienter_MkdirAll_Call { + return &MockSFTPClienter_MkdirAll_Call{Call: _e.mock.On("MkdirAll", _a0)} +} + +func (_c *MockSFTPClienter_MkdirAll_Call) Run(run func(_a0 string)) *MockSFTPClienter_MkdirAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *MockSFTPClienter_MkdirAll_Call) Return(_a0 error) *MockSFTPClienter_MkdirAll_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSFTPClienter_MkdirAll_Call) RunAndReturn(run func(string) error) *MockSFTPClienter_MkdirAll_Call { + _c.Call.Return(run) + return _c +} + +// Open provides a mock function with given fields: _a0 +func (_m *MockSFTPClienter) Open(_a0 string) (io.ReadCloser, error) { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for Open") + } + + var r0 io.ReadCloser + var r1 error + if rf, ok := ret.Get(0).(func(string) (io.ReadCloser, error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(string) io.ReadCloser); ok { + r0 = rf(_a0) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(io.ReadCloser) + } + } + + if rf, ok := ret.Get(1).(func(string) error); ok { + r1 = rf(_a0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockSFTPClienter_Open_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Open' +type MockSFTPClienter_Open_Call struct { + *mock.Call +} + +// Open is a helper method to define mock.On call +// - _a0 string +func (_e *MockSFTPClienter_Expecter) Open(_a0 interface{}) *MockSFTPClienter_Open_Call { + return &MockSFTPClienter_Open_Call{Call: _e.mock.On("Open", _a0)} +} + +func (_c *MockSFTPClienter_Open_Call) Run(run func(_a0 string)) *MockSFTPClienter_Open_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *MockSFTPClienter_Open_Call) Return(_a0 io.ReadCloser, _a1 error) *MockSFTPClienter_Open_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockSFTPClienter_Open_Call) RunAndReturn(run func(string) (io.ReadCloser, error)) *MockSFTPClienter_Open_Call { + _c.Call.Return(run) + return _c +} + +// NewMockSFTPClienter creates a new instance of MockSFTPClienter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockSFTPClienter(t interface { + mock.TestingT + Cleanup(func()) +}) *MockSFTPClienter { + mock := &MockSFTPClienter{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/sshutils/mock_SFTPFile.go b/mocks/sshutils/mock_SFTPFile.go new file mode 100644 index 00000000..10c1c08e --- /dev/null +++ b/mocks/sshutils/mock_SFTPFile.go @@ -0,0 +1,133 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import mock "github.com/stretchr/testify/mock" + +// MockSFTPFile is an autogenerated mock type for the SFTPFile type +type MockSFTPFile struct { + mock.Mock +} + +type MockSFTPFile_Expecter struct { + mock *mock.Mock +} + +func (_m *MockSFTPFile) EXPECT() *MockSFTPFile_Expecter { + return &MockSFTPFile_Expecter{mock: &_m.Mock} +} + +// Close provides a mock function with given fields: +func (_m *MockSFTPFile) Close() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Close") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockSFTPFile_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type MockSFTPFile_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *MockSFTPFile_Expecter) Close() *MockSFTPFile_Close_Call { + return &MockSFTPFile_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *MockSFTPFile_Close_Call) Run(run func()) *MockSFTPFile_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSFTPFile_Close_Call) Return(_a0 error) *MockSFTPFile_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSFTPFile_Close_Call) RunAndReturn(run func() error) *MockSFTPFile_Close_Call { + _c.Call.Return(run) + return _c +} + +// Write provides a mock function with given fields: p +func (_m *MockSFTPFile) Write(p []byte) (int, error) { + ret := _m.Called(p) + + if len(ret) == 0 { + panic("no return value specified for Write") + } + + var r0 int + var r1 error + if rf, ok := ret.Get(0).(func([]byte) (int, error)); ok { + return rf(p) + } + if rf, ok := ret.Get(0).(func([]byte) int); ok { + r0 = rf(p) + } else { + r0 = ret.Get(0).(int) + } + + if rf, ok := ret.Get(1).(func([]byte) error); ok { + r1 = rf(p) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockSFTPFile_Write_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Write' +type MockSFTPFile_Write_Call struct { + *mock.Call +} + +// Write is a helper method to define mock.On call +// - p []byte +func (_e *MockSFTPFile_Expecter) Write(p interface{}) *MockSFTPFile_Write_Call { + return &MockSFTPFile_Write_Call{Call: _e.mock.On("Write", p)} +} + +func (_c *MockSFTPFile_Write_Call) Run(run func(p []byte)) *MockSFTPFile_Write_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]byte)) + }) + return _c +} + +func (_c *MockSFTPFile_Write_Call) Return(n int, err error) *MockSFTPFile_Write_Call { + _c.Call.Return(n, err) + return _c +} + +func (_c *MockSFTPFile_Write_Call) RunAndReturn(run func([]byte) (int, error)) *MockSFTPFile_Write_Call { + _c.Call.Return(run) + return _c +} + +// NewMockSFTPFile creates a new instance of MockSFTPFile. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockSFTPFile(t interface { + mock.TestingT + Cleanup(func()) +}) *MockSFTPFile { + mock := &MockSFTPFile{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/sshutils/mock_SSHClientCreator.go b/mocks/sshutils/mock_SSHClientCreator.go new file mode 100644 index 00000000..8261b692 --- /dev/null +++ b/mocks/sshutils/mock_SSHClientCreator.go @@ -0,0 +1,99 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + mock "github.com/stretchr/testify/mock" + ssh "golang.org/x/crypto/ssh" + + sshutils "github.com/bacalhau-project/andaime/pkg/models/interfaces/sshutils" +) + +// MockSSHClientCreator is an autogenerated mock type for the SSHClientCreator type +type MockSSHClientCreator struct { + mock.Mock +} + +type MockSSHClientCreator_Expecter struct { + mock *mock.Mock +} + +func (_m *MockSSHClientCreator) EXPECT() *MockSSHClientCreator_Expecter { + return &MockSSHClientCreator_Expecter{mock: &_m.Mock} +} + +// NewClient provides a mock function with given fields: host, port, user, privateKeyPath, config +func (_m *MockSSHClientCreator) NewClient(host string, port int, user string, privateKeyPath string, config *ssh.ClientConfig) (sshutils.SSHClienter, error) { + ret := _m.Called(host, port, user, privateKeyPath, config) + + if len(ret) == 0 { + panic("no return value specified for NewClient") + } + + var r0 sshutils.SSHClienter + var r1 error + if rf, ok := ret.Get(0).(func(string, int, string, string, *ssh.ClientConfig) (sshutils.SSHClienter, error)); ok { + return rf(host, port, user, privateKeyPath, config) + } + if rf, ok := ret.Get(0).(func(string, int, string, string, *ssh.ClientConfig) sshutils.SSHClienter); ok { + r0 = rf(host, port, user, privateKeyPath, config) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(sshutils.SSHClienter) + } + } + + if rf, ok := ret.Get(1).(func(string, int, string, string, *ssh.ClientConfig) error); ok { + r1 = rf(host, port, user, privateKeyPath, config) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockSSHClientCreator_NewClient_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewClient' +type MockSSHClientCreator_NewClient_Call struct { + *mock.Call +} + +// NewClient is a helper method to define mock.On call +// - host string +// - port int +// - user string +// - privateKeyPath string +// - config *ssh.ClientConfig +func (_e *MockSSHClientCreator_Expecter) NewClient(host interface{}, port interface{}, user interface{}, privateKeyPath interface{}, config interface{}) *MockSSHClientCreator_NewClient_Call { + return &MockSSHClientCreator_NewClient_Call{Call: _e.mock.On("NewClient", host, port, user, privateKeyPath, config)} +} + +func (_c *MockSSHClientCreator_NewClient_Call) Run(run func(host string, port int, user string, privateKeyPath string, config *ssh.ClientConfig)) *MockSSHClientCreator_NewClient_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(int), args[2].(string), args[3].(string), args[4].(*ssh.ClientConfig)) + }) + return _c +} + +func (_c *MockSSHClientCreator_NewClient_Call) Return(_a0 sshutils.SSHClienter, _a1 error) *MockSSHClientCreator_NewClient_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockSSHClientCreator_NewClient_Call) RunAndReturn(run func(string, int, string, string, *ssh.ClientConfig) (sshutils.SSHClienter, error)) *MockSSHClientCreator_NewClient_Call { + _c.Call.Return(run) + return _c +} + +// NewMockSSHClientCreator creates a new instance of MockSSHClientCreator. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockSSHClientCreator(t interface { + mock.TestingT + Cleanup(func()) +}) *MockSSHClientCreator { + mock := &MockSSHClientCreator{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/sshutils/mock_SSHClienter.go b/mocks/sshutils/mock_SSHClienter.go new file mode 100644 index 00000000..60f6227e --- /dev/null +++ b/mocks/sshutils/mock_SSHClienter.go @@ -0,0 +1,288 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + mock "github.com/stretchr/testify/mock" + ssh "golang.org/x/crypto/ssh" + + sshutils "github.com/bacalhau-project/andaime/pkg/models/interfaces/sshutils" +) + +// MockSSHClienter is an autogenerated mock type for the SSHClienter type +type MockSSHClienter struct { + mock.Mock +} + +type MockSSHClienter_Expecter struct { + mock *mock.Mock +} + +func (_m *MockSSHClienter) EXPECT() *MockSSHClienter_Expecter { + return &MockSSHClienter_Expecter{mock: &_m.Mock} +} + +// Close provides a mock function with given fields: +func (_m *MockSSHClienter) Close() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Close") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockSSHClienter_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type MockSSHClienter_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *MockSSHClienter_Expecter) Close() *MockSSHClienter_Close_Call { + return &MockSSHClienter_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *MockSSHClienter_Close_Call) Run(run func()) *MockSSHClienter_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSSHClienter_Close_Call) Return(_a0 error) *MockSSHClienter_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHClienter_Close_Call) RunAndReturn(run func() error) *MockSSHClienter_Close_Call { + _c.Call.Return(run) + return _c +} + +// Connect provides a mock function with given fields: +func (_m *MockSSHClienter) Connect() (sshutils.SSHClienter, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Connect") + } + + var r0 sshutils.SSHClienter + var r1 error + if rf, ok := ret.Get(0).(func() (sshutils.SSHClienter, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() sshutils.SSHClienter); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(sshutils.SSHClienter) + } + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockSSHClienter_Connect_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Connect' +type MockSSHClienter_Connect_Call struct { + *mock.Call +} + +// Connect is a helper method to define mock.On call +func (_e *MockSSHClienter_Expecter) Connect() *MockSSHClienter_Connect_Call { + return &MockSSHClienter_Connect_Call{Call: _e.mock.On("Connect")} +} + +func (_c *MockSSHClienter_Connect_Call) Run(run func()) *MockSSHClienter_Connect_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSSHClienter_Connect_Call) Return(_a0 sshutils.SSHClienter, _a1 error) *MockSSHClienter_Connect_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockSSHClienter_Connect_Call) RunAndReturn(run func() (sshutils.SSHClienter, error)) *MockSSHClienter_Connect_Call { + _c.Call.Return(run) + return _c +} + +// GetClient provides a mock function with given fields: +func (_m *MockSSHClienter) GetClient() *ssh.Client { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetClient") + } + + var r0 *ssh.Client + if rf, ok := ret.Get(0).(func() *ssh.Client); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ssh.Client) + } + } + + return r0 +} + +// MockSSHClienter_GetClient_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetClient' +type MockSSHClienter_GetClient_Call struct { + *mock.Call +} + +// GetClient is a helper method to define mock.On call +func (_e *MockSSHClienter_Expecter) GetClient() *MockSSHClienter_GetClient_Call { + return &MockSSHClienter_GetClient_Call{Call: _e.mock.On("GetClient")} +} + +func (_c *MockSSHClienter_GetClient_Call) Run(run func()) *MockSSHClienter_GetClient_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSSHClienter_GetClient_Call) Return(_a0 *ssh.Client) *MockSSHClienter_GetClient_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHClienter_GetClient_Call) RunAndReturn(run func() *ssh.Client) *MockSSHClienter_GetClient_Call { + _c.Call.Return(run) + return _c +} + +// IsConnected provides a mock function with given fields: +func (_m *MockSSHClienter) IsConnected() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for IsConnected") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// MockSSHClienter_IsConnected_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsConnected' +type MockSSHClienter_IsConnected_Call struct { + *mock.Call +} + +// IsConnected is a helper method to define mock.On call +func (_e *MockSSHClienter_Expecter) IsConnected() *MockSSHClienter_IsConnected_Call { + return &MockSSHClienter_IsConnected_Call{Call: _e.mock.On("IsConnected")} +} + +func (_c *MockSSHClienter_IsConnected_Call) Run(run func()) *MockSSHClienter_IsConnected_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSSHClienter_IsConnected_Call) Return(_a0 bool) *MockSSHClienter_IsConnected_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHClienter_IsConnected_Call) RunAndReturn(run func() bool) *MockSSHClienter_IsConnected_Call { + _c.Call.Return(run) + return _c +} + +// NewSession provides a mock function with given fields: +func (_m *MockSSHClienter) NewSession() (sshutils.SSHSessioner, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for NewSession") + } + + var r0 sshutils.SSHSessioner + var r1 error + if rf, ok := ret.Get(0).(func() (sshutils.SSHSessioner, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() sshutils.SSHSessioner); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(sshutils.SSHSessioner) + } + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockSSHClienter_NewSession_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewSession' +type MockSSHClienter_NewSession_Call struct { + *mock.Call +} + +// NewSession is a helper method to define mock.On call +func (_e *MockSSHClienter_Expecter) NewSession() *MockSSHClienter_NewSession_Call { + return &MockSSHClienter_NewSession_Call{Call: _e.mock.On("NewSession")} +} + +func (_c *MockSSHClienter_NewSession_Call) Run(run func()) *MockSSHClienter_NewSession_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSSHClienter_NewSession_Call) Return(_a0 sshutils.SSHSessioner, _a1 error) *MockSSHClienter_NewSession_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockSSHClienter_NewSession_Call) RunAndReturn(run func() (sshutils.SSHSessioner, error)) *MockSSHClienter_NewSession_Call { + _c.Call.Return(run) + return _c +} + +// NewMockSSHClienter creates a new instance of MockSSHClienter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockSSHClienter(t interface { + mock.TestingT + Cleanup(func()) +}) *MockSSHClienter { + mock := &MockSSHClienter{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/sshutils/mock_SSHConfiger.go b/mocks/sshutils/mock_SSHConfiger.go new file mode 100644 index 00000000..fd2f979e --- /dev/null +++ b/mocks/sshutils/mock_SSHConfiger.go @@ -0,0 +1,1067 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + context "context" + + mock "github.com/stretchr/testify/mock" + ssh "golang.org/x/crypto/ssh" + + sshutils "github.com/bacalhau-project/andaime/pkg/models/interfaces/sshutils" + + time "time" +) + +// MockSSHConfiger is an autogenerated mock type for the SSHConfiger type +type MockSSHConfiger struct { + mock.Mock +} + +type MockSSHConfiger_Expecter struct { + mock *mock.Mock +} + +func (_m *MockSSHConfiger) EXPECT() *MockSSHConfiger_Expecter { + return &MockSSHConfiger_Expecter{mock: &_m.Mock} +} + +// Close provides a mock function with given fields: +func (_m *MockSSHConfiger) Close() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Close") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockSSHConfiger_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type MockSSHConfiger_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *MockSSHConfiger_Expecter) Close() *MockSSHConfiger_Close_Call { + return &MockSSHConfiger_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *MockSSHConfiger_Close_Call) Run(run func()) *MockSSHConfiger_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSSHConfiger_Close_Call) Return(_a0 error) *MockSSHConfiger_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHConfiger_Close_Call) RunAndReturn(run func() error) *MockSSHConfiger_Close_Call { + _c.Call.Return(run) + return _c +} + +// Connect provides a mock function with given fields: +func (_m *MockSSHConfiger) Connect() (sshutils.SSHClienter, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Connect") + } + + var r0 sshutils.SSHClienter + var r1 error + if rf, ok := ret.Get(0).(func() (sshutils.SSHClienter, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() sshutils.SSHClienter); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(sshutils.SSHClienter) + } + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockSSHConfiger_Connect_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Connect' +type MockSSHConfiger_Connect_Call struct { + *mock.Call +} + +// Connect is a helper method to define mock.On call +func (_e *MockSSHConfiger_Expecter) Connect() *MockSSHConfiger_Connect_Call { + return &MockSSHConfiger_Connect_Call{Call: _e.mock.On("Connect")} +} + +func (_c *MockSSHConfiger_Connect_Call) Run(run func()) *MockSSHConfiger_Connect_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSSHConfiger_Connect_Call) Return(_a0 sshutils.SSHClienter, _a1 error) *MockSSHConfiger_Connect_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockSSHConfiger_Connect_Call) RunAndReturn(run func() (sshutils.SSHClienter, error)) *MockSSHConfiger_Connect_Call { + _c.Call.Return(run) + return _c +} + +// ExecuteCommand provides a mock function with given fields: ctx, command +func (_m *MockSSHConfiger) ExecuteCommand(ctx context.Context, command string) (string, error) { + ret := _m.Called(ctx, command) + + if len(ret) == 0 { + panic("no return value specified for ExecuteCommand") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (string, error)); ok { + return rf(ctx, command) + } + if rf, ok := ret.Get(0).(func(context.Context, string) string); ok { + r0 = rf(ctx, command) + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, command) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockSSHConfiger_ExecuteCommand_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExecuteCommand' +type MockSSHConfiger_ExecuteCommand_Call struct { + *mock.Call +} + +// ExecuteCommand is a helper method to define mock.On call +// - ctx context.Context +// - command string +func (_e *MockSSHConfiger_Expecter) ExecuteCommand(ctx interface{}, command interface{}) *MockSSHConfiger_ExecuteCommand_Call { + return &MockSSHConfiger_ExecuteCommand_Call{Call: _e.mock.On("ExecuteCommand", ctx, command)} +} + +func (_c *MockSSHConfiger_ExecuteCommand_Call) Run(run func(ctx context.Context, command string)) *MockSSHConfiger_ExecuteCommand_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockSSHConfiger_ExecuteCommand_Call) Return(_a0 string, _a1 error) *MockSSHConfiger_ExecuteCommand_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockSSHConfiger_ExecuteCommand_Call) RunAndReturn(run func(context.Context, string) (string, error)) *MockSSHConfiger_ExecuteCommand_Call { + _c.Call.Return(run) + return _c +} + +// ExecuteCommandWithCallback provides a mock function with given fields: ctx, command, callback +func (_m *MockSSHConfiger) ExecuteCommandWithCallback(ctx context.Context, command string, callback func(string)) (string, error) { + ret := _m.Called(ctx, command, callback) + + if len(ret) == 0 { + panic("no return value specified for ExecuteCommandWithCallback") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, func(string)) (string, error)); ok { + return rf(ctx, command, callback) + } + if rf, ok := ret.Get(0).(func(context.Context, string, func(string)) string); ok { + r0 = rf(ctx, command, callback) + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func(context.Context, string, func(string)) error); ok { + r1 = rf(ctx, command, callback) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockSSHConfiger_ExecuteCommandWithCallback_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExecuteCommandWithCallback' +type MockSSHConfiger_ExecuteCommandWithCallback_Call struct { + *mock.Call +} + +// ExecuteCommandWithCallback is a helper method to define mock.On call +// - ctx context.Context +// - command string +// - callback func(string) +func (_e *MockSSHConfiger_Expecter) ExecuteCommandWithCallback(ctx interface{}, command interface{}, callback interface{}) *MockSSHConfiger_ExecuteCommandWithCallback_Call { + return &MockSSHConfiger_ExecuteCommandWithCallback_Call{Call: _e.mock.On("ExecuteCommandWithCallback", ctx, command, callback)} +} + +func (_c *MockSSHConfiger_ExecuteCommandWithCallback_Call) Run(run func(ctx context.Context, command string, callback func(string))) *MockSSHConfiger_ExecuteCommandWithCallback_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(func(string))) + }) + return _c +} + +func (_c *MockSSHConfiger_ExecuteCommandWithCallback_Call) Return(_a0 string, _a1 error) *MockSSHConfiger_ExecuteCommandWithCallback_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockSSHConfiger_ExecuteCommandWithCallback_Call) RunAndReturn(run func(context.Context, string, func(string)) (string, error)) *MockSSHConfiger_ExecuteCommandWithCallback_Call { + _c.Call.Return(run) + return _c +} + +// GetHost provides a mock function with given fields: +func (_m *MockSSHConfiger) GetHost() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetHost") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// MockSSHConfiger_GetHost_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetHost' +type MockSSHConfiger_GetHost_Call struct { + *mock.Call +} + +// GetHost is a helper method to define mock.On call +func (_e *MockSSHConfiger_Expecter) GetHost() *MockSSHConfiger_GetHost_Call { + return &MockSSHConfiger_GetHost_Call{Call: _e.mock.On("GetHost")} +} + +func (_c *MockSSHConfiger_GetHost_Call) Run(run func()) *MockSSHConfiger_GetHost_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSSHConfiger_GetHost_Call) Return(_a0 string) *MockSSHConfiger_GetHost_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHConfiger_GetHost_Call) RunAndReturn(run func() string) *MockSSHConfiger_GetHost_Call { + _c.Call.Return(run) + return _c +} + +// GetPort provides a mock function with given fields: +func (_m *MockSSHConfiger) GetPort() int { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetPort") + } + + var r0 int + if rf, ok := ret.Get(0).(func() int); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(int) + } + + return r0 +} + +// MockSSHConfiger_GetPort_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPort' +type MockSSHConfiger_GetPort_Call struct { + *mock.Call +} + +// GetPort is a helper method to define mock.On call +func (_e *MockSSHConfiger_Expecter) GetPort() *MockSSHConfiger_GetPort_Call { + return &MockSSHConfiger_GetPort_Call{Call: _e.mock.On("GetPort")} +} + +func (_c *MockSSHConfiger_GetPort_Call) Run(run func()) *MockSSHConfiger_GetPort_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSSHConfiger_GetPort_Call) Return(_a0 int) *MockSSHConfiger_GetPort_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHConfiger_GetPort_Call) RunAndReturn(run func() int) *MockSSHConfiger_GetPort_Call { + _c.Call.Return(run) + return _c +} + +// GetPrivateKeyMaterial provides a mock function with given fields: +func (_m *MockSSHConfiger) GetPrivateKeyMaterial() []byte { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetPrivateKeyMaterial") + } + + var r0 []byte + if rf, ok := ret.Get(0).(func() []byte); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]byte) + } + } + + return r0 +} + +// MockSSHConfiger_GetPrivateKeyMaterial_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPrivateKeyMaterial' +type MockSSHConfiger_GetPrivateKeyMaterial_Call struct { + *mock.Call +} + +// GetPrivateKeyMaterial is a helper method to define mock.On call +func (_e *MockSSHConfiger_Expecter) GetPrivateKeyMaterial() *MockSSHConfiger_GetPrivateKeyMaterial_Call { + return &MockSSHConfiger_GetPrivateKeyMaterial_Call{Call: _e.mock.On("GetPrivateKeyMaterial")} +} + +func (_c *MockSSHConfiger_GetPrivateKeyMaterial_Call) Run(run func()) *MockSSHConfiger_GetPrivateKeyMaterial_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSSHConfiger_GetPrivateKeyMaterial_Call) Return(_a0 []byte) *MockSSHConfiger_GetPrivateKeyMaterial_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHConfiger_GetPrivateKeyMaterial_Call) RunAndReturn(run func() []byte) *MockSSHConfiger_GetPrivateKeyMaterial_Call { + _c.Call.Return(run) + return _c +} + +// GetSFTPClientCreator provides a mock function with given fields: +func (_m *MockSSHConfiger) GetSFTPClientCreator() sshutils.SFTPClientCreator { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetSFTPClientCreator") + } + + var r0 sshutils.SFTPClientCreator + if rf, ok := ret.Get(0).(func() sshutils.SFTPClientCreator); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(sshutils.SFTPClientCreator) + } + } + + return r0 +} + +// MockSSHConfiger_GetSFTPClientCreator_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSFTPClientCreator' +type MockSSHConfiger_GetSFTPClientCreator_Call struct { + *mock.Call +} + +// GetSFTPClientCreator is a helper method to define mock.On call +func (_e *MockSSHConfiger_Expecter) GetSFTPClientCreator() *MockSSHConfiger_GetSFTPClientCreator_Call { + return &MockSSHConfiger_GetSFTPClientCreator_Call{Call: _e.mock.On("GetSFTPClientCreator")} +} + +func (_c *MockSSHConfiger_GetSFTPClientCreator_Call) Run(run func()) *MockSSHConfiger_GetSFTPClientCreator_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSSHConfiger_GetSFTPClientCreator_Call) Return(_a0 sshutils.SFTPClientCreator) *MockSSHConfiger_GetSFTPClientCreator_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHConfiger_GetSFTPClientCreator_Call) RunAndReturn(run func() sshutils.SFTPClientCreator) *MockSSHConfiger_GetSFTPClientCreator_Call { + _c.Call.Return(run) + return _c +} + +// GetSSHClient provides a mock function with given fields: +func (_m *MockSSHConfiger) GetSSHClient() *ssh.Client { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetSSHClient") + } + + var r0 *ssh.Client + if rf, ok := ret.Get(0).(func() *ssh.Client); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ssh.Client) + } + } + + return r0 +} + +// MockSSHConfiger_GetSSHClient_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSSHClient' +type MockSSHConfiger_GetSSHClient_Call struct { + *mock.Call +} + +// GetSSHClient is a helper method to define mock.On call +func (_e *MockSSHConfiger_Expecter) GetSSHClient() *MockSSHConfiger_GetSSHClient_Call { + return &MockSSHConfiger_GetSSHClient_Call{Call: _e.mock.On("GetSSHClient")} +} + +func (_c *MockSSHConfiger_GetSSHClient_Call) Run(run func()) *MockSSHConfiger_GetSSHClient_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSSHConfiger_GetSSHClient_Call) Return(_a0 *ssh.Client) *MockSSHConfiger_GetSSHClient_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHConfiger_GetSSHClient_Call) RunAndReturn(run func() *ssh.Client) *MockSSHConfiger_GetSSHClient_Call { + _c.Call.Return(run) + return _c +} + +// GetSSHClientCreator provides a mock function with given fields: +func (_m *MockSSHConfiger) GetSSHClientCreator() sshutils.SSHClientCreator { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetSSHClientCreator") + } + + var r0 sshutils.SSHClientCreator + if rf, ok := ret.Get(0).(func() sshutils.SSHClientCreator); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(sshutils.SSHClientCreator) + } + } + + return r0 +} + +// MockSSHConfiger_GetSSHClientCreator_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSSHClientCreator' +type MockSSHConfiger_GetSSHClientCreator_Call struct { + *mock.Call +} + +// GetSSHClientCreator is a helper method to define mock.On call +func (_e *MockSSHConfiger_Expecter) GetSSHClientCreator() *MockSSHConfiger_GetSSHClientCreator_Call { + return &MockSSHConfiger_GetSSHClientCreator_Call{Call: _e.mock.On("GetSSHClientCreator")} +} + +func (_c *MockSSHConfiger_GetSSHClientCreator_Call) Run(run func()) *MockSSHConfiger_GetSSHClientCreator_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSSHConfiger_GetSSHClientCreator_Call) Return(_a0 sshutils.SSHClientCreator) *MockSSHConfiger_GetSSHClientCreator_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHConfiger_GetSSHClientCreator_Call) RunAndReturn(run func() sshutils.SSHClientCreator) *MockSSHConfiger_GetSSHClientCreator_Call { + _c.Call.Return(run) + return _c +} + +// GetUser provides a mock function with given fields: +func (_m *MockSSHConfiger) GetUser() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetUser") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// MockSSHConfiger_GetUser_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUser' +type MockSSHConfiger_GetUser_Call struct { + *mock.Call +} + +// GetUser is a helper method to define mock.On call +func (_e *MockSSHConfiger_Expecter) GetUser() *MockSSHConfiger_GetUser_Call { + return &MockSSHConfiger_GetUser_Call{Call: _e.mock.On("GetUser")} +} + +func (_c *MockSSHConfiger_GetUser_Call) Run(run func()) *MockSSHConfiger_GetUser_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSSHConfiger_GetUser_Call) Return(_a0 string) *MockSSHConfiger_GetUser_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHConfiger_GetUser_Call) RunAndReturn(run func() string) *MockSSHConfiger_GetUser_Call { + _c.Call.Return(run) + return _c +} + +// InstallSystemdService provides a mock function with given fields: ctx, serviceName, serviceContent +func (_m *MockSSHConfiger) InstallSystemdService(ctx context.Context, serviceName string, serviceContent string) error { + ret := _m.Called(ctx, serviceName, serviceContent) + + if len(ret) == 0 { + panic("no return value specified for InstallSystemdService") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok { + r0 = rf(ctx, serviceName, serviceContent) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockSSHConfiger_InstallSystemdService_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'InstallSystemdService' +type MockSSHConfiger_InstallSystemdService_Call struct { + *mock.Call +} + +// InstallSystemdService is a helper method to define mock.On call +// - ctx context.Context +// - serviceName string +// - serviceContent string +func (_e *MockSSHConfiger_Expecter) InstallSystemdService(ctx interface{}, serviceName interface{}, serviceContent interface{}) *MockSSHConfiger_InstallSystemdService_Call { + return &MockSSHConfiger_InstallSystemdService_Call{Call: _e.mock.On("InstallSystemdService", ctx, serviceName, serviceContent)} +} + +func (_c *MockSSHConfiger_InstallSystemdService_Call) Run(run func(ctx context.Context, serviceName string, serviceContent string)) *MockSSHConfiger_InstallSystemdService_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *MockSSHConfiger_InstallSystemdService_Call) Return(_a0 error) *MockSSHConfiger_InstallSystemdService_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHConfiger_InstallSystemdService_Call) RunAndReturn(run func(context.Context, string, string) error) *MockSSHConfiger_InstallSystemdService_Call { + _c.Call.Return(run) + return _c +} + +// IsConnected provides a mock function with given fields: +func (_m *MockSSHConfiger) IsConnected() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for IsConnected") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// MockSSHConfiger_IsConnected_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsConnected' +type MockSSHConfiger_IsConnected_Call struct { + *mock.Call +} + +// IsConnected is a helper method to define mock.On call +func (_e *MockSSHConfiger_Expecter) IsConnected() *MockSSHConfiger_IsConnected_Call { + return &MockSSHConfiger_IsConnected_Call{Call: _e.mock.On("IsConnected")} +} + +func (_c *MockSSHConfiger_IsConnected_Call) Run(run func()) *MockSSHConfiger_IsConnected_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSSHConfiger_IsConnected_Call) Return(_a0 bool) *MockSSHConfiger_IsConnected_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHConfiger_IsConnected_Call) RunAndReturn(run func() bool) *MockSSHConfiger_IsConnected_Call { + _c.Call.Return(run) + return _c +} + +// PushFile provides a mock function with given fields: ctx, remotePath, content, executable +func (_m *MockSSHConfiger) PushFile(ctx context.Context, remotePath string, content []byte, executable bool) error { + ret := _m.Called(ctx, remotePath, content, executable) + + if len(ret) == 0 { + panic("no return value specified for PushFile") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, []byte, bool) error); ok { + r0 = rf(ctx, remotePath, content, executable) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockSSHConfiger_PushFile_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PushFile' +type MockSSHConfiger_PushFile_Call struct { + *mock.Call +} + +// PushFile is a helper method to define mock.On call +// - ctx context.Context +// - remotePath string +// - content []byte +// - executable bool +func (_e *MockSSHConfiger_Expecter) PushFile(ctx interface{}, remotePath interface{}, content interface{}, executable interface{}) *MockSSHConfiger_PushFile_Call { + return &MockSSHConfiger_PushFile_Call{Call: _e.mock.On("PushFile", ctx, remotePath, content, executable)} +} + +func (_c *MockSSHConfiger_PushFile_Call) Run(run func(ctx context.Context, remotePath string, content []byte, executable bool)) *MockSSHConfiger_PushFile_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].([]byte), args[3].(bool)) + }) + return _c +} + +func (_c *MockSSHConfiger_PushFile_Call) Return(_a0 error) *MockSSHConfiger_PushFile_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHConfiger_PushFile_Call) RunAndReturn(run func(context.Context, string, []byte, bool) error) *MockSSHConfiger_PushFile_Call { + _c.Call.Return(run) + return _c +} + +// PushFileWithCallback provides a mock function with given fields: ctx, remotePath, content, executable, callback +func (_m *MockSSHConfiger) PushFileWithCallback(ctx context.Context, remotePath string, content []byte, executable bool, callback func(int64, int64)) error { + ret := _m.Called(ctx, remotePath, content, executable, callback) + + if len(ret) == 0 { + panic("no return value specified for PushFileWithCallback") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, []byte, bool, func(int64, int64)) error); ok { + r0 = rf(ctx, remotePath, content, executable, callback) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockSSHConfiger_PushFileWithCallback_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PushFileWithCallback' +type MockSSHConfiger_PushFileWithCallback_Call struct { + *mock.Call +} + +// PushFileWithCallback is a helper method to define mock.On call +// - ctx context.Context +// - remotePath string +// - content []byte +// - executable bool +// - callback func(int64 , int64) +func (_e *MockSSHConfiger_Expecter) PushFileWithCallback(ctx interface{}, remotePath interface{}, content interface{}, executable interface{}, callback interface{}) *MockSSHConfiger_PushFileWithCallback_Call { + return &MockSSHConfiger_PushFileWithCallback_Call{Call: _e.mock.On("PushFileWithCallback", ctx, remotePath, content, executable, callback)} +} + +func (_c *MockSSHConfiger_PushFileWithCallback_Call) Run(run func(ctx context.Context, remotePath string, content []byte, executable bool, callback func(int64, int64))) *MockSSHConfiger_PushFileWithCallback_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].([]byte), args[3].(bool), args[4].(func(int64, int64))) + }) + return _c +} + +func (_c *MockSSHConfiger_PushFileWithCallback_Call) Return(_a0 error) *MockSSHConfiger_PushFileWithCallback_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHConfiger_PushFileWithCallback_Call) RunAndReturn(run func(context.Context, string, []byte, bool, func(int64, int64)) error) *MockSSHConfiger_PushFileWithCallback_Call { + _c.Call.Return(run) + return _c +} + +// RestartService provides a mock function with given fields: ctx, serviceName +func (_m *MockSSHConfiger) RestartService(ctx context.Context, serviceName string) (string, error) { + ret := _m.Called(ctx, serviceName) + + if len(ret) == 0 { + panic("no return value specified for RestartService") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (string, error)); ok { + return rf(ctx, serviceName) + } + if rf, ok := ret.Get(0).(func(context.Context, string) string); ok { + r0 = rf(ctx, serviceName) + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, serviceName) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockSSHConfiger_RestartService_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RestartService' +type MockSSHConfiger_RestartService_Call struct { + *mock.Call +} + +// RestartService is a helper method to define mock.On call +// - ctx context.Context +// - serviceName string +func (_e *MockSSHConfiger_Expecter) RestartService(ctx interface{}, serviceName interface{}) *MockSSHConfiger_RestartService_Call { + return &MockSSHConfiger_RestartService_Call{Call: _e.mock.On("RestartService", ctx, serviceName)} +} + +func (_c *MockSSHConfiger_RestartService_Call) Run(run func(ctx context.Context, serviceName string)) *MockSSHConfiger_RestartService_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockSSHConfiger_RestartService_Call) Return(_a0 string, _a1 error) *MockSSHConfiger_RestartService_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockSSHConfiger_RestartService_Call) RunAndReturn(run func(context.Context, string) (string, error)) *MockSSHConfiger_RestartService_Call { + _c.Call.Return(run) + return _c +} + +// SetSFTPClientCreator provides a mock function with given fields: clientCreator +func (_m *MockSSHConfiger) SetSFTPClientCreator(clientCreator sshutils.SFTPClientCreator) { + _m.Called(clientCreator) +} + +// MockSSHConfiger_SetSFTPClientCreator_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetSFTPClientCreator' +type MockSSHConfiger_SetSFTPClientCreator_Call struct { + *mock.Call +} + +// SetSFTPClientCreator is a helper method to define mock.On call +// - clientCreator sshutils.SFTPClientCreator +func (_e *MockSSHConfiger_Expecter) SetSFTPClientCreator(clientCreator interface{}) *MockSSHConfiger_SetSFTPClientCreator_Call { + return &MockSSHConfiger_SetSFTPClientCreator_Call{Call: _e.mock.On("SetSFTPClientCreator", clientCreator)} +} + +func (_c *MockSSHConfiger_SetSFTPClientCreator_Call) Run(run func(clientCreator sshutils.SFTPClientCreator)) *MockSSHConfiger_SetSFTPClientCreator_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(sshutils.SFTPClientCreator)) + }) + return _c +} + +func (_c *MockSSHConfiger_SetSFTPClientCreator_Call) Return() *MockSSHConfiger_SetSFTPClientCreator_Call { + _c.Call.Return() + return _c +} + +func (_c *MockSSHConfiger_SetSFTPClientCreator_Call) RunAndReturn(run func(sshutils.SFTPClientCreator)) *MockSSHConfiger_SetSFTPClientCreator_Call { + _c.Call.Return(run) + return _c +} + +// SetSSHClient provides a mock function with given fields: client +func (_m *MockSSHConfiger) SetSSHClient(client *ssh.Client) { + _m.Called(client) +} + +// MockSSHConfiger_SetSSHClient_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetSSHClient' +type MockSSHConfiger_SetSSHClient_Call struct { + *mock.Call +} + +// SetSSHClient is a helper method to define mock.On call +// - client *ssh.Client +func (_e *MockSSHConfiger_Expecter) SetSSHClient(client interface{}) *MockSSHConfiger_SetSSHClient_Call { + return &MockSSHConfiger_SetSSHClient_Call{Call: _e.mock.On("SetSSHClient", client)} +} + +func (_c *MockSSHConfiger_SetSSHClient_Call) Run(run func(client *ssh.Client)) *MockSSHConfiger_SetSSHClient_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*ssh.Client)) + }) + return _c +} + +func (_c *MockSSHConfiger_SetSSHClient_Call) Return() *MockSSHConfiger_SetSSHClient_Call { + _c.Call.Return() + return _c +} + +func (_c *MockSSHConfiger_SetSSHClient_Call) RunAndReturn(run func(*ssh.Client)) *MockSSHConfiger_SetSSHClient_Call { + _c.Call.Return(run) + return _c +} + +// SetSSHClientCreator provides a mock function with given fields: clientCreator +func (_m *MockSSHConfiger) SetSSHClientCreator(clientCreator sshutils.SSHClientCreator) { + _m.Called(clientCreator) +} + +// MockSSHConfiger_SetSSHClientCreator_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetSSHClientCreator' +type MockSSHConfiger_SetSSHClientCreator_Call struct { + *mock.Call +} + +// SetSSHClientCreator is a helper method to define mock.On call +// - clientCreator sshutils.SSHClientCreator +func (_e *MockSSHConfiger_Expecter) SetSSHClientCreator(clientCreator interface{}) *MockSSHConfiger_SetSSHClientCreator_Call { + return &MockSSHConfiger_SetSSHClientCreator_Call{Call: _e.mock.On("SetSSHClientCreator", clientCreator)} +} + +func (_c *MockSSHConfiger_SetSSHClientCreator_Call) Run(run func(clientCreator sshutils.SSHClientCreator)) *MockSSHConfiger_SetSSHClientCreator_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(sshutils.SSHClientCreator)) + }) + return _c +} + +func (_c *MockSSHConfiger_SetSSHClientCreator_Call) Return() *MockSSHConfiger_SetSSHClientCreator_Call { + _c.Call.Return() + return _c +} + +func (_c *MockSSHConfiger_SetSSHClientCreator_Call) RunAndReturn(run func(sshutils.SSHClientCreator)) *MockSSHConfiger_SetSSHClientCreator_Call { + _c.Call.Return(run) + return _c +} + +// SetValidateSSHConnection provides a mock function with given fields: fn +func (_m *MockSSHConfiger) SetValidateSSHConnection(fn func() error) { + _m.Called(fn) +} + +// MockSSHConfiger_SetValidateSSHConnection_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetValidateSSHConnection' +type MockSSHConfiger_SetValidateSSHConnection_Call struct { + *mock.Call +} + +// SetValidateSSHConnection is a helper method to define mock.On call +// - fn func() error +func (_e *MockSSHConfiger_Expecter) SetValidateSSHConnection(fn interface{}) *MockSSHConfiger_SetValidateSSHConnection_Call { + return &MockSSHConfiger_SetValidateSSHConnection_Call{Call: _e.mock.On("SetValidateSSHConnection", fn)} +} + +func (_c *MockSSHConfiger_SetValidateSSHConnection_Call) Run(run func(fn func() error)) *MockSSHConfiger_SetValidateSSHConnection_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(func() error)) + }) + return _c +} + +func (_c *MockSSHConfiger_SetValidateSSHConnection_Call) Return() *MockSSHConfiger_SetValidateSSHConnection_Call { + _c.Call.Return() + return _c +} + +func (_c *MockSSHConfiger_SetValidateSSHConnection_Call) RunAndReturn(run func(func() error)) *MockSSHConfiger_SetValidateSSHConnection_Call { + _c.Call.Return(run) + return _c +} + +// StartService provides a mock function with given fields: ctx, serviceName +func (_m *MockSSHConfiger) StartService(ctx context.Context, serviceName string) (string, error) { + ret := _m.Called(ctx, serviceName) + + if len(ret) == 0 { + panic("no return value specified for StartService") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (string, error)); ok { + return rf(ctx, serviceName) + } + if rf, ok := ret.Get(0).(func(context.Context, string) string); ok { + r0 = rf(ctx, serviceName) + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, serviceName) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockSSHConfiger_StartService_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StartService' +type MockSSHConfiger_StartService_Call struct { + *mock.Call +} + +// StartService is a helper method to define mock.On call +// - ctx context.Context +// - serviceName string +func (_e *MockSSHConfiger_Expecter) StartService(ctx interface{}, serviceName interface{}) *MockSSHConfiger_StartService_Call { + return &MockSSHConfiger_StartService_Call{Call: _e.mock.On("StartService", ctx, serviceName)} +} + +func (_c *MockSSHConfiger_StartService_Call) Run(run func(ctx context.Context, serviceName string)) *MockSSHConfiger_StartService_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockSSHConfiger_StartService_Call) Return(_a0 string, _a1 error) *MockSSHConfiger_StartService_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockSSHConfiger_StartService_Call) RunAndReturn(run func(context.Context, string) (string, error)) *MockSSHConfiger_StartService_Call { + _c.Call.Return(run) + return _c +} + +// WaitForSSH provides a mock function with given fields: ctx, retry, timeout +func (_m *MockSSHConfiger) WaitForSSH(ctx context.Context, retry int, timeout time.Duration) error { + ret := _m.Called(ctx, retry, timeout) + + if len(ret) == 0 { + panic("no return value specified for WaitForSSH") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, int, time.Duration) error); ok { + r0 = rf(ctx, retry, timeout) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockSSHConfiger_WaitForSSH_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WaitForSSH' +type MockSSHConfiger_WaitForSSH_Call struct { + *mock.Call +} + +// WaitForSSH is a helper method to define mock.On call +// - ctx context.Context +// - retry int +// - timeout time.Duration +func (_e *MockSSHConfiger_Expecter) WaitForSSH(ctx interface{}, retry interface{}, timeout interface{}) *MockSSHConfiger_WaitForSSH_Call { + return &MockSSHConfiger_WaitForSSH_Call{Call: _e.mock.On("WaitForSSH", ctx, retry, timeout)} +} + +func (_c *MockSSHConfiger_WaitForSSH_Call) Run(run func(ctx context.Context, retry int, timeout time.Duration)) *MockSSHConfiger_WaitForSSH_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int), args[2].(time.Duration)) + }) + return _c +} + +func (_c *MockSSHConfiger_WaitForSSH_Call) Return(_a0 error) *MockSSHConfiger_WaitForSSH_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHConfiger_WaitForSSH_Call) RunAndReturn(run func(context.Context, int, time.Duration) error) *MockSSHConfiger_WaitForSSH_Call { + _c.Call.Return(run) + return _c +} + +// NewMockSSHConfiger creates a new instance of MockSSHConfiger. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockSSHConfiger(t interface { + mock.TestingT + Cleanup(func()) +}) *MockSSHConfiger { + mock := &MockSSHConfiger{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/sshutils/mock_SSHSessioner.go b/mocks/sshutils/mock_SSHSessioner.go new file mode 100644 index 00000000..b7a70e98 --- /dev/null +++ b/mocks/sshutils/mock_SSHSessioner.go @@ -0,0 +1,446 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + io "io" + + mock "github.com/stretchr/testify/mock" + ssh "golang.org/x/crypto/ssh" +) + +// MockSSHSessioner is an autogenerated mock type for the SSHSessioner type +type MockSSHSessioner struct { + mock.Mock +} + +type MockSSHSessioner_Expecter struct { + mock *mock.Mock +} + +func (_m *MockSSHSessioner) EXPECT() *MockSSHSessioner_Expecter { + return &MockSSHSessioner_Expecter{mock: &_m.Mock} +} + +// Close provides a mock function with given fields: +func (_m *MockSSHSessioner) Close() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Close") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockSSHSessioner_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type MockSSHSessioner_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *MockSSHSessioner_Expecter) Close() *MockSSHSessioner_Close_Call { + return &MockSSHSessioner_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *MockSSHSessioner_Close_Call) Run(run func()) *MockSSHSessioner_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSSHSessioner_Close_Call) Return(_a0 error) *MockSSHSessioner_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHSessioner_Close_Call) RunAndReturn(run func() error) *MockSSHSessioner_Close_Call { + _c.Call.Return(run) + return _c +} + +// CombinedOutput provides a mock function with given fields: cmd +func (_m *MockSSHSessioner) CombinedOutput(cmd string) ([]byte, error) { + ret := _m.Called(cmd) + + if len(ret) == 0 { + panic("no return value specified for CombinedOutput") + } + + var r0 []byte + var r1 error + if rf, ok := ret.Get(0).(func(string) ([]byte, error)); ok { + return rf(cmd) + } + if rf, ok := ret.Get(0).(func(string) []byte); ok { + r0 = rf(cmd) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]byte) + } + } + + if rf, ok := ret.Get(1).(func(string) error); ok { + r1 = rf(cmd) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockSSHSessioner_CombinedOutput_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CombinedOutput' +type MockSSHSessioner_CombinedOutput_Call struct { + *mock.Call +} + +// CombinedOutput is a helper method to define mock.On call +// - cmd string +func (_e *MockSSHSessioner_Expecter) CombinedOutput(cmd interface{}) *MockSSHSessioner_CombinedOutput_Call { + return &MockSSHSessioner_CombinedOutput_Call{Call: _e.mock.On("CombinedOutput", cmd)} +} + +func (_c *MockSSHSessioner_CombinedOutput_Call) Run(run func(cmd string)) *MockSSHSessioner_CombinedOutput_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *MockSSHSessioner_CombinedOutput_Call) Return(_a0 []byte, _a1 error) *MockSSHSessioner_CombinedOutput_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockSSHSessioner_CombinedOutput_Call) RunAndReturn(run func(string) ([]byte, error)) *MockSSHSessioner_CombinedOutput_Call { + _c.Call.Return(run) + return _c +} + +// Run provides a mock function with given fields: cmd +func (_m *MockSSHSessioner) Run(cmd string) error { + ret := _m.Called(cmd) + + if len(ret) == 0 { + panic("no return value specified for Run") + } + + var r0 error + if rf, ok := ret.Get(0).(func(string) error); ok { + r0 = rf(cmd) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockSSHSessioner_Run_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Run' +type MockSSHSessioner_Run_Call struct { + *mock.Call +} + +// Run is a helper method to define mock.On call +// - cmd string +func (_e *MockSSHSessioner_Expecter) Run(cmd interface{}) *MockSSHSessioner_Run_Call { + return &MockSSHSessioner_Run_Call{Call: _e.mock.On("Run", cmd)} +} + +func (_c *MockSSHSessioner_Run_Call) Run(run func(cmd string)) *MockSSHSessioner_Run_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *MockSSHSessioner_Run_Call) Return(_a0 error) *MockSSHSessioner_Run_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHSessioner_Run_Call) RunAndReturn(run func(string) error) *MockSSHSessioner_Run_Call { + _c.Call.Return(run) + return _c +} + +// SetStderr provides a mock function with given fields: _a0 +func (_m *MockSSHSessioner) SetStderr(_a0 io.Writer) { + _m.Called(_a0) +} + +// MockSSHSessioner_SetStderr_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetStderr' +type MockSSHSessioner_SetStderr_Call struct { + *mock.Call +} + +// SetStderr is a helper method to define mock.On call +// - _a0 io.Writer +func (_e *MockSSHSessioner_Expecter) SetStderr(_a0 interface{}) *MockSSHSessioner_SetStderr_Call { + return &MockSSHSessioner_SetStderr_Call{Call: _e.mock.On("SetStderr", _a0)} +} + +func (_c *MockSSHSessioner_SetStderr_Call) Run(run func(_a0 io.Writer)) *MockSSHSessioner_SetStderr_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(io.Writer)) + }) + return _c +} + +func (_c *MockSSHSessioner_SetStderr_Call) Return() *MockSSHSessioner_SetStderr_Call { + _c.Call.Return() + return _c +} + +func (_c *MockSSHSessioner_SetStderr_Call) RunAndReturn(run func(io.Writer)) *MockSSHSessioner_SetStderr_Call { + _c.Call.Return(run) + return _c +} + +// SetStdout provides a mock function with given fields: _a0 +func (_m *MockSSHSessioner) SetStdout(_a0 io.Writer) { + _m.Called(_a0) +} + +// MockSSHSessioner_SetStdout_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetStdout' +type MockSSHSessioner_SetStdout_Call struct { + *mock.Call +} + +// SetStdout is a helper method to define mock.On call +// - _a0 io.Writer +func (_e *MockSSHSessioner_Expecter) SetStdout(_a0 interface{}) *MockSSHSessioner_SetStdout_Call { + return &MockSSHSessioner_SetStdout_Call{Call: _e.mock.On("SetStdout", _a0)} +} + +func (_c *MockSSHSessioner_SetStdout_Call) Run(run func(_a0 io.Writer)) *MockSSHSessioner_SetStdout_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(io.Writer)) + }) + return _c +} + +func (_c *MockSSHSessioner_SetStdout_Call) Return() *MockSSHSessioner_SetStdout_Call { + _c.Call.Return() + return _c +} + +func (_c *MockSSHSessioner_SetStdout_Call) RunAndReturn(run func(io.Writer)) *MockSSHSessioner_SetStdout_Call { + _c.Call.Return(run) + return _c +} + +// Signal provides a mock function with given fields: sig +func (_m *MockSSHSessioner) Signal(sig ssh.Signal) error { + ret := _m.Called(sig) + + if len(ret) == 0 { + panic("no return value specified for Signal") + } + + var r0 error + if rf, ok := ret.Get(0).(func(ssh.Signal) error); ok { + r0 = rf(sig) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockSSHSessioner_Signal_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Signal' +type MockSSHSessioner_Signal_Call struct { + *mock.Call +} + +// Signal is a helper method to define mock.On call +// - sig ssh.Signal +func (_e *MockSSHSessioner_Expecter) Signal(sig interface{}) *MockSSHSessioner_Signal_Call { + return &MockSSHSessioner_Signal_Call{Call: _e.mock.On("Signal", sig)} +} + +func (_c *MockSSHSessioner_Signal_Call) Run(run func(sig ssh.Signal)) *MockSSHSessioner_Signal_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(ssh.Signal)) + }) + return _c +} + +func (_c *MockSSHSessioner_Signal_Call) Return(_a0 error) *MockSSHSessioner_Signal_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHSessioner_Signal_Call) RunAndReturn(run func(ssh.Signal) error) *MockSSHSessioner_Signal_Call { + _c.Call.Return(run) + return _c +} + +// Start provides a mock function with given fields: cmd +func (_m *MockSSHSessioner) Start(cmd string) error { + ret := _m.Called(cmd) + + if len(ret) == 0 { + panic("no return value specified for Start") + } + + var r0 error + if rf, ok := ret.Get(0).(func(string) error); ok { + r0 = rf(cmd) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockSSHSessioner_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' +type MockSSHSessioner_Start_Call struct { + *mock.Call +} + +// Start is a helper method to define mock.On call +// - cmd string +func (_e *MockSSHSessioner_Expecter) Start(cmd interface{}) *MockSSHSessioner_Start_Call { + return &MockSSHSessioner_Start_Call{Call: _e.mock.On("Start", cmd)} +} + +func (_c *MockSSHSessioner_Start_Call) Run(run func(cmd string)) *MockSSHSessioner_Start_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *MockSSHSessioner_Start_Call) Return(_a0 error) *MockSSHSessioner_Start_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHSessioner_Start_Call) RunAndReturn(run func(string) error) *MockSSHSessioner_Start_Call { + _c.Call.Return(run) + return _c +} + +// StdinPipe provides a mock function with given fields: +func (_m *MockSSHSessioner) StdinPipe() (io.WriteCloser, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for StdinPipe") + } + + var r0 io.WriteCloser + var r1 error + if rf, ok := ret.Get(0).(func() (io.WriteCloser, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() io.WriteCloser); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(io.WriteCloser) + } + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockSSHSessioner_StdinPipe_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StdinPipe' +type MockSSHSessioner_StdinPipe_Call struct { + *mock.Call +} + +// StdinPipe is a helper method to define mock.On call +func (_e *MockSSHSessioner_Expecter) StdinPipe() *MockSSHSessioner_StdinPipe_Call { + return &MockSSHSessioner_StdinPipe_Call{Call: _e.mock.On("StdinPipe")} +} + +func (_c *MockSSHSessioner_StdinPipe_Call) Run(run func()) *MockSSHSessioner_StdinPipe_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSSHSessioner_StdinPipe_Call) Return(_a0 io.WriteCloser, _a1 error) *MockSSHSessioner_StdinPipe_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockSSHSessioner_StdinPipe_Call) RunAndReturn(run func() (io.WriteCloser, error)) *MockSSHSessioner_StdinPipe_Call { + _c.Call.Return(run) + return _c +} + +// Wait provides a mock function with given fields: +func (_m *MockSSHSessioner) Wait() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Wait") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockSSHSessioner_Wait_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Wait' +type MockSSHSessioner_Wait_Call struct { + *mock.Call +} + +// Wait is a helper method to define mock.On call +func (_e *MockSSHSessioner_Expecter) Wait() *MockSSHSessioner_Wait_Call { + return &MockSSHSessioner_Wait_Call{Call: _e.mock.On("Wait")} +} + +func (_c *MockSSHSessioner_Wait_Call) Run(run func()) *MockSSHSessioner_Wait_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSSHSessioner_Wait_Call) Return(_a0 error) *MockSSHSessioner_Wait_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHSessioner_Wait_Call) RunAndReturn(run func() error) *MockSSHSessioner_Wait_Call { + _c.Call.Return(run) + return _c +} + +// NewMockSSHSessioner creates a new instance of MockSSHSessioner. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockSSHSessioner(t interface { + mock.TestingT + Cleanup(func()) +}) *MockSSHSessioner { + mock := &MockSSHSessioner{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/pkg/models/aws.go b/pkg/models/aws.go new file mode 100644 index 00000000..461d2ed0 --- /dev/null +++ b/pkg/models/aws.go @@ -0,0 +1,26 @@ +package models + +import ( + "sync" +) + +// AWSDeployment represents AWS-specific deployment configuration +type AWSDeployment struct { + DefaultMachineType string `json:"default_machine_type,omitempty"` + DefaultDiskSizeGB int32 `json:"default_disk_size_gb,omitempty"` + DefaultCountPerRegion int32 `json:"default_count_per_zone,omitempty"` + AccountID string `json:"account_id,omitempty"` + RegionalResources *RegionalResources `json:"regional_resources,omitempty"` + mu sync.RWMutex +} + +// AWSVPC represents AWS VPC and related resources +type AWSVPC struct { + VPCID string `json:"vpc_id"` + SecurityGroupID string `json:"security_group_id"` + SubnetID string `json:"subnet_id"` + PublicSubnetIDs []string `json:"public_subnet_ids,omitempty"` + PrivateSubnetIDs []string `json:"private_subnet_ids,omitempty"` + InternetGatewayID string `json:"internet_gateway_id,omitempty"` + PublicRouteTableID string `json:"public_route_table_id,omitempty"` +} diff --git a/pkg/models/deployment.go b/pkg/models/deployment.go index 60817697..0e6dfc04 100644 --- a/pkg/models/deployment.go +++ b/pkg/models/deployment.go @@ -2,12 +2,15 @@ package models import ( "fmt" + "strings" "sync" "time" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute" "github.com/bacalhau-project/andaime/pkg/logger" "github.com/spf13/viper" + + aws_interface "github.com/bacalhau-project/andaime/pkg/models/interfaces/aws" ) type ServiceState int @@ -75,7 +78,7 @@ type Deployment struct { DeploymentType DeploymentType Azure *AzureConfig GCP *GCPConfig - AWS *AWSConfig + AWS *AWSDeployment Machines map[string]Machiner UniqueID string StartTime time.Time @@ -89,6 +92,7 @@ type Deployment struct { SSHPublicKeyMaterial string SSHPrivateKeyPath string SSHPrivateKeyMaterial string + SSHKeyName string OrchestratorIP string Tags map[string]string ProjectServiceAccounts map[string]ServiceAccountInfo @@ -120,10 +124,10 @@ func NewDeployment() (*Deployment, error) { UniqueID: uniqueID, Azure: &AzureConfig{}, GCP: &GCPConfig{}, - AWS: &AWSConfig{}, Tags: make(map[string]string), ProjectServiceAccounts: make(map[string]ServiceAccountInfo), } + deployment.InitializeAWSDeployment() timestamp := time.Now().Format("01021504") // mmddhhmm if deployment.DeploymentType == DeploymentTypeGCP { @@ -141,15 +145,23 @@ func NewDeployment() (*Deployment, error) { MaximumGCPUniqueProjectIDLength, ) } - - l.Debugf("Ensuring project: %s", uniqueProjectID) - deployment.SetProjectID(uniqueProjectID) } return deployment, nil } +func (d *Deployment) InitializeAWSDeployment() *AWSDeployment { + if d.AWS == nil { + d.AWS = &AWSDeployment{} + d.AWS.RegionalResources = &RegionalResources{} + d.AWS.RegionalResources.VPCs = make(map[string]*AWSVPC) + d.AWS.RegionalResources.Clients = make(map[string]aws_interface.EC2Clienter) + } + + return d.AWS +} + func (d *Deployment) ToMap() map[string]interface{} { d.mu.RLock() defer d.mu.RUnlock() @@ -165,36 +177,80 @@ func (d *Deployment) ToMap() map[string]interface{} { func (d *Deployment) UpdateViperConfig() error { d.mu.RLock() defer d.mu.RUnlock() - var deploymentPath string - if d.DeploymentType == DeploymentTypeAzure { - deploymentPath = fmt.Sprintf( - "deployments.%s.azure.%s", - d.UniqueID, - d.Azure.ResourceGroupName, - ) - } else if d.DeploymentType == DeploymentTypeGCP { - deploymentPath = fmt.Sprintf( - "deployments.%s.gcp.%s", - d.UniqueID, - d.GCP.ProjectID, - ) - } else if d.DeploymentType == DeploymentTypeAWS { - deploymentPath = fmt.Sprintf( - "deployments.%s.aws.%s", - d.UniqueID, - d.AWS.Region, - ) - } - viperMachines := make(map[string]map[string]interface{}) - for _, machine := range d.Machines { - viperMachines[machine.GetName()] = map[string]interface{}{ - "Name": machine.GetName(), - "PublicIP": machine.GetPublicIP(), - "PrivateIP": machine.GetPrivateIP(), - "Orchestrator": machine.IsOrchestrator(), + + deploymentPath := fmt.Sprintf("deployments.%s", d.UniqueID) + + // Common deployment settings + viper.Set(fmt.Sprintf("%s.provider", deploymentPath), strings.ToLower(string(d.DeploymentType))) + + // Provider-specific settings + switch d.DeploymentType { + case DeploymentTypeAzure: + viper.Set(fmt.Sprintf("%s.azure.subscription_id", deploymentPath), d.Azure.SubscriptionID) + viper.Set(fmt.Sprintf("%s.azure.resource_group", deploymentPath), d.Azure.ResourceGroupName) + for _, machine := range d.Machines { + viper.Set( + fmt.Sprintf("%s.azure.machines.%s", deploymentPath, machine.GetName()), + map[string]interface{}{ + "name": machine.GetName(), + "public_ip": machine.GetPublicIP(), + "private_ip": machine.GetPrivateIP(), + "orchestrator": machine.IsOrchestrator(), + }, + ) + } + + case DeploymentTypeGCP: + viper.Set(fmt.Sprintf("%s.gcp.project_id", deploymentPath), d.GCP.ProjectID) + viper.Set(fmt.Sprintf("%s.gcp.organization_id", deploymentPath), d.GCP.OrganizationID) + for _, machine := range d.Machines { + viper.Set( + fmt.Sprintf("%s.gcp.machines.%s", deploymentPath, machine.GetName()), + map[string]interface{}{ + "name": machine.GetName(), + "public_ip": machine.GetPublicIP(), + "private_ip": machine.GetPrivateIP(), + "orchestrator": machine.IsOrchestrator(), + }, + ) + } + + case DeploymentTypeAWS: + viper.Set(fmt.Sprintf("%s.aws.account_id", deploymentPath), d.AWS.AccountID) + if d.AWS.RegionalResources != nil { + for region, vpc := range d.AWS.RegionalResources.VPCs { + regionPath := fmt.Sprintf("%s.aws.regions.%s", deploymentPath, region) + viper.Set(fmt.Sprintf("%s.vpc_id", regionPath), vpc.VPCID) + viper.Set(fmt.Sprintf("%s.security_group_id", regionPath), vpc.SecurityGroupID) + + // Group machines by region + for _, machine := range d.Machines { + machineRegion := machine.GetLocation() + if machineRegion == "" { + continue + } + // Convert AWS Zone to region if necessary (e.g., us-west-2a -> us-west-2) + if len(machineRegion) > 0 && + machineRegion[len(machineRegion)-1] >= 'a' && + machineRegion[len(machineRegion)-1] <= 'z' { + machineRegion = machineRegion[:len(machineRegion)-1] + } + if machineRegion == region { + viper.Set( + fmt.Sprintf("%s.machines.%s", regionPath, machine.GetName()), + map[string]interface{}{ + "name": machine.GetName(), + "public_ip": machine.GetPublicIP(), + "private_ip": machine.GetPrivateIP(), + "orchestrator": machine.IsOrchestrator(), + }, + ) + } + } + } } } - viper.Set(deploymentPath, viperMachines) + return viper.WriteConfig() } @@ -270,6 +326,12 @@ func (d *Deployment) GetProjectID() string { return d.projectID } +func (d *Deployment) GetSSHKeyName() string { + d.mu.RLock() + defer d.mu.RUnlock() + return d.SSHKeyName +} + func (d *Deployment) SetProjectID(projectID string) { d.mu.Lock() defer d.mu.Unlock() @@ -332,11 +394,78 @@ type GCPConfig struct { } type AWSConfig struct { - Region string - VPCID string - SubnetID string - DefaultRegion string + AccountID string DefaultMachineType string DefaultDiskSizeGB int32 DefaultCountPerRegion int + RegionalResources *RegionalResources +} + +// RegionalResources tracks VPCs and other resources per region +type RegionalResources struct { + mu sync.RWMutex + VPCs map[string]*AWSVPC // key is region + Clients map[string]aws_interface.EC2Clienter +} + +func (r *RegionalResources) Lock() { + if r == nil { + return + } + r.mu.Lock() +} + +func (r *RegionalResources) Unlock() { + if r == nil { + return + } + r.mu.Unlock() +} + +func (r *RegionalResources) RLock() { + r.mu.Lock() +} + +func (r *RegionalResources) RUnlock() { + r.mu.Unlock() +} + +func (r *RegionalResources) GetVPC(region string) *AWSVPC { + r.Lock() + defer r.Unlock() + if r.VPCs == nil { + r.VPCs = make(map[string]*AWSVPC) + } + return r.VPCs[region] +} + +func (r *RegionalResources) SetVPC(region string, vpc *AWSVPC) { + r.Lock() + defer r.Unlock() + if r.VPCs == nil { + r.VPCs = make(map[string]*AWSVPC) + } + r.VPCs[region] = vpc +} + +func (r *RegionalResources) SetSGID(region string, sgID string) { + r.Lock() + defer r.Unlock() + if r.VPCs == nil { + r.VPCs = make(map[string]*AWSVPC) + } + if r.VPCs[region] == nil { + r.VPCs[region] = &AWSVPC{} + } + r.VPCs[region].SecurityGroupID = sgID +} + +type RegionalVPC struct { + VPCID string + Region string + SecurityGroupID string + PublicSubnetIDs []string + PrivateSubnetIDs []string + InternetGatewayID string + PublicRouteTableID string } diff --git a/pkg/models/interfaces/aws/aws_providerer.go b/pkg/models/interfaces/aws/aws_providerer.go deleted file mode 100644 index de3e9ce6..00000000 --- a/pkg/models/interfaces/aws/aws_providerer.go +++ /dev/null @@ -1,77 +0,0 @@ -package aws - -import ( - "context" - - "github.com/aws/aws-cdk-go/awscdk/v2" - "github.com/aws/aws-cdk-go/awscdk/v2/awsec2" - "github.com/aws/aws-sdk-go-v2/service/cloudformation" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" -) - -type AWSProviderer interface { - CreateDeployment(ctx context.Context) error - ListDeployments(ctx context.Context) ([]string, error) - TerminateDeployment(ctx context.Context) error - GetLatestUbuntuImage(ctx context.Context, region string) (*types.Image, error) - GetEC2Client() (EC2Clienter, error) - SetEC2Client(client EC2Clienter) - Destroy(ctx context.Context) error - GetVMExternalIP(ctx context.Context, instanceID string) (string, error) - ValidateMachineType(ctx context.Context, location, instanceType string) (bool, error) - CreateVPCAndSubnet(ctx context.Context) error - StartResourcePolling(ctx context.Context) error -} - -// CloudFormationAPI represents the AWS CloudFormation operations -type CloudFormationAPIer interface { - GetTemplate( - ctx context.Context, - params *cloudformation.GetTemplateInput, - opts ...func(*cloudformation.Options), - ) (*cloudformation.GetTemplateOutput, error) - DescribeStacks( - ctx context.Context, - params *cloudformation.DescribeStacksInput, - opts ...func(*cloudformation.Options), - ) (*cloudformation.DescribeStacksOutput, error) - DescribeStackEvents( - ctx context.Context, - params *cloudformation.DescribeStackEventsInput, - opts ...func(*cloudformation.Options), - ) (*cloudformation.DescribeStackEventsOutput, error) - CreateStack( - ctx context.Context, - params *cloudformation.CreateStackInput, - opts ...func(*cloudformation.Options), - ) (*cloudformation.CreateStackOutput, error) - UpdateStack( - ctx context.Context, - params *cloudformation.UpdateStackInput, - opts ...func(*cloudformation.Options), - ) (*cloudformation.UpdateStackOutput, error) - DeleteStack( - ctx context.Context, - params *cloudformation.DeleteStackInput, - opts ...func(*cloudformation.Options), - ) (*cloudformation.DeleteStackOutput, error) - ListStacks( - ctx context.Context, - params *cloudformation.ListStacksInput, - opts ...func(*cloudformation.Options), - ) (*cloudformation.ListStacksOutput, error) -} - -// AWSInfraProvider defines the interface for AWS infrastructure operations -type AWSInfraProviderer interface { - CreateVPC(stack awscdk.Stack) awsec2.IVpc - NewStack(scope awscdk.App, id string, props *awscdk.StackProps) awscdk.Stack - SynthTemplate(app awscdk.App) (string, error) - GetCloudFormationClient() CloudFormationAPIer -} - -// CDKStackProvider defines the interface for CDK stack operations -type CDKStackProviderer interface { - NewStack(scope awscdk.App, id string, props *awscdk.StackProps) awscdk.Stack - GetTemplate(stack awscdk.Stack) (string, error) -} diff --git a/pkg/models/interfaces/aws/ec2_clienter.go b/pkg/models/interfaces/aws/ec2_clienter.go index 07e94f5b..d1bda26a 100644 --- a/pkg/models/interfaces/aws/ec2_clienter.go +++ b/pkg/models/interfaces/aws/ec2_clienter.go @@ -33,16 +33,41 @@ type EC2Clienter interface { params *ec2.CreateSubnetInput, optFns ...func(*ec2.Options), ) (*ec2.CreateSubnetOutput, error) - CreateVPC( + CreateVpc( ctx context.Context, params *ec2.CreateVpcInput, optFns ...func(*ec2.Options), ) (*ec2.CreateVpcOutput, error) - DescribeVPCs( + DescribeVpcs( ctx context.Context, params *ec2.DescribeVpcsInput, optFns ...func(*ec2.Options), ) (*ec2.DescribeVpcsOutput, error) + CreateSecurityGroup( + ctx context.Context, + params *ec2.CreateSecurityGroupInput, + optFns ...func(*ec2.Options), + ) (*ec2.CreateSecurityGroupOutput, error) + DescribeSecurityGroups( + ctx context.Context, + params *ec2.DescribeSecurityGroupsInput, + optFns ...func(*ec2.Options), + ) (*ec2.DescribeSecurityGroupsOutput, error) + AuthorizeSecurityGroupIngress( + ctx context.Context, + params *ec2.AuthorizeSecurityGroupIngressInput, + optFns ...func(*ec2.Options), + ) (*ec2.AuthorizeSecurityGroupIngressOutput, error) + DescribeSubnets( + ctx context.Context, + params *ec2.DescribeSubnetsInput, + optFns ...func(*ec2.Options), + ) (*ec2.DescribeSubnetsOutput, error) + DeleteVpc( + ctx context.Context, + params *ec2.DeleteVpcInput, + optFns ...func(*ec2.Options), + ) (*ec2.DeleteVpcOutput, error) CreateInternetGateway( ctx context.Context, params *ec2.CreateInternetGatewayInput, @@ -68,4 +93,59 @@ type EC2Clienter interface { params *ec2.AssociateRouteTableInput, optFns ...func(*ec2.Options), ) (*ec2.AssociateRouteTableOutput, error) + DescribeRouteTables( + ctx context.Context, + params *ec2.DescribeRouteTablesInput, + optFns ...func(*ec2.Options), + ) (*ec2.DescribeRouteTablesOutput, error) + DeleteSubnet( + ctx context.Context, + params *ec2.DeleteSubnetInput, + optFns ...func(*ec2.Options), + ) (*ec2.DeleteSubnetOutput, error) + DeleteSecurityGroup( + ctx context.Context, + params *ec2.DeleteSecurityGroupInput, + optFns ...func(*ec2.Options), + ) (*ec2.DeleteSecurityGroupOutput, error) + DescribeRegions( + ctx context.Context, + params *ec2.DescribeRegionsInput, + optFns ...func(*ec2.Options), + ) (*ec2.DescribeRegionsOutput, error) + ModifyVpcAttribute( + ctx context.Context, + params *ec2.ModifyVpcAttributeInput, + optFns ...func(*ec2.Options), + ) (*ec2.ModifyVpcAttributeOutput, error) + DisassociateRouteTable( + ctx context.Context, + params *ec2.DisassociateRouteTableInput, + optFns ...func(*ec2.Options), + ) (*ec2.DisassociateRouteTableOutput, error) + DeleteRouteTable( + ctx context.Context, + params *ec2.DeleteRouteTableInput, + optFns ...func(*ec2.Options), + ) (*ec2.DeleteRouteTableOutput, error) + DescribeInternetGateways( + ctx context.Context, + params *ec2.DescribeInternetGatewaysInput, + optFns ...func(*ec2.Options), + ) (*ec2.DescribeInternetGatewaysOutput, error) + DetachInternetGateway( + ctx context.Context, + params *ec2.DetachInternetGatewayInput, + optFns ...func(*ec2.Options), + ) (*ec2.DetachInternetGatewayOutput, error) + DeleteInternetGateway( + ctx context.Context, + params *ec2.DeleteInternetGatewayInput, + optFns ...func(*ec2.Options), + ) (*ec2.DeleteInternetGatewayOutput, error) + DescribeAvailabilityZones( + ctx context.Context, + params *ec2.DescribeAvailabilityZonesInput, + optFns ...func(*ec2.Options), + ) (*ec2.DescribeAvailabilityZonesOutput, error) } diff --git a/pkg/models/interfaces/aws/mocks/aws/mock_EC2Clienter.go b/pkg/models/interfaces/aws/mocks/aws/mock_EC2Clienter.go new file mode 100644 index 00000000..45ad371c --- /dev/null +++ b/pkg/models/interfaces/aws/mocks/aws/mock_EC2Clienter.go @@ -0,0 +1,2109 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package aws + +import ( + context "context" + + ec2 "github.com/aws/aws-sdk-go-v2/service/ec2" + mock "github.com/stretchr/testify/mock" +) + +// MockEC2Clienter is an autogenerated mock type for the EC2Clienter type +type MockEC2Clienter struct { + mock.Mock +} + +type MockEC2Clienter_Expecter struct { + mock *mock.Mock +} + +func (_m *MockEC2Clienter) EXPECT() *MockEC2Clienter_Expecter { + return &MockEC2Clienter_Expecter{mock: &_m.Mock} +} + +// AssociateRouteTable provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) AssociateRouteTable(ctx context.Context, params *ec2.AssociateRouteTableInput, optFns ...func(*ec2.Options)) (*ec2.AssociateRouteTableOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for AssociateRouteTable") + } + + var r0 *ec2.AssociateRouteTableOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.AssociateRouteTableInput, ...func(*ec2.Options)) (*ec2.AssociateRouteTableOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.AssociateRouteTableInput, ...func(*ec2.Options)) *ec2.AssociateRouteTableOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.AssociateRouteTableOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.AssociateRouteTableInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_AssociateRouteTable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AssociateRouteTable' +type MockEC2Clienter_AssociateRouteTable_Call struct { + *mock.Call +} + +// AssociateRouteTable is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.AssociateRouteTableInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) AssociateRouteTable(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_AssociateRouteTable_Call { + return &MockEC2Clienter_AssociateRouteTable_Call{Call: _e.mock.On("AssociateRouteTable", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_AssociateRouteTable_Call) Run(run func(ctx context.Context, params *ec2.AssociateRouteTableInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_AssociateRouteTable_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.AssociateRouteTableInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_AssociateRouteTable_Call) Return(_a0 *ec2.AssociateRouteTableOutput, _a1 error) *MockEC2Clienter_AssociateRouteTable_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_AssociateRouteTable_Call) RunAndReturn(run func(context.Context, *ec2.AssociateRouteTableInput, ...func(*ec2.Options)) (*ec2.AssociateRouteTableOutput, error)) *MockEC2Clienter_AssociateRouteTable_Call { + _c.Call.Return(run) + return _c +} + +// AttachInternetGateway provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) AttachInternetGateway(ctx context.Context, params *ec2.AttachInternetGatewayInput, optFns ...func(*ec2.Options)) (*ec2.AttachInternetGatewayOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for AttachInternetGateway") + } + + var r0 *ec2.AttachInternetGatewayOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.AttachInternetGatewayInput, ...func(*ec2.Options)) (*ec2.AttachInternetGatewayOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.AttachInternetGatewayInput, ...func(*ec2.Options)) *ec2.AttachInternetGatewayOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.AttachInternetGatewayOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.AttachInternetGatewayInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_AttachInternetGateway_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AttachInternetGateway' +type MockEC2Clienter_AttachInternetGateway_Call struct { + *mock.Call +} + +// AttachInternetGateway is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.AttachInternetGatewayInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) AttachInternetGateway(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_AttachInternetGateway_Call { + return &MockEC2Clienter_AttachInternetGateway_Call{Call: _e.mock.On("AttachInternetGateway", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_AttachInternetGateway_Call) Run(run func(ctx context.Context, params *ec2.AttachInternetGatewayInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_AttachInternetGateway_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.AttachInternetGatewayInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_AttachInternetGateway_Call) Return(_a0 *ec2.AttachInternetGatewayOutput, _a1 error) *MockEC2Clienter_AttachInternetGateway_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_AttachInternetGateway_Call) RunAndReturn(run func(context.Context, *ec2.AttachInternetGatewayInput, ...func(*ec2.Options)) (*ec2.AttachInternetGatewayOutput, error)) *MockEC2Clienter_AttachInternetGateway_Call { + _c.Call.Return(run) + return _c +} + +// AuthorizeSecurityGroupIngress provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) AuthorizeSecurityGroupIngress(ctx context.Context, params *ec2.AuthorizeSecurityGroupIngressInput, optFns ...func(*ec2.Options)) (*ec2.AuthorizeSecurityGroupIngressOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for AuthorizeSecurityGroupIngress") + } + + var r0 *ec2.AuthorizeSecurityGroupIngressOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.AuthorizeSecurityGroupIngressInput, ...func(*ec2.Options)) (*ec2.AuthorizeSecurityGroupIngressOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.AuthorizeSecurityGroupIngressInput, ...func(*ec2.Options)) *ec2.AuthorizeSecurityGroupIngressOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.AuthorizeSecurityGroupIngressOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.AuthorizeSecurityGroupIngressInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_AuthorizeSecurityGroupIngress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AuthorizeSecurityGroupIngress' +type MockEC2Clienter_AuthorizeSecurityGroupIngress_Call struct { + *mock.Call +} + +// AuthorizeSecurityGroupIngress is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.AuthorizeSecurityGroupIngressInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) AuthorizeSecurityGroupIngress(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_AuthorizeSecurityGroupIngress_Call { + return &MockEC2Clienter_AuthorizeSecurityGroupIngress_Call{Call: _e.mock.On("AuthorizeSecurityGroupIngress", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_AuthorizeSecurityGroupIngress_Call) Run(run func(ctx context.Context, params *ec2.AuthorizeSecurityGroupIngressInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_AuthorizeSecurityGroupIngress_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.AuthorizeSecurityGroupIngressInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_AuthorizeSecurityGroupIngress_Call) Return(_a0 *ec2.AuthorizeSecurityGroupIngressOutput, _a1 error) *MockEC2Clienter_AuthorizeSecurityGroupIngress_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_AuthorizeSecurityGroupIngress_Call) RunAndReturn(run func(context.Context, *ec2.AuthorizeSecurityGroupIngressInput, ...func(*ec2.Options)) (*ec2.AuthorizeSecurityGroupIngressOutput, error)) *MockEC2Clienter_AuthorizeSecurityGroupIngress_Call { + _c.Call.Return(run) + return _c +} + +// CreateInternetGateway provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) CreateInternetGateway(ctx context.Context, params *ec2.CreateInternetGatewayInput, optFns ...func(*ec2.Options)) (*ec2.CreateInternetGatewayOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for CreateInternetGateway") + } + + var r0 *ec2.CreateInternetGatewayOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.CreateInternetGatewayInput, ...func(*ec2.Options)) (*ec2.CreateInternetGatewayOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.CreateInternetGatewayInput, ...func(*ec2.Options)) *ec2.CreateInternetGatewayOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.CreateInternetGatewayOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.CreateInternetGatewayInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_CreateInternetGateway_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateInternetGateway' +type MockEC2Clienter_CreateInternetGateway_Call struct { + *mock.Call +} + +// CreateInternetGateway is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.CreateInternetGatewayInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) CreateInternetGateway(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_CreateInternetGateway_Call { + return &MockEC2Clienter_CreateInternetGateway_Call{Call: _e.mock.On("CreateInternetGateway", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_CreateInternetGateway_Call) Run(run func(ctx context.Context, params *ec2.CreateInternetGatewayInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_CreateInternetGateway_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.CreateInternetGatewayInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_CreateInternetGateway_Call) Return(_a0 *ec2.CreateInternetGatewayOutput, _a1 error) *MockEC2Clienter_CreateInternetGateway_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_CreateInternetGateway_Call) RunAndReturn(run func(context.Context, *ec2.CreateInternetGatewayInput, ...func(*ec2.Options)) (*ec2.CreateInternetGatewayOutput, error)) *MockEC2Clienter_CreateInternetGateway_Call { + _c.Call.Return(run) + return _c +} + +// CreateRoute provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) CreateRoute(ctx context.Context, params *ec2.CreateRouteInput, optFns ...func(*ec2.Options)) (*ec2.CreateRouteOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for CreateRoute") + } + + var r0 *ec2.CreateRouteOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.CreateRouteInput, ...func(*ec2.Options)) (*ec2.CreateRouteOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.CreateRouteInput, ...func(*ec2.Options)) *ec2.CreateRouteOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.CreateRouteOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.CreateRouteInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_CreateRoute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateRoute' +type MockEC2Clienter_CreateRoute_Call struct { + *mock.Call +} + +// CreateRoute is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.CreateRouteInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) CreateRoute(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_CreateRoute_Call { + return &MockEC2Clienter_CreateRoute_Call{Call: _e.mock.On("CreateRoute", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_CreateRoute_Call) Run(run func(ctx context.Context, params *ec2.CreateRouteInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_CreateRoute_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.CreateRouteInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_CreateRoute_Call) Return(_a0 *ec2.CreateRouteOutput, _a1 error) *MockEC2Clienter_CreateRoute_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_CreateRoute_Call) RunAndReturn(run func(context.Context, *ec2.CreateRouteInput, ...func(*ec2.Options)) (*ec2.CreateRouteOutput, error)) *MockEC2Clienter_CreateRoute_Call { + _c.Call.Return(run) + return _c +} + +// CreateRouteTable provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) CreateRouteTable(ctx context.Context, params *ec2.CreateRouteTableInput, optFns ...func(*ec2.Options)) (*ec2.CreateRouteTableOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for CreateRouteTable") + } + + var r0 *ec2.CreateRouteTableOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.CreateRouteTableInput, ...func(*ec2.Options)) (*ec2.CreateRouteTableOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.CreateRouteTableInput, ...func(*ec2.Options)) *ec2.CreateRouteTableOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.CreateRouteTableOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.CreateRouteTableInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_CreateRouteTable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateRouteTable' +type MockEC2Clienter_CreateRouteTable_Call struct { + *mock.Call +} + +// CreateRouteTable is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.CreateRouteTableInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) CreateRouteTable(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_CreateRouteTable_Call { + return &MockEC2Clienter_CreateRouteTable_Call{Call: _e.mock.On("CreateRouteTable", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_CreateRouteTable_Call) Run(run func(ctx context.Context, params *ec2.CreateRouteTableInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_CreateRouteTable_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.CreateRouteTableInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_CreateRouteTable_Call) Return(_a0 *ec2.CreateRouteTableOutput, _a1 error) *MockEC2Clienter_CreateRouteTable_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_CreateRouteTable_Call) RunAndReturn(run func(context.Context, *ec2.CreateRouteTableInput, ...func(*ec2.Options)) (*ec2.CreateRouteTableOutput, error)) *MockEC2Clienter_CreateRouteTable_Call { + _c.Call.Return(run) + return _c +} + +// CreateSecurityGroup provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) CreateSecurityGroup(ctx context.Context, params *ec2.CreateSecurityGroupInput, optFns ...func(*ec2.Options)) (*ec2.CreateSecurityGroupOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for CreateSecurityGroup") + } + + var r0 *ec2.CreateSecurityGroupOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.CreateSecurityGroupInput, ...func(*ec2.Options)) (*ec2.CreateSecurityGroupOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.CreateSecurityGroupInput, ...func(*ec2.Options)) *ec2.CreateSecurityGroupOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.CreateSecurityGroupOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.CreateSecurityGroupInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_CreateSecurityGroup_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateSecurityGroup' +type MockEC2Clienter_CreateSecurityGroup_Call struct { + *mock.Call +} + +// CreateSecurityGroup is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.CreateSecurityGroupInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) CreateSecurityGroup(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_CreateSecurityGroup_Call { + return &MockEC2Clienter_CreateSecurityGroup_Call{Call: _e.mock.On("CreateSecurityGroup", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_CreateSecurityGroup_Call) Run(run func(ctx context.Context, params *ec2.CreateSecurityGroupInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_CreateSecurityGroup_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.CreateSecurityGroupInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_CreateSecurityGroup_Call) Return(_a0 *ec2.CreateSecurityGroupOutput, _a1 error) *MockEC2Clienter_CreateSecurityGroup_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_CreateSecurityGroup_Call) RunAndReturn(run func(context.Context, *ec2.CreateSecurityGroupInput, ...func(*ec2.Options)) (*ec2.CreateSecurityGroupOutput, error)) *MockEC2Clienter_CreateSecurityGroup_Call { + _c.Call.Return(run) + return _c +} + +// CreateSubnet provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) CreateSubnet(ctx context.Context, params *ec2.CreateSubnetInput, optFns ...func(*ec2.Options)) (*ec2.CreateSubnetOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for CreateSubnet") + } + + var r0 *ec2.CreateSubnetOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.CreateSubnetInput, ...func(*ec2.Options)) (*ec2.CreateSubnetOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.CreateSubnetInput, ...func(*ec2.Options)) *ec2.CreateSubnetOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.CreateSubnetOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.CreateSubnetInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_CreateSubnet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateSubnet' +type MockEC2Clienter_CreateSubnet_Call struct { + *mock.Call +} + +// CreateSubnet is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.CreateSubnetInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) CreateSubnet(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_CreateSubnet_Call { + return &MockEC2Clienter_CreateSubnet_Call{Call: _e.mock.On("CreateSubnet", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_CreateSubnet_Call) Run(run func(ctx context.Context, params *ec2.CreateSubnetInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_CreateSubnet_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.CreateSubnetInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_CreateSubnet_Call) Return(_a0 *ec2.CreateSubnetOutput, _a1 error) *MockEC2Clienter_CreateSubnet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_CreateSubnet_Call) RunAndReturn(run func(context.Context, *ec2.CreateSubnetInput, ...func(*ec2.Options)) (*ec2.CreateSubnetOutput, error)) *MockEC2Clienter_CreateSubnet_Call { + _c.Call.Return(run) + return _c +} + +// CreateVpc provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) CreateVpc(ctx context.Context, params *ec2.CreateVpcInput, optFns ...func(*ec2.Options)) (*ec2.CreateVpcOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for CreateVpc") + } + + var r0 *ec2.CreateVpcOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.CreateVpcInput, ...func(*ec2.Options)) (*ec2.CreateVpcOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.CreateVpcInput, ...func(*ec2.Options)) *ec2.CreateVpcOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.CreateVpcOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.CreateVpcInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_CreateVpc_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateVpc' +type MockEC2Clienter_CreateVpc_Call struct { + *mock.Call +} + +// CreateVpc is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.CreateVpcInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) CreateVpc(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_CreateVpc_Call { + return &MockEC2Clienter_CreateVpc_Call{Call: _e.mock.On("CreateVpc", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_CreateVpc_Call) Run(run func(ctx context.Context, params *ec2.CreateVpcInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_CreateVpc_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.CreateVpcInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_CreateVpc_Call) Return(_a0 *ec2.CreateVpcOutput, _a1 error) *MockEC2Clienter_CreateVpc_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_CreateVpc_Call) RunAndReturn(run func(context.Context, *ec2.CreateVpcInput, ...func(*ec2.Options)) (*ec2.CreateVpcOutput, error)) *MockEC2Clienter_CreateVpc_Call { + _c.Call.Return(run) + return _c +} + +// DeleteInternetGateway provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) DeleteInternetGateway(ctx context.Context, params *ec2.DeleteInternetGatewayInput, optFns ...func(*ec2.Options)) (*ec2.DeleteInternetGatewayOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for DeleteInternetGateway") + } + + var r0 *ec2.DeleteInternetGatewayOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DeleteInternetGatewayInput, ...func(*ec2.Options)) (*ec2.DeleteInternetGatewayOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DeleteInternetGatewayInput, ...func(*ec2.Options)) *ec2.DeleteInternetGatewayOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.DeleteInternetGatewayOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.DeleteInternetGatewayInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_DeleteInternetGateway_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteInternetGateway' +type MockEC2Clienter_DeleteInternetGateway_Call struct { + *mock.Call +} + +// DeleteInternetGateway is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.DeleteInternetGatewayInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) DeleteInternetGateway(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_DeleteInternetGateway_Call { + return &MockEC2Clienter_DeleteInternetGateway_Call{Call: _e.mock.On("DeleteInternetGateway", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_DeleteInternetGateway_Call) Run(run func(ctx context.Context, params *ec2.DeleteInternetGatewayInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_DeleteInternetGateway_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.DeleteInternetGatewayInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_DeleteInternetGateway_Call) Return(_a0 *ec2.DeleteInternetGatewayOutput, _a1 error) *MockEC2Clienter_DeleteInternetGateway_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_DeleteInternetGateway_Call) RunAndReturn(run func(context.Context, *ec2.DeleteInternetGatewayInput, ...func(*ec2.Options)) (*ec2.DeleteInternetGatewayOutput, error)) *MockEC2Clienter_DeleteInternetGateway_Call { + _c.Call.Return(run) + return _c +} + +// DeleteRouteTable provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) DeleteRouteTable(ctx context.Context, params *ec2.DeleteRouteTableInput, optFns ...func(*ec2.Options)) (*ec2.DeleteRouteTableOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for DeleteRouteTable") + } + + var r0 *ec2.DeleteRouteTableOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DeleteRouteTableInput, ...func(*ec2.Options)) (*ec2.DeleteRouteTableOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DeleteRouteTableInput, ...func(*ec2.Options)) *ec2.DeleteRouteTableOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.DeleteRouteTableOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.DeleteRouteTableInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_DeleteRouteTable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteRouteTable' +type MockEC2Clienter_DeleteRouteTable_Call struct { + *mock.Call +} + +// DeleteRouteTable is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.DeleteRouteTableInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) DeleteRouteTable(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_DeleteRouteTable_Call { + return &MockEC2Clienter_DeleteRouteTable_Call{Call: _e.mock.On("DeleteRouteTable", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_DeleteRouteTable_Call) Run(run func(ctx context.Context, params *ec2.DeleteRouteTableInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_DeleteRouteTable_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.DeleteRouteTableInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_DeleteRouteTable_Call) Return(_a0 *ec2.DeleteRouteTableOutput, _a1 error) *MockEC2Clienter_DeleteRouteTable_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_DeleteRouteTable_Call) RunAndReturn(run func(context.Context, *ec2.DeleteRouteTableInput, ...func(*ec2.Options)) (*ec2.DeleteRouteTableOutput, error)) *MockEC2Clienter_DeleteRouteTable_Call { + _c.Call.Return(run) + return _c +} + +// DeleteSecurityGroup provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) DeleteSecurityGroup(ctx context.Context, params *ec2.DeleteSecurityGroupInput, optFns ...func(*ec2.Options)) (*ec2.DeleteSecurityGroupOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for DeleteSecurityGroup") + } + + var r0 *ec2.DeleteSecurityGroupOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DeleteSecurityGroupInput, ...func(*ec2.Options)) (*ec2.DeleteSecurityGroupOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DeleteSecurityGroupInput, ...func(*ec2.Options)) *ec2.DeleteSecurityGroupOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.DeleteSecurityGroupOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.DeleteSecurityGroupInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_DeleteSecurityGroup_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteSecurityGroup' +type MockEC2Clienter_DeleteSecurityGroup_Call struct { + *mock.Call +} + +// DeleteSecurityGroup is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.DeleteSecurityGroupInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) DeleteSecurityGroup(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_DeleteSecurityGroup_Call { + return &MockEC2Clienter_DeleteSecurityGroup_Call{Call: _e.mock.On("DeleteSecurityGroup", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_DeleteSecurityGroup_Call) Run(run func(ctx context.Context, params *ec2.DeleteSecurityGroupInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_DeleteSecurityGroup_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.DeleteSecurityGroupInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_DeleteSecurityGroup_Call) Return(_a0 *ec2.DeleteSecurityGroupOutput, _a1 error) *MockEC2Clienter_DeleteSecurityGroup_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_DeleteSecurityGroup_Call) RunAndReturn(run func(context.Context, *ec2.DeleteSecurityGroupInput, ...func(*ec2.Options)) (*ec2.DeleteSecurityGroupOutput, error)) *MockEC2Clienter_DeleteSecurityGroup_Call { + _c.Call.Return(run) + return _c +} + +// DeleteSubnet provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) DeleteSubnet(ctx context.Context, params *ec2.DeleteSubnetInput, optFns ...func(*ec2.Options)) (*ec2.DeleteSubnetOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for DeleteSubnet") + } + + var r0 *ec2.DeleteSubnetOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DeleteSubnetInput, ...func(*ec2.Options)) (*ec2.DeleteSubnetOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DeleteSubnetInput, ...func(*ec2.Options)) *ec2.DeleteSubnetOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.DeleteSubnetOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.DeleteSubnetInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_DeleteSubnet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteSubnet' +type MockEC2Clienter_DeleteSubnet_Call struct { + *mock.Call +} + +// DeleteSubnet is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.DeleteSubnetInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) DeleteSubnet(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_DeleteSubnet_Call { + return &MockEC2Clienter_DeleteSubnet_Call{Call: _e.mock.On("DeleteSubnet", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_DeleteSubnet_Call) Run(run func(ctx context.Context, params *ec2.DeleteSubnetInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_DeleteSubnet_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.DeleteSubnetInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_DeleteSubnet_Call) Return(_a0 *ec2.DeleteSubnetOutput, _a1 error) *MockEC2Clienter_DeleteSubnet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_DeleteSubnet_Call) RunAndReturn(run func(context.Context, *ec2.DeleteSubnetInput, ...func(*ec2.Options)) (*ec2.DeleteSubnetOutput, error)) *MockEC2Clienter_DeleteSubnet_Call { + _c.Call.Return(run) + return _c +} + +// DeleteVpc provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) DeleteVpc(ctx context.Context, params *ec2.DeleteVpcInput, optFns ...func(*ec2.Options)) (*ec2.DeleteVpcOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for DeleteVpc") + } + + var r0 *ec2.DeleteVpcOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DeleteVpcInput, ...func(*ec2.Options)) (*ec2.DeleteVpcOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DeleteVpcInput, ...func(*ec2.Options)) *ec2.DeleteVpcOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.DeleteVpcOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.DeleteVpcInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_DeleteVpc_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteVpc' +type MockEC2Clienter_DeleteVpc_Call struct { + *mock.Call +} + +// DeleteVpc is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.DeleteVpcInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) DeleteVpc(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_DeleteVpc_Call { + return &MockEC2Clienter_DeleteVpc_Call{Call: _e.mock.On("DeleteVpc", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_DeleteVpc_Call) Run(run func(ctx context.Context, params *ec2.DeleteVpcInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_DeleteVpc_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.DeleteVpcInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_DeleteVpc_Call) Return(_a0 *ec2.DeleteVpcOutput, _a1 error) *MockEC2Clienter_DeleteVpc_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_DeleteVpc_Call) RunAndReturn(run func(context.Context, *ec2.DeleteVpcInput, ...func(*ec2.Options)) (*ec2.DeleteVpcOutput, error)) *MockEC2Clienter_DeleteVpc_Call { + _c.Call.Return(run) + return _c +} + +// DescribeAvailabilityZones provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) DescribeAvailabilityZones(ctx context.Context, params *ec2.DescribeAvailabilityZonesInput, optFns ...func(*ec2.Options)) (*ec2.DescribeAvailabilityZonesOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for DescribeAvailabilityZones") + } + + var r0 *ec2.DescribeAvailabilityZonesOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeAvailabilityZonesInput, ...func(*ec2.Options)) (*ec2.DescribeAvailabilityZonesOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeAvailabilityZonesInput, ...func(*ec2.Options)) *ec2.DescribeAvailabilityZonesOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.DescribeAvailabilityZonesOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.DescribeAvailabilityZonesInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_DescribeAvailabilityZones_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DescribeAvailabilityZones' +type MockEC2Clienter_DescribeAvailabilityZones_Call struct { + *mock.Call +} + +// DescribeAvailabilityZones is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.DescribeAvailabilityZonesInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) DescribeAvailabilityZones(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_DescribeAvailabilityZones_Call { + return &MockEC2Clienter_DescribeAvailabilityZones_Call{Call: _e.mock.On("DescribeAvailabilityZones", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_DescribeAvailabilityZones_Call) Run(run func(ctx context.Context, params *ec2.DescribeAvailabilityZonesInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_DescribeAvailabilityZones_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.DescribeAvailabilityZonesInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_DescribeAvailabilityZones_Call) Return(_a0 *ec2.DescribeAvailabilityZonesOutput, _a1 error) *MockEC2Clienter_DescribeAvailabilityZones_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_DescribeAvailabilityZones_Call) RunAndReturn(run func(context.Context, *ec2.DescribeAvailabilityZonesInput, ...func(*ec2.Options)) (*ec2.DescribeAvailabilityZonesOutput, error)) *MockEC2Clienter_DescribeAvailabilityZones_Call { + _c.Call.Return(run) + return _c +} + +// DescribeImages provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) DescribeImages(ctx context.Context, params *ec2.DescribeImagesInput, optFns ...func(*ec2.Options)) (*ec2.DescribeImagesOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for DescribeImages") + } + + var r0 *ec2.DescribeImagesOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeImagesInput, ...func(*ec2.Options)) (*ec2.DescribeImagesOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeImagesInput, ...func(*ec2.Options)) *ec2.DescribeImagesOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.DescribeImagesOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.DescribeImagesInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_DescribeImages_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DescribeImages' +type MockEC2Clienter_DescribeImages_Call struct { + *mock.Call +} + +// DescribeImages is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.DescribeImagesInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) DescribeImages(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_DescribeImages_Call { + return &MockEC2Clienter_DescribeImages_Call{Call: _e.mock.On("DescribeImages", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_DescribeImages_Call) Run(run func(ctx context.Context, params *ec2.DescribeImagesInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_DescribeImages_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.DescribeImagesInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_DescribeImages_Call) Return(_a0 *ec2.DescribeImagesOutput, _a1 error) *MockEC2Clienter_DescribeImages_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_DescribeImages_Call) RunAndReturn(run func(context.Context, *ec2.DescribeImagesInput, ...func(*ec2.Options)) (*ec2.DescribeImagesOutput, error)) *MockEC2Clienter_DescribeImages_Call { + _c.Call.Return(run) + return _c +} + +// DescribeInstances provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) DescribeInstances(ctx context.Context, params *ec2.DescribeInstancesInput, optFns ...func(*ec2.Options)) (*ec2.DescribeInstancesOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for DescribeInstances") + } + + var r0 *ec2.DescribeInstancesOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeInstancesInput, ...func(*ec2.Options)) (*ec2.DescribeInstancesOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeInstancesInput, ...func(*ec2.Options)) *ec2.DescribeInstancesOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.DescribeInstancesOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.DescribeInstancesInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_DescribeInstances_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DescribeInstances' +type MockEC2Clienter_DescribeInstances_Call struct { + *mock.Call +} + +// DescribeInstances is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.DescribeInstancesInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) DescribeInstances(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_DescribeInstances_Call { + return &MockEC2Clienter_DescribeInstances_Call{Call: _e.mock.On("DescribeInstances", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_DescribeInstances_Call) Run(run func(ctx context.Context, params *ec2.DescribeInstancesInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_DescribeInstances_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.DescribeInstancesInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_DescribeInstances_Call) Return(_a0 *ec2.DescribeInstancesOutput, _a1 error) *MockEC2Clienter_DescribeInstances_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_DescribeInstances_Call) RunAndReturn(run func(context.Context, *ec2.DescribeInstancesInput, ...func(*ec2.Options)) (*ec2.DescribeInstancesOutput, error)) *MockEC2Clienter_DescribeInstances_Call { + _c.Call.Return(run) + return _c +} + +// DescribeInternetGateways provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) DescribeInternetGateways(ctx context.Context, params *ec2.DescribeInternetGatewaysInput, optFns ...func(*ec2.Options)) (*ec2.DescribeInternetGatewaysOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for DescribeInternetGateways") + } + + var r0 *ec2.DescribeInternetGatewaysOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeInternetGatewaysInput, ...func(*ec2.Options)) (*ec2.DescribeInternetGatewaysOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeInternetGatewaysInput, ...func(*ec2.Options)) *ec2.DescribeInternetGatewaysOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.DescribeInternetGatewaysOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.DescribeInternetGatewaysInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_DescribeInternetGateways_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DescribeInternetGateways' +type MockEC2Clienter_DescribeInternetGateways_Call struct { + *mock.Call +} + +// DescribeInternetGateways is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.DescribeInternetGatewaysInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) DescribeInternetGateways(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_DescribeInternetGateways_Call { + return &MockEC2Clienter_DescribeInternetGateways_Call{Call: _e.mock.On("DescribeInternetGateways", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_DescribeInternetGateways_Call) Run(run func(ctx context.Context, params *ec2.DescribeInternetGatewaysInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_DescribeInternetGateways_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.DescribeInternetGatewaysInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_DescribeInternetGateways_Call) Return(_a0 *ec2.DescribeInternetGatewaysOutput, _a1 error) *MockEC2Clienter_DescribeInternetGateways_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_DescribeInternetGateways_Call) RunAndReturn(run func(context.Context, *ec2.DescribeInternetGatewaysInput, ...func(*ec2.Options)) (*ec2.DescribeInternetGatewaysOutput, error)) *MockEC2Clienter_DescribeInternetGateways_Call { + _c.Call.Return(run) + return _c +} + +// DescribeRegions provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) DescribeRegions(ctx context.Context, params *ec2.DescribeRegionsInput, optFns ...func(*ec2.Options)) (*ec2.DescribeRegionsOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for DescribeRegions") + } + + var r0 *ec2.DescribeRegionsOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeRegionsInput, ...func(*ec2.Options)) (*ec2.DescribeRegionsOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeRegionsInput, ...func(*ec2.Options)) *ec2.DescribeRegionsOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.DescribeRegionsOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.DescribeRegionsInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_DescribeRegions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DescribeRegions' +type MockEC2Clienter_DescribeRegions_Call struct { + *mock.Call +} + +// DescribeRegions is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.DescribeRegionsInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) DescribeRegions(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_DescribeRegions_Call { + return &MockEC2Clienter_DescribeRegions_Call{Call: _e.mock.On("DescribeRegions", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_DescribeRegions_Call) Run(run func(ctx context.Context, params *ec2.DescribeRegionsInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_DescribeRegions_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.DescribeRegionsInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_DescribeRegions_Call) Return(_a0 *ec2.DescribeRegionsOutput, _a1 error) *MockEC2Clienter_DescribeRegions_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_DescribeRegions_Call) RunAndReturn(run func(context.Context, *ec2.DescribeRegionsInput, ...func(*ec2.Options)) (*ec2.DescribeRegionsOutput, error)) *MockEC2Clienter_DescribeRegions_Call { + _c.Call.Return(run) + return _c +} + +// DescribeRouteTables provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) DescribeRouteTables(ctx context.Context, params *ec2.DescribeRouteTablesInput, optFns ...func(*ec2.Options)) (*ec2.DescribeRouteTablesOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for DescribeRouteTables") + } + + var r0 *ec2.DescribeRouteTablesOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeRouteTablesInput, ...func(*ec2.Options)) (*ec2.DescribeRouteTablesOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeRouteTablesInput, ...func(*ec2.Options)) *ec2.DescribeRouteTablesOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.DescribeRouteTablesOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.DescribeRouteTablesInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_DescribeRouteTables_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DescribeRouteTables' +type MockEC2Clienter_DescribeRouteTables_Call struct { + *mock.Call +} + +// DescribeRouteTables is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.DescribeRouteTablesInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) DescribeRouteTables(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_DescribeRouteTables_Call { + return &MockEC2Clienter_DescribeRouteTables_Call{Call: _e.mock.On("DescribeRouteTables", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_DescribeRouteTables_Call) Run(run func(ctx context.Context, params *ec2.DescribeRouteTablesInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_DescribeRouteTables_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.DescribeRouteTablesInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_DescribeRouteTables_Call) Return(_a0 *ec2.DescribeRouteTablesOutput, _a1 error) *MockEC2Clienter_DescribeRouteTables_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_DescribeRouteTables_Call) RunAndReturn(run func(context.Context, *ec2.DescribeRouteTablesInput, ...func(*ec2.Options)) (*ec2.DescribeRouteTablesOutput, error)) *MockEC2Clienter_DescribeRouteTables_Call { + _c.Call.Return(run) + return _c +} + +// DescribeSecurityGroups provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) DescribeSecurityGroups(ctx context.Context, params *ec2.DescribeSecurityGroupsInput, optFns ...func(*ec2.Options)) (*ec2.DescribeSecurityGroupsOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for DescribeSecurityGroups") + } + + var r0 *ec2.DescribeSecurityGroupsOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeSecurityGroupsInput, ...func(*ec2.Options)) (*ec2.DescribeSecurityGroupsOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeSecurityGroupsInput, ...func(*ec2.Options)) *ec2.DescribeSecurityGroupsOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.DescribeSecurityGroupsOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.DescribeSecurityGroupsInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_DescribeSecurityGroups_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DescribeSecurityGroups' +type MockEC2Clienter_DescribeSecurityGroups_Call struct { + *mock.Call +} + +// DescribeSecurityGroups is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.DescribeSecurityGroupsInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) DescribeSecurityGroups(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_DescribeSecurityGroups_Call { + return &MockEC2Clienter_DescribeSecurityGroups_Call{Call: _e.mock.On("DescribeSecurityGroups", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_DescribeSecurityGroups_Call) Run(run func(ctx context.Context, params *ec2.DescribeSecurityGroupsInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_DescribeSecurityGroups_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.DescribeSecurityGroupsInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_DescribeSecurityGroups_Call) Return(_a0 *ec2.DescribeSecurityGroupsOutput, _a1 error) *MockEC2Clienter_DescribeSecurityGroups_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_DescribeSecurityGroups_Call) RunAndReturn(run func(context.Context, *ec2.DescribeSecurityGroupsInput, ...func(*ec2.Options)) (*ec2.DescribeSecurityGroupsOutput, error)) *MockEC2Clienter_DescribeSecurityGroups_Call { + _c.Call.Return(run) + return _c +} + +// DescribeSubnets provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) DescribeSubnets(ctx context.Context, params *ec2.DescribeSubnetsInput, optFns ...func(*ec2.Options)) (*ec2.DescribeSubnetsOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for DescribeSubnets") + } + + var r0 *ec2.DescribeSubnetsOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeSubnetsInput, ...func(*ec2.Options)) (*ec2.DescribeSubnetsOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeSubnetsInput, ...func(*ec2.Options)) *ec2.DescribeSubnetsOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.DescribeSubnetsOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.DescribeSubnetsInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_DescribeSubnets_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DescribeSubnets' +type MockEC2Clienter_DescribeSubnets_Call struct { + *mock.Call +} + +// DescribeSubnets is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.DescribeSubnetsInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) DescribeSubnets(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_DescribeSubnets_Call { + return &MockEC2Clienter_DescribeSubnets_Call{Call: _e.mock.On("DescribeSubnets", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_DescribeSubnets_Call) Run(run func(ctx context.Context, params *ec2.DescribeSubnetsInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_DescribeSubnets_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.DescribeSubnetsInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_DescribeSubnets_Call) Return(_a0 *ec2.DescribeSubnetsOutput, _a1 error) *MockEC2Clienter_DescribeSubnets_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_DescribeSubnets_Call) RunAndReturn(run func(context.Context, *ec2.DescribeSubnetsInput, ...func(*ec2.Options)) (*ec2.DescribeSubnetsOutput, error)) *MockEC2Clienter_DescribeSubnets_Call { + _c.Call.Return(run) + return _c +} + +// DescribeVpcs provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) DescribeVpcs(ctx context.Context, params *ec2.DescribeVpcsInput, optFns ...func(*ec2.Options)) (*ec2.DescribeVpcsOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for DescribeVpcs") + } + + var r0 *ec2.DescribeVpcsOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeVpcsInput, ...func(*ec2.Options)) (*ec2.DescribeVpcsOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeVpcsInput, ...func(*ec2.Options)) *ec2.DescribeVpcsOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.DescribeVpcsOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.DescribeVpcsInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_DescribeVpcs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DescribeVpcs' +type MockEC2Clienter_DescribeVpcs_Call struct { + *mock.Call +} + +// DescribeVpcs is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.DescribeVpcsInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) DescribeVpcs(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_DescribeVpcs_Call { + return &MockEC2Clienter_DescribeVpcs_Call{Call: _e.mock.On("DescribeVpcs", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_DescribeVpcs_Call) Run(run func(ctx context.Context, params *ec2.DescribeVpcsInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_DescribeVpcs_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.DescribeVpcsInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_DescribeVpcs_Call) Return(_a0 *ec2.DescribeVpcsOutput, _a1 error) *MockEC2Clienter_DescribeVpcs_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_DescribeVpcs_Call) RunAndReturn(run func(context.Context, *ec2.DescribeVpcsInput, ...func(*ec2.Options)) (*ec2.DescribeVpcsOutput, error)) *MockEC2Clienter_DescribeVpcs_Call { + _c.Call.Return(run) + return _c +} + +// DetachInternetGateway provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) DetachInternetGateway(ctx context.Context, params *ec2.DetachInternetGatewayInput, optFns ...func(*ec2.Options)) (*ec2.DetachInternetGatewayOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for DetachInternetGateway") + } + + var r0 *ec2.DetachInternetGatewayOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DetachInternetGatewayInput, ...func(*ec2.Options)) (*ec2.DetachInternetGatewayOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DetachInternetGatewayInput, ...func(*ec2.Options)) *ec2.DetachInternetGatewayOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.DetachInternetGatewayOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.DetachInternetGatewayInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_DetachInternetGateway_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DetachInternetGateway' +type MockEC2Clienter_DetachInternetGateway_Call struct { + *mock.Call +} + +// DetachInternetGateway is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.DetachInternetGatewayInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) DetachInternetGateway(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_DetachInternetGateway_Call { + return &MockEC2Clienter_DetachInternetGateway_Call{Call: _e.mock.On("DetachInternetGateway", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_DetachInternetGateway_Call) Run(run func(ctx context.Context, params *ec2.DetachInternetGatewayInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_DetachInternetGateway_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.DetachInternetGatewayInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_DetachInternetGateway_Call) Return(_a0 *ec2.DetachInternetGatewayOutput, _a1 error) *MockEC2Clienter_DetachInternetGateway_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_DetachInternetGateway_Call) RunAndReturn(run func(context.Context, *ec2.DetachInternetGatewayInput, ...func(*ec2.Options)) (*ec2.DetachInternetGatewayOutput, error)) *MockEC2Clienter_DetachInternetGateway_Call { + _c.Call.Return(run) + return _c +} + +// DisassociateRouteTable provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) DisassociateRouteTable(ctx context.Context, params *ec2.DisassociateRouteTableInput, optFns ...func(*ec2.Options)) (*ec2.DisassociateRouteTableOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for DisassociateRouteTable") + } + + var r0 *ec2.DisassociateRouteTableOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DisassociateRouteTableInput, ...func(*ec2.Options)) (*ec2.DisassociateRouteTableOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DisassociateRouteTableInput, ...func(*ec2.Options)) *ec2.DisassociateRouteTableOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.DisassociateRouteTableOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.DisassociateRouteTableInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_DisassociateRouteTable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DisassociateRouteTable' +type MockEC2Clienter_DisassociateRouteTable_Call struct { + *mock.Call +} + +// DisassociateRouteTable is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.DisassociateRouteTableInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) DisassociateRouteTable(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_DisassociateRouteTable_Call { + return &MockEC2Clienter_DisassociateRouteTable_Call{Call: _e.mock.On("DisassociateRouteTable", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_DisassociateRouteTable_Call) Run(run func(ctx context.Context, params *ec2.DisassociateRouteTableInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_DisassociateRouteTable_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.DisassociateRouteTableInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_DisassociateRouteTable_Call) Return(_a0 *ec2.DisassociateRouteTableOutput, _a1 error) *MockEC2Clienter_DisassociateRouteTable_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_DisassociateRouteTable_Call) RunAndReturn(run func(context.Context, *ec2.DisassociateRouteTableInput, ...func(*ec2.Options)) (*ec2.DisassociateRouteTableOutput, error)) *MockEC2Clienter_DisassociateRouteTable_Call { + _c.Call.Return(run) + return _c +} + +// ModifyVpcAttribute provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) ModifyVpcAttribute(ctx context.Context, params *ec2.ModifyVpcAttributeInput, optFns ...func(*ec2.Options)) (*ec2.ModifyVpcAttributeOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for ModifyVpcAttribute") + } + + var r0 *ec2.ModifyVpcAttributeOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.ModifyVpcAttributeInput, ...func(*ec2.Options)) (*ec2.ModifyVpcAttributeOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.ModifyVpcAttributeInput, ...func(*ec2.Options)) *ec2.ModifyVpcAttributeOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.ModifyVpcAttributeOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.ModifyVpcAttributeInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_ModifyVpcAttribute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ModifyVpcAttribute' +type MockEC2Clienter_ModifyVpcAttribute_Call struct { + *mock.Call +} + +// ModifyVpcAttribute is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.ModifyVpcAttributeInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) ModifyVpcAttribute(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_ModifyVpcAttribute_Call { + return &MockEC2Clienter_ModifyVpcAttribute_Call{Call: _e.mock.On("ModifyVpcAttribute", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_ModifyVpcAttribute_Call) Run(run func(ctx context.Context, params *ec2.ModifyVpcAttributeInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_ModifyVpcAttribute_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.ModifyVpcAttributeInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_ModifyVpcAttribute_Call) Return(_a0 *ec2.ModifyVpcAttributeOutput, _a1 error) *MockEC2Clienter_ModifyVpcAttribute_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_ModifyVpcAttribute_Call) RunAndReturn(run func(context.Context, *ec2.ModifyVpcAttributeInput, ...func(*ec2.Options)) (*ec2.ModifyVpcAttributeOutput, error)) *MockEC2Clienter_ModifyVpcAttribute_Call { + _c.Call.Return(run) + return _c +} + +// RunInstances provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) RunInstances(ctx context.Context, params *ec2.RunInstancesInput, optFns ...func(*ec2.Options)) (*ec2.RunInstancesOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for RunInstances") + } + + var r0 *ec2.RunInstancesOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.RunInstancesInput, ...func(*ec2.Options)) (*ec2.RunInstancesOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.RunInstancesInput, ...func(*ec2.Options)) *ec2.RunInstancesOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.RunInstancesOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.RunInstancesInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_RunInstances_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RunInstances' +type MockEC2Clienter_RunInstances_Call struct { + *mock.Call +} + +// RunInstances is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.RunInstancesInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) RunInstances(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_RunInstances_Call { + return &MockEC2Clienter_RunInstances_Call{Call: _e.mock.On("RunInstances", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_RunInstances_Call) Run(run func(ctx context.Context, params *ec2.RunInstancesInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_RunInstances_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.RunInstancesInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_RunInstances_Call) Return(_a0 *ec2.RunInstancesOutput, _a1 error) *MockEC2Clienter_RunInstances_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_RunInstances_Call) RunAndReturn(run func(context.Context, *ec2.RunInstancesInput, ...func(*ec2.Options)) (*ec2.RunInstancesOutput, error)) *MockEC2Clienter_RunInstances_Call { + _c.Call.Return(run) + return _c +} + +// TerminateInstances provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) TerminateInstances(ctx context.Context, params *ec2.TerminateInstancesInput, optFns ...func(*ec2.Options)) (*ec2.TerminateInstancesOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for TerminateInstances") + } + + var r0 *ec2.TerminateInstancesOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.TerminateInstancesInput, ...func(*ec2.Options)) (*ec2.TerminateInstancesOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.TerminateInstancesInput, ...func(*ec2.Options)) *ec2.TerminateInstancesOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.TerminateInstancesOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.TerminateInstancesInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_TerminateInstances_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TerminateInstances' +type MockEC2Clienter_TerminateInstances_Call struct { + *mock.Call +} + +// TerminateInstances is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.TerminateInstancesInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) TerminateInstances(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_TerminateInstances_Call { + return &MockEC2Clienter_TerminateInstances_Call{Call: _e.mock.On("TerminateInstances", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_TerminateInstances_Call) Run(run func(ctx context.Context, params *ec2.TerminateInstancesInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_TerminateInstances_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.TerminateInstancesInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_TerminateInstances_Call) Return(_a0 *ec2.TerminateInstancesOutput, _a1 error) *MockEC2Clienter_TerminateInstances_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_TerminateInstances_Call) RunAndReturn(run func(context.Context, *ec2.TerminateInstancesInput, ...func(*ec2.Options)) (*ec2.TerminateInstancesOutput, error)) *MockEC2Clienter_TerminateInstances_Call { + _c.Call.Return(run) + return _c +} + +// NewMockEC2Clienter creates a new instance of MockEC2Clienter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockEC2Clienter(t interface { + mock.TestingT + Cleanup(func()) +}) *MockEC2Clienter { + mock := &MockEC2Clienter{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/pkg/models/interfaces/aws/mocks/azure/mock_AzureClienter.go b/pkg/models/interfaces/aws/mocks/azure/mock_AzureClienter.go new file mode 100644 index 00000000..41afb75b --- /dev/null +++ b/pkg/models/interfaces/aws/mocks/azure/mock_AzureClienter.go @@ -0,0 +1,856 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package azure_interface + +import ( + armcompute "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute" + armnetwork "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork" + + armresources "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources" + + armsubscription "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/subscription/armsubscription" + + azure_interface "github.com/bacalhau-project/andaime/pkg/models/interfaces/azure" + + context "context" + + mock "github.com/stretchr/testify/mock" + + runtime "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" +) + +// MockAzureClienter is an autogenerated mock type for the AzureClienter type +type MockAzureClienter struct { + mock.Mock +} + +type MockAzureClienter_Expecter struct { + mock *mock.Mock +} + +func (_m *MockAzureClienter) EXPECT() *MockAzureClienter_Expecter { + return &MockAzureClienter_Expecter{mock: &_m.Mock} +} + +// DeployTemplate provides a mock function with given fields: ctx, resourceGroupName, deploymentName, template, params, tags +func (_m *MockAzureClienter) DeployTemplate(ctx context.Context, resourceGroupName string, deploymentName string, template map[string]interface{}, params map[string]interface{}, tags map[string]*string) (azure_interface.Pollerer, error) { + ret := _m.Called(ctx, resourceGroupName, deploymentName, template, params, tags) + + if len(ret) == 0 { + panic("no return value specified for DeployTemplate") + } + + var r0 azure_interface.Pollerer + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, map[string]interface{}, map[string]interface{}, map[string]*string) (azure_interface.Pollerer, error)); ok { + return rf(ctx, resourceGroupName, deploymentName, template, params, tags) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string, map[string]interface{}, map[string]interface{}, map[string]*string) azure_interface.Pollerer); ok { + r0 = rf(ctx, resourceGroupName, deploymentName, template, params, tags) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(azure_interface.Pollerer) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string, map[string]interface{}, map[string]interface{}, map[string]*string) error); ok { + r1 = rf(ctx, resourceGroupName, deploymentName, template, params, tags) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockAzureClienter_DeployTemplate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeployTemplate' +type MockAzureClienter_DeployTemplate_Call struct { + *mock.Call +} + +// DeployTemplate is a helper method to define mock.On call +// - ctx context.Context +// - resourceGroupName string +// - deploymentName string +// - template map[string]interface{} +// - params map[string]interface{} +// - tags map[string]*string +func (_e *MockAzureClienter_Expecter) DeployTemplate(ctx interface{}, resourceGroupName interface{}, deploymentName interface{}, template interface{}, params interface{}, tags interface{}) *MockAzureClienter_DeployTemplate_Call { + return &MockAzureClienter_DeployTemplate_Call{Call: _e.mock.On("DeployTemplate", ctx, resourceGroupName, deploymentName, template, params, tags)} +} + +func (_c *MockAzureClienter_DeployTemplate_Call) Run(run func(ctx context.Context, resourceGroupName string, deploymentName string, template map[string]interface{}, params map[string]interface{}, tags map[string]*string)) *MockAzureClienter_DeployTemplate_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(map[string]interface{}), args[4].(map[string]interface{}), args[5].(map[string]*string)) + }) + return _c +} + +func (_c *MockAzureClienter_DeployTemplate_Call) Return(_a0 azure_interface.Pollerer, _a1 error) *MockAzureClienter_DeployTemplate_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockAzureClienter_DeployTemplate_Call) RunAndReturn(run func(context.Context, string, string, map[string]interface{}, map[string]interface{}, map[string]*string) (azure_interface.Pollerer, error)) *MockAzureClienter_DeployTemplate_Call { + _c.Call.Return(run) + return _c +} + +// DestroyResourceGroup provides a mock function with given fields: ctx, resourceGroupName +func (_m *MockAzureClienter) DestroyResourceGroup(ctx context.Context, resourceGroupName string) error { + ret := _m.Called(ctx, resourceGroupName) + + if len(ret) == 0 { + panic("no return value specified for DestroyResourceGroup") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = rf(ctx, resourceGroupName) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockAzureClienter_DestroyResourceGroup_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DestroyResourceGroup' +type MockAzureClienter_DestroyResourceGroup_Call struct { + *mock.Call +} + +// DestroyResourceGroup is a helper method to define mock.On call +// - ctx context.Context +// - resourceGroupName string +func (_e *MockAzureClienter_Expecter) DestroyResourceGroup(ctx interface{}, resourceGroupName interface{}) *MockAzureClienter_DestroyResourceGroup_Call { + return &MockAzureClienter_DestroyResourceGroup_Call{Call: _e.mock.On("DestroyResourceGroup", ctx, resourceGroupName)} +} + +func (_c *MockAzureClienter_DestroyResourceGroup_Call) Run(run func(ctx context.Context, resourceGroupName string)) *MockAzureClienter_DestroyResourceGroup_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockAzureClienter_DestroyResourceGroup_Call) Return(_a0 error) *MockAzureClienter_DestroyResourceGroup_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockAzureClienter_DestroyResourceGroup_Call) RunAndReturn(run func(context.Context, string) error) *MockAzureClienter_DestroyResourceGroup_Call { + _c.Call.Return(run) + return _c +} + +// GetNetworkInterface provides a mock function with given fields: ctx, resourceGroupName, networkInterfaceName +func (_m *MockAzureClienter) GetNetworkInterface(ctx context.Context, resourceGroupName string, networkInterfaceName string) (*armnetwork.Interface, error) { + ret := _m.Called(ctx, resourceGroupName, networkInterfaceName) + + if len(ret) == 0 { + panic("no return value specified for GetNetworkInterface") + } + + var r0 *armnetwork.Interface + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) (*armnetwork.Interface, error)); ok { + return rf(ctx, resourceGroupName, networkInterfaceName) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string) *armnetwork.Interface); ok { + r0 = rf(ctx, resourceGroupName, networkInterfaceName) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*armnetwork.Interface) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { + r1 = rf(ctx, resourceGroupName, networkInterfaceName) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockAzureClienter_GetNetworkInterface_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetNetworkInterface' +type MockAzureClienter_GetNetworkInterface_Call struct { + *mock.Call +} + +// GetNetworkInterface is a helper method to define mock.On call +// - ctx context.Context +// - resourceGroupName string +// - networkInterfaceName string +func (_e *MockAzureClienter_Expecter) GetNetworkInterface(ctx interface{}, resourceGroupName interface{}, networkInterfaceName interface{}) *MockAzureClienter_GetNetworkInterface_Call { + return &MockAzureClienter_GetNetworkInterface_Call{Call: _e.mock.On("GetNetworkInterface", ctx, resourceGroupName, networkInterfaceName)} +} + +func (_c *MockAzureClienter_GetNetworkInterface_Call) Run(run func(ctx context.Context, resourceGroupName string, networkInterfaceName string)) *MockAzureClienter_GetNetworkInterface_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *MockAzureClienter_GetNetworkInterface_Call) Return(_a0 *armnetwork.Interface, _a1 error) *MockAzureClienter_GetNetworkInterface_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockAzureClienter_GetNetworkInterface_Call) RunAndReturn(run func(context.Context, string, string) (*armnetwork.Interface, error)) *MockAzureClienter_GetNetworkInterface_Call { + _c.Call.Return(run) + return _c +} + +// GetOrCreateResourceGroup provides a mock function with given fields: ctx, resourceGroupName, location, tags +func (_m *MockAzureClienter) GetOrCreateResourceGroup(ctx context.Context, resourceGroupName string, location string, tags map[string]string) (*armresources.ResourceGroup, error) { + ret := _m.Called(ctx, resourceGroupName, location, tags) + + if len(ret) == 0 { + panic("no return value specified for GetOrCreateResourceGroup") + } + + var r0 *armresources.ResourceGroup + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, map[string]string) (*armresources.ResourceGroup, error)); ok { + return rf(ctx, resourceGroupName, location, tags) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string, map[string]string) *armresources.ResourceGroup); ok { + r0 = rf(ctx, resourceGroupName, location, tags) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*armresources.ResourceGroup) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string, map[string]string) error); ok { + r1 = rf(ctx, resourceGroupName, location, tags) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockAzureClienter_GetOrCreateResourceGroup_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetOrCreateResourceGroup' +type MockAzureClienter_GetOrCreateResourceGroup_Call struct { + *mock.Call +} + +// GetOrCreateResourceGroup is a helper method to define mock.On call +// - ctx context.Context +// - resourceGroupName string +// - location string +// - tags map[string]string +func (_e *MockAzureClienter_Expecter) GetOrCreateResourceGroup(ctx interface{}, resourceGroupName interface{}, location interface{}, tags interface{}) *MockAzureClienter_GetOrCreateResourceGroup_Call { + return &MockAzureClienter_GetOrCreateResourceGroup_Call{Call: _e.mock.On("GetOrCreateResourceGroup", ctx, resourceGroupName, location, tags)} +} + +func (_c *MockAzureClienter_GetOrCreateResourceGroup_Call) Run(run func(ctx context.Context, resourceGroupName string, location string, tags map[string]string)) *MockAzureClienter_GetOrCreateResourceGroup_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(map[string]string)) + }) + return _c +} + +func (_c *MockAzureClienter_GetOrCreateResourceGroup_Call) Return(_a0 *armresources.ResourceGroup, _a1 error) *MockAzureClienter_GetOrCreateResourceGroup_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockAzureClienter_GetOrCreateResourceGroup_Call) RunAndReturn(run func(context.Context, string, string, map[string]string) (*armresources.ResourceGroup, error)) *MockAzureClienter_GetOrCreateResourceGroup_Call { + _c.Call.Return(run) + return _c +} + +// GetPublicIPAddress provides a mock function with given fields: ctx, resourceGroupName, publicIPAddress +func (_m *MockAzureClienter) GetPublicIPAddress(ctx context.Context, resourceGroupName string, publicIPAddress *armnetwork.PublicIPAddress) (string, error) { + ret := _m.Called(ctx, resourceGroupName, publicIPAddress) + + if len(ret) == 0 { + panic("no return value specified for GetPublicIPAddress") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, *armnetwork.PublicIPAddress) (string, error)); ok { + return rf(ctx, resourceGroupName, publicIPAddress) + } + if rf, ok := ret.Get(0).(func(context.Context, string, *armnetwork.PublicIPAddress) string); ok { + r0 = rf(ctx, resourceGroupName, publicIPAddress) + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func(context.Context, string, *armnetwork.PublicIPAddress) error); ok { + r1 = rf(ctx, resourceGroupName, publicIPAddress) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockAzureClienter_GetPublicIPAddress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPublicIPAddress' +type MockAzureClienter_GetPublicIPAddress_Call struct { + *mock.Call +} + +// GetPublicIPAddress is a helper method to define mock.On call +// - ctx context.Context +// - resourceGroupName string +// - publicIPAddress *armnetwork.PublicIPAddress +func (_e *MockAzureClienter_Expecter) GetPublicIPAddress(ctx interface{}, resourceGroupName interface{}, publicIPAddress interface{}) *MockAzureClienter_GetPublicIPAddress_Call { + return &MockAzureClienter_GetPublicIPAddress_Call{Call: _e.mock.On("GetPublicIPAddress", ctx, resourceGroupName, publicIPAddress)} +} + +func (_c *MockAzureClienter_GetPublicIPAddress_Call) Run(run func(ctx context.Context, resourceGroupName string, publicIPAddress *armnetwork.PublicIPAddress)) *MockAzureClienter_GetPublicIPAddress_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(*armnetwork.PublicIPAddress)) + }) + return _c +} + +func (_c *MockAzureClienter_GetPublicIPAddress_Call) Return(_a0 string, _a1 error) *MockAzureClienter_GetPublicIPAddress_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockAzureClienter_GetPublicIPAddress_Call) RunAndReturn(run func(context.Context, string, *armnetwork.PublicIPAddress) (string, error)) *MockAzureClienter_GetPublicIPAddress_Call { + _c.Call.Return(run) + return _c +} + +// GetResources provides a mock function with given fields: ctx, subscriptionID, resourceGroupName, tags +func (_m *MockAzureClienter) GetResources(ctx context.Context, subscriptionID string, resourceGroupName string, tags map[string]*string) ([]interface{}, error) { + ret := _m.Called(ctx, subscriptionID, resourceGroupName, tags) + + if len(ret) == 0 { + panic("no return value specified for GetResources") + } + + var r0 []interface{} + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, map[string]*string) ([]interface{}, error)); ok { + return rf(ctx, subscriptionID, resourceGroupName, tags) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string, map[string]*string) []interface{}); ok { + r0 = rf(ctx, subscriptionID, resourceGroupName, tags) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]interface{}) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string, map[string]*string) error); ok { + r1 = rf(ctx, subscriptionID, resourceGroupName, tags) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockAzureClienter_GetResources_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetResources' +type MockAzureClienter_GetResources_Call struct { + *mock.Call +} + +// GetResources is a helper method to define mock.On call +// - ctx context.Context +// - subscriptionID string +// - resourceGroupName string +// - tags map[string]*string +func (_e *MockAzureClienter_Expecter) GetResources(ctx interface{}, subscriptionID interface{}, resourceGroupName interface{}, tags interface{}) *MockAzureClienter_GetResources_Call { + return &MockAzureClienter_GetResources_Call{Call: _e.mock.On("GetResources", ctx, subscriptionID, resourceGroupName, tags)} +} + +func (_c *MockAzureClienter_GetResources_Call) Run(run func(ctx context.Context, subscriptionID string, resourceGroupName string, tags map[string]*string)) *MockAzureClienter_GetResources_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(map[string]*string)) + }) + return _c +} + +func (_c *MockAzureClienter_GetResources_Call) Return(_a0 []interface{}, _a1 error) *MockAzureClienter_GetResources_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockAzureClienter_GetResources_Call) RunAndReturn(run func(context.Context, string, string, map[string]*string) ([]interface{}, error)) *MockAzureClienter_GetResources_Call { + _c.Call.Return(run) + return _c +} + +// GetSKUsByLocation provides a mock function with given fields: ctx, location +func (_m *MockAzureClienter) GetSKUsByLocation(ctx context.Context, location string) ([]armcompute.ResourceSKU, error) { + ret := _m.Called(ctx, location) + + if len(ret) == 0 { + panic("no return value specified for GetSKUsByLocation") + } + + var r0 []armcompute.ResourceSKU + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) ([]armcompute.ResourceSKU, error)); ok { + return rf(ctx, location) + } + if rf, ok := ret.Get(0).(func(context.Context, string) []armcompute.ResourceSKU); ok { + r0 = rf(ctx, location) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]armcompute.ResourceSKU) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, location) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockAzureClienter_GetSKUsByLocation_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSKUsByLocation' +type MockAzureClienter_GetSKUsByLocation_Call struct { + *mock.Call +} + +// GetSKUsByLocation is a helper method to define mock.On call +// - ctx context.Context +// - location string +func (_e *MockAzureClienter_Expecter) GetSKUsByLocation(ctx interface{}, location interface{}) *MockAzureClienter_GetSKUsByLocation_Call { + return &MockAzureClienter_GetSKUsByLocation_Call{Call: _e.mock.On("GetSKUsByLocation", ctx, location)} +} + +func (_c *MockAzureClienter_GetSKUsByLocation_Call) Run(run func(ctx context.Context, location string)) *MockAzureClienter_GetSKUsByLocation_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockAzureClienter_GetSKUsByLocation_Call) Return(_a0 []armcompute.ResourceSKU, _a1 error) *MockAzureClienter_GetSKUsByLocation_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockAzureClienter_GetSKUsByLocation_Call) RunAndReturn(run func(context.Context, string) ([]armcompute.ResourceSKU, error)) *MockAzureClienter_GetSKUsByLocation_Call { + _c.Call.Return(run) + return _c +} + +// GetVMExternalIP provides a mock function with given fields: ctx, vmName, locationData +func (_m *MockAzureClienter) GetVMExternalIP(ctx context.Context, vmName string, locationData map[string]string) (string, error) { + ret := _m.Called(ctx, vmName, locationData) + + if len(ret) == 0 { + panic("no return value specified for GetVMExternalIP") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, map[string]string) (string, error)); ok { + return rf(ctx, vmName, locationData) + } + if rf, ok := ret.Get(0).(func(context.Context, string, map[string]string) string); ok { + r0 = rf(ctx, vmName, locationData) + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func(context.Context, string, map[string]string) error); ok { + r1 = rf(ctx, vmName, locationData) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockAzureClienter_GetVMExternalIP_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetVMExternalIP' +type MockAzureClienter_GetVMExternalIP_Call struct { + *mock.Call +} + +// GetVMExternalIP is a helper method to define mock.On call +// - ctx context.Context +// - vmName string +// - locationData map[string]string +func (_e *MockAzureClienter_Expecter) GetVMExternalIP(ctx interface{}, vmName interface{}, locationData interface{}) *MockAzureClienter_GetVMExternalIP_Call { + return &MockAzureClienter_GetVMExternalIP_Call{Call: _e.mock.On("GetVMExternalIP", ctx, vmName, locationData)} +} + +func (_c *MockAzureClienter_GetVMExternalIP_Call) Run(run func(ctx context.Context, vmName string, locationData map[string]string)) *MockAzureClienter_GetVMExternalIP_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(map[string]string)) + }) + return _c +} + +func (_c *MockAzureClienter_GetVMExternalIP_Call) Return(_a0 string, _a1 error) *MockAzureClienter_GetVMExternalIP_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockAzureClienter_GetVMExternalIP_Call) RunAndReturn(run func(context.Context, string, map[string]string) (string, error)) *MockAzureClienter_GetVMExternalIP_Call { + _c.Call.Return(run) + return _c +} + +// GetVirtualMachine provides a mock function with given fields: ctx, resourceGroupName, vmName +func (_m *MockAzureClienter) GetVirtualMachine(ctx context.Context, resourceGroupName string, vmName string) (*armcompute.VirtualMachine, error) { + ret := _m.Called(ctx, resourceGroupName, vmName) + + if len(ret) == 0 { + panic("no return value specified for GetVirtualMachine") + } + + var r0 *armcompute.VirtualMachine + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) (*armcompute.VirtualMachine, error)); ok { + return rf(ctx, resourceGroupName, vmName) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string) *armcompute.VirtualMachine); ok { + r0 = rf(ctx, resourceGroupName, vmName) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*armcompute.VirtualMachine) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { + r1 = rf(ctx, resourceGroupName, vmName) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockAzureClienter_GetVirtualMachine_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetVirtualMachine' +type MockAzureClienter_GetVirtualMachine_Call struct { + *mock.Call +} + +// GetVirtualMachine is a helper method to define mock.On call +// - ctx context.Context +// - resourceGroupName string +// - vmName string +func (_e *MockAzureClienter_Expecter) GetVirtualMachine(ctx interface{}, resourceGroupName interface{}, vmName interface{}) *MockAzureClienter_GetVirtualMachine_Call { + return &MockAzureClienter_GetVirtualMachine_Call{Call: _e.mock.On("GetVirtualMachine", ctx, resourceGroupName, vmName)} +} + +func (_c *MockAzureClienter_GetVirtualMachine_Call) Run(run func(ctx context.Context, resourceGroupName string, vmName string)) *MockAzureClienter_GetVirtualMachine_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *MockAzureClienter_GetVirtualMachine_Call) Return(_a0 *armcompute.VirtualMachine, _a1 error) *MockAzureClienter_GetVirtualMachine_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockAzureClienter_GetVirtualMachine_Call) RunAndReturn(run func(context.Context, string, string) (*armcompute.VirtualMachine, error)) *MockAzureClienter_GetVirtualMachine_Call { + _c.Call.Return(run) + return _c +} + +// ListAllResourceGroups provides a mock function with given fields: ctx +func (_m *MockAzureClienter) ListAllResourceGroups(ctx context.Context) ([]*armresources.ResourceGroup, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for ListAllResourceGroups") + } + + var r0 []*armresources.ResourceGroup + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) ([]*armresources.ResourceGroup, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) []*armresources.ResourceGroup); ok { + r0 = rf(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*armresources.ResourceGroup) + } + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockAzureClienter_ListAllResourceGroups_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListAllResourceGroups' +type MockAzureClienter_ListAllResourceGroups_Call struct { + *mock.Call +} + +// ListAllResourceGroups is a helper method to define mock.On call +// - ctx context.Context +func (_e *MockAzureClienter_Expecter) ListAllResourceGroups(ctx interface{}) *MockAzureClienter_ListAllResourceGroups_Call { + return &MockAzureClienter_ListAllResourceGroups_Call{Call: _e.mock.On("ListAllResourceGroups", ctx)} +} + +func (_c *MockAzureClienter_ListAllResourceGroups_Call) Run(run func(ctx context.Context)) *MockAzureClienter_ListAllResourceGroups_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *MockAzureClienter_ListAllResourceGroups_Call) Return(_a0 []*armresources.ResourceGroup, _a1 error) *MockAzureClienter_ListAllResourceGroups_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockAzureClienter_ListAllResourceGroups_Call) RunAndReturn(run func(context.Context) ([]*armresources.ResourceGroup, error)) *MockAzureClienter_ListAllResourceGroups_Call { + _c.Call.Return(run) + return _c +} + +// ListAllResourcesInSubscription provides a mock function with given fields: ctx, subscriptionID, tags +func (_m *MockAzureClienter) ListAllResourcesInSubscription(ctx context.Context, subscriptionID string, tags map[string]*string) ([]interface{}, error) { + ret := _m.Called(ctx, subscriptionID, tags) + + if len(ret) == 0 { + panic("no return value specified for ListAllResourcesInSubscription") + } + + var r0 []interface{} + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, map[string]*string) ([]interface{}, error)); ok { + return rf(ctx, subscriptionID, tags) + } + if rf, ok := ret.Get(0).(func(context.Context, string, map[string]*string) []interface{}); ok { + r0 = rf(ctx, subscriptionID, tags) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]interface{}) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, map[string]*string) error); ok { + r1 = rf(ctx, subscriptionID, tags) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockAzureClienter_ListAllResourcesInSubscription_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListAllResourcesInSubscription' +type MockAzureClienter_ListAllResourcesInSubscription_Call struct { + *mock.Call +} + +// ListAllResourcesInSubscription is a helper method to define mock.On call +// - ctx context.Context +// - subscriptionID string +// - tags map[string]*string +func (_e *MockAzureClienter_Expecter) ListAllResourcesInSubscription(ctx interface{}, subscriptionID interface{}, tags interface{}) *MockAzureClienter_ListAllResourcesInSubscription_Call { + return &MockAzureClienter_ListAllResourcesInSubscription_Call{Call: _e.mock.On("ListAllResourcesInSubscription", ctx, subscriptionID, tags)} +} + +func (_c *MockAzureClienter_ListAllResourcesInSubscription_Call) Run(run func(ctx context.Context, subscriptionID string, tags map[string]*string)) *MockAzureClienter_ListAllResourcesInSubscription_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(map[string]*string)) + }) + return _c +} + +func (_c *MockAzureClienter_ListAllResourcesInSubscription_Call) Return(_a0 []interface{}, _a1 error) *MockAzureClienter_ListAllResourcesInSubscription_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockAzureClienter_ListAllResourcesInSubscription_Call) RunAndReturn(run func(context.Context, string, map[string]*string) ([]interface{}, error)) *MockAzureClienter_ListAllResourcesInSubscription_Call { + _c.Call.Return(run) + return _c +} + +// NewSubscriptionListPager provides a mock function with given fields: ctx, options +func (_m *MockAzureClienter) NewSubscriptionListPager(ctx context.Context, options *armsubscription.SubscriptionsClientListOptions) *runtime.Pager[armsubscription.SubscriptionsClientListResponse] { + ret := _m.Called(ctx, options) + + if len(ret) == 0 { + panic("no return value specified for NewSubscriptionListPager") + } + + var r0 *runtime.Pager[armsubscription.SubscriptionsClientListResponse] + if rf, ok := ret.Get(0).(func(context.Context, *armsubscription.SubscriptionsClientListOptions) *runtime.Pager[armsubscription.SubscriptionsClientListResponse]); ok { + r0 = rf(ctx, options) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*runtime.Pager[armsubscription.SubscriptionsClientListResponse]) + } + } + + return r0 +} + +// MockAzureClienter_NewSubscriptionListPager_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewSubscriptionListPager' +type MockAzureClienter_NewSubscriptionListPager_Call struct { + *mock.Call +} + +// NewSubscriptionListPager is a helper method to define mock.On call +// - ctx context.Context +// - options *armsubscription.SubscriptionsClientListOptions +func (_e *MockAzureClienter_Expecter) NewSubscriptionListPager(ctx interface{}, options interface{}) *MockAzureClienter_NewSubscriptionListPager_Call { + return &MockAzureClienter_NewSubscriptionListPager_Call{Call: _e.mock.On("NewSubscriptionListPager", ctx, options)} +} + +func (_c *MockAzureClienter_NewSubscriptionListPager_Call) Run(run func(ctx context.Context, options *armsubscription.SubscriptionsClientListOptions)) *MockAzureClienter_NewSubscriptionListPager_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*armsubscription.SubscriptionsClientListOptions)) + }) + return _c +} + +func (_c *MockAzureClienter_NewSubscriptionListPager_Call) Return(_a0 *runtime.Pager[armsubscription.SubscriptionsClientListResponse]) *MockAzureClienter_NewSubscriptionListPager_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockAzureClienter_NewSubscriptionListPager_Call) RunAndReturn(run func(context.Context, *armsubscription.SubscriptionsClientListOptions) *runtime.Pager[armsubscription.SubscriptionsClientListResponse]) *MockAzureClienter_NewSubscriptionListPager_Call { + _c.Call.Return(run) + return _c +} + +// ResourceGroupExists provides a mock function with given fields: ctx, resourceGroupName +func (_m *MockAzureClienter) ResourceGroupExists(ctx context.Context, resourceGroupName string) (bool, error) { + ret := _m.Called(ctx, resourceGroupName) + + if len(ret) == 0 { + panic("no return value specified for ResourceGroupExists") + } + + var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (bool, error)); ok { + return rf(ctx, resourceGroupName) + } + if rf, ok := ret.Get(0).(func(context.Context, string) bool); ok { + r0 = rf(ctx, resourceGroupName) + } else { + r0 = ret.Get(0).(bool) + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, resourceGroupName) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockAzureClienter_ResourceGroupExists_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ResourceGroupExists' +type MockAzureClienter_ResourceGroupExists_Call struct { + *mock.Call +} + +// ResourceGroupExists is a helper method to define mock.On call +// - ctx context.Context +// - resourceGroupName string +func (_e *MockAzureClienter_Expecter) ResourceGroupExists(ctx interface{}, resourceGroupName interface{}) *MockAzureClienter_ResourceGroupExists_Call { + return &MockAzureClienter_ResourceGroupExists_Call{Call: _e.mock.On("ResourceGroupExists", ctx, resourceGroupName)} +} + +func (_c *MockAzureClienter_ResourceGroupExists_Call) Run(run func(ctx context.Context, resourceGroupName string)) *MockAzureClienter_ResourceGroupExists_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockAzureClienter_ResourceGroupExists_Call) Return(_a0 bool, _a1 error) *MockAzureClienter_ResourceGroupExists_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockAzureClienter_ResourceGroupExists_Call) RunAndReturn(run func(context.Context, string) (bool, error)) *MockAzureClienter_ResourceGroupExists_Call { + _c.Call.Return(run) + return _c +} + +// ValidateMachineType provides a mock function with given fields: ctx, location, vmSize +func (_m *MockAzureClienter) ValidateMachineType(ctx context.Context, location string, vmSize string) (bool, error) { + ret := _m.Called(ctx, location, vmSize) + + if len(ret) == 0 { + panic("no return value specified for ValidateMachineType") + } + + var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) (bool, error)); ok { + return rf(ctx, location, vmSize) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string) bool); ok { + r0 = rf(ctx, location, vmSize) + } else { + r0 = ret.Get(0).(bool) + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { + r1 = rf(ctx, location, vmSize) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockAzureClienter_ValidateMachineType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ValidateMachineType' +type MockAzureClienter_ValidateMachineType_Call struct { + *mock.Call +} + +// ValidateMachineType is a helper method to define mock.On call +// - ctx context.Context +// - location string +// - vmSize string +func (_e *MockAzureClienter_Expecter) ValidateMachineType(ctx interface{}, location interface{}, vmSize interface{}) *MockAzureClienter_ValidateMachineType_Call { + return &MockAzureClienter_ValidateMachineType_Call{Call: _e.mock.On("ValidateMachineType", ctx, location, vmSize)} +} + +func (_c *MockAzureClienter_ValidateMachineType_Call) Run(run func(ctx context.Context, location string, vmSize string)) *MockAzureClienter_ValidateMachineType_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *MockAzureClienter_ValidateMachineType_Call) Return(_a0 bool, _a1 error) *MockAzureClienter_ValidateMachineType_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockAzureClienter_ValidateMachineType_Call) RunAndReturn(run func(context.Context, string, string) (bool, error)) *MockAzureClienter_ValidateMachineType_Call { + _c.Call.Return(run) + return _c +} + +// NewMockAzureClienter creates a new instance of MockAzureClienter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockAzureClienter(t interface { + mock.TestingT + Cleanup(func()) +}) *MockAzureClienter { + mock := &MockAzureClienter{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/pkg/models/interfaces/aws/mocks/azure/mock_Pollerer.go b/pkg/models/interfaces/aws/mocks/azure/mock_Pollerer.go new file mode 100644 index 00000000..40c2f5c6 --- /dev/null +++ b/pkg/models/interfaces/aws/mocks/azure/mock_Pollerer.go @@ -0,0 +1,313 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package azure_interface + +import ( + armresources "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources" + + context "context" + + http "net/http" + + mock "github.com/stretchr/testify/mock" + + runtime "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" +) + +// MockPollerer is an autogenerated mock type for the Pollerer type +type MockPollerer struct { + mock.Mock +} + +type MockPollerer_Expecter struct { + mock *mock.Mock +} + +func (_m *MockPollerer) EXPECT() *MockPollerer_Expecter { + return &MockPollerer_Expecter{mock: &_m.Mock} +} + +// Done provides a mock function with given fields: +func (_m *MockPollerer) Done() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Done") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// MockPollerer_Done_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Done' +type MockPollerer_Done_Call struct { + *mock.Call +} + +// Done is a helper method to define mock.On call +func (_e *MockPollerer_Expecter) Done() *MockPollerer_Done_Call { + return &MockPollerer_Done_Call{Call: _e.mock.On("Done")} +} + +func (_c *MockPollerer_Done_Call) Run(run func()) *MockPollerer_Done_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockPollerer_Done_Call) Return(_a0 bool) *MockPollerer_Done_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockPollerer_Done_Call) RunAndReturn(run func() bool) *MockPollerer_Done_Call { + _c.Call.Return(run) + return _c +} + +// Poll provides a mock function with given fields: ctx +func (_m *MockPollerer) Poll(ctx context.Context) (*http.Response, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for Poll") + } + + var r0 *http.Response + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*http.Response, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) *http.Response); ok { + r0 = rf(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*http.Response) + } + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockPollerer_Poll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Poll' +type MockPollerer_Poll_Call struct { + *mock.Call +} + +// Poll is a helper method to define mock.On call +// - ctx context.Context +func (_e *MockPollerer_Expecter) Poll(ctx interface{}) *MockPollerer_Poll_Call { + return &MockPollerer_Poll_Call{Call: _e.mock.On("Poll", ctx)} +} + +func (_c *MockPollerer_Poll_Call) Run(run func(ctx context.Context)) *MockPollerer_Poll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *MockPollerer_Poll_Call) Return(_a0 *http.Response, _a1 error) *MockPollerer_Poll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockPollerer_Poll_Call) RunAndReturn(run func(context.Context) (*http.Response, error)) *MockPollerer_Poll_Call { + _c.Call.Return(run) + return _c +} + +// PollUntilDone provides a mock function with given fields: ctx, options +func (_m *MockPollerer) PollUntilDone(ctx context.Context, options *runtime.PollUntilDoneOptions) (armresources.DeploymentsClientCreateOrUpdateResponse, error) { + ret := _m.Called(ctx, options) + + if len(ret) == 0 { + panic("no return value specified for PollUntilDone") + } + + var r0 armresources.DeploymentsClientCreateOrUpdateResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *runtime.PollUntilDoneOptions) (armresources.DeploymentsClientCreateOrUpdateResponse, error)); ok { + return rf(ctx, options) + } + if rf, ok := ret.Get(0).(func(context.Context, *runtime.PollUntilDoneOptions) armresources.DeploymentsClientCreateOrUpdateResponse); ok { + r0 = rf(ctx, options) + } else { + r0 = ret.Get(0).(armresources.DeploymentsClientCreateOrUpdateResponse) + } + + if rf, ok := ret.Get(1).(func(context.Context, *runtime.PollUntilDoneOptions) error); ok { + r1 = rf(ctx, options) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockPollerer_PollUntilDone_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PollUntilDone' +type MockPollerer_PollUntilDone_Call struct { + *mock.Call +} + +// PollUntilDone is a helper method to define mock.On call +// - ctx context.Context +// - options *runtime.PollUntilDoneOptions +func (_e *MockPollerer_Expecter) PollUntilDone(ctx interface{}, options interface{}) *MockPollerer_PollUntilDone_Call { + return &MockPollerer_PollUntilDone_Call{Call: _e.mock.On("PollUntilDone", ctx, options)} +} + +func (_c *MockPollerer_PollUntilDone_Call) Run(run func(ctx context.Context, options *runtime.PollUntilDoneOptions)) *MockPollerer_PollUntilDone_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*runtime.PollUntilDoneOptions)) + }) + return _c +} + +func (_c *MockPollerer_PollUntilDone_Call) Return(_a0 armresources.DeploymentsClientCreateOrUpdateResponse, _a1 error) *MockPollerer_PollUntilDone_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockPollerer_PollUntilDone_Call) RunAndReturn(run func(context.Context, *runtime.PollUntilDoneOptions) (armresources.DeploymentsClientCreateOrUpdateResponse, error)) *MockPollerer_PollUntilDone_Call { + _c.Call.Return(run) + return _c +} + +// Result provides a mock function with given fields: ctx +func (_m *MockPollerer) Result(ctx context.Context) (armresources.DeploymentsClientCreateOrUpdateResponse, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for Result") + } + + var r0 armresources.DeploymentsClientCreateOrUpdateResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (armresources.DeploymentsClientCreateOrUpdateResponse, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) armresources.DeploymentsClientCreateOrUpdateResponse); ok { + r0 = rf(ctx) + } else { + r0 = ret.Get(0).(armresources.DeploymentsClientCreateOrUpdateResponse) + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockPollerer_Result_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Result' +type MockPollerer_Result_Call struct { + *mock.Call +} + +// Result is a helper method to define mock.On call +// - ctx context.Context +func (_e *MockPollerer_Expecter) Result(ctx interface{}) *MockPollerer_Result_Call { + return &MockPollerer_Result_Call{Call: _e.mock.On("Result", ctx)} +} + +func (_c *MockPollerer_Result_Call) Run(run func(ctx context.Context)) *MockPollerer_Result_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *MockPollerer_Result_Call) Return(_a0 armresources.DeploymentsClientCreateOrUpdateResponse, _a1 error) *MockPollerer_Result_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockPollerer_Result_Call) RunAndReturn(run func(context.Context) (armresources.DeploymentsClientCreateOrUpdateResponse, error)) *MockPollerer_Result_Call { + _c.Call.Return(run) + return _c +} + +// ResumeToken provides a mock function with given fields: +func (_m *MockPollerer) ResumeToken() (string, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for ResumeToken") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func() (string, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockPollerer_ResumeToken_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ResumeToken' +type MockPollerer_ResumeToken_Call struct { + *mock.Call +} + +// ResumeToken is a helper method to define mock.On call +func (_e *MockPollerer_Expecter) ResumeToken() *MockPollerer_ResumeToken_Call { + return &MockPollerer_ResumeToken_Call{Call: _e.mock.On("ResumeToken")} +} + +func (_c *MockPollerer_ResumeToken_Call) Run(run func()) *MockPollerer_ResumeToken_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockPollerer_ResumeToken_Call) Return(_a0 string, _a1 error) *MockPollerer_ResumeToken_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockPollerer_ResumeToken_Call) RunAndReturn(run func() (string, error)) *MockPollerer_ResumeToken_Call { + _c.Call.Return(run) + return _c +} + +// NewMockPollerer creates a new instance of MockPollerer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockPollerer(t interface { + mock.TestingT + Cleanup(func()) +}) *MockPollerer { + mock := &MockPollerer{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/pkg/models/interfaces/aws/mocks/common/mock_Clienter.go b/pkg/models/interfaces/aws/mocks/common/mock_Clienter.go new file mode 100644 index 00000000..7cc1d6de --- /dev/null +++ b/pkg/models/interfaces/aws/mocks/common/mock_Clienter.go @@ -0,0 +1,32 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package common_interface + +import mock "github.com/stretchr/testify/mock" + +// MockClienter is an autogenerated mock type for the Clienter type +type MockClienter struct { + mock.Mock +} + +type MockClienter_Expecter struct { + mock *mock.Mock +} + +func (_m *MockClienter) EXPECT() *MockClienter_Expecter { + return &MockClienter_Expecter{mock: &_m.Mock} +} + +// NewMockClienter creates a new instance of MockClienter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockClienter(t interface { + mock.TestingT + Cleanup(func()) +}) *MockClienter { + mock := &MockClienter{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/pkg/models/interfaces/aws/mocks/common/mock_ClusterDeployerer.go b/pkg/models/interfaces/aws/mocks/common/mock_ClusterDeployerer.go new file mode 100644 index 00000000..80a73774 --- /dev/null +++ b/pkg/models/interfaces/aws/mocks/common/mock_ClusterDeployerer.go @@ -0,0 +1,371 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package common_interface + +import ( + context "context" + + models "github.com/bacalhau-project/andaime/pkg/models" + mock "github.com/stretchr/testify/mock" + + sshutils "github.com/bacalhau-project/andaime/pkg/models/interfaces/sshutils" +) + +// MockClusterDeployerer is an autogenerated mock type for the ClusterDeployerer type +type MockClusterDeployerer struct { + mock.Mock +} + +type MockClusterDeployerer_Expecter struct { + mock *mock.Mock +} + +func (_m *MockClusterDeployerer) EXPECT() *MockClusterDeployerer_Expecter { + return &MockClusterDeployerer_Expecter{mock: &_m.Mock} +} + +// ApplyBacalhauConfigs provides a mock function with given fields: ctx, sshConfig, bacalhauSettings +func (_m *MockClusterDeployerer) ApplyBacalhauConfigs(ctx context.Context, sshConfig sshutils.SSHConfiger, bacalhauSettings []models.BacalhauSettings) error { + ret := _m.Called(ctx, sshConfig, bacalhauSettings) + + if len(ret) == 0 { + panic("no return value specified for ApplyBacalhauConfigs") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, sshutils.SSHConfiger, []models.BacalhauSettings) error); ok { + r0 = rf(ctx, sshConfig, bacalhauSettings) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockClusterDeployerer_ApplyBacalhauConfigs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ApplyBacalhauConfigs' +type MockClusterDeployerer_ApplyBacalhauConfigs_Call struct { + *mock.Call +} + +// ApplyBacalhauConfigs is a helper method to define mock.On call +// - ctx context.Context +// - sshConfig sshutils.SSHConfiger +// - bacalhauSettings []models.BacalhauSettings +func (_e *MockClusterDeployerer_Expecter) ApplyBacalhauConfigs(ctx interface{}, sshConfig interface{}, bacalhauSettings interface{}) *MockClusterDeployerer_ApplyBacalhauConfigs_Call { + return &MockClusterDeployerer_ApplyBacalhauConfigs_Call{Call: _e.mock.On("ApplyBacalhauConfigs", ctx, sshConfig, bacalhauSettings)} +} + +func (_c *MockClusterDeployerer_ApplyBacalhauConfigs_Call) Run(run func(ctx context.Context, sshConfig sshutils.SSHConfiger, bacalhauSettings []models.BacalhauSettings)) *MockClusterDeployerer_ApplyBacalhauConfigs_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(sshutils.SSHConfiger), args[2].([]models.BacalhauSettings)) + }) + return _c +} + +func (_c *MockClusterDeployerer_ApplyBacalhauConfigs_Call) Return(_a0 error) *MockClusterDeployerer_ApplyBacalhauConfigs_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockClusterDeployerer_ApplyBacalhauConfigs_Call) RunAndReturn(run func(context.Context, sshutils.SSHConfiger, []models.BacalhauSettings) error) *MockClusterDeployerer_ApplyBacalhauConfigs_Call { + _c.Call.Return(run) + return _c +} + +// ExecuteCustomScript provides a mock function with given fields: ctx, sshConfig, machine +func (_m *MockClusterDeployerer) ExecuteCustomScript(ctx context.Context, sshConfig sshutils.SSHConfiger, machine models.Machiner) error { + ret := _m.Called(ctx, sshConfig, machine) + + if len(ret) == 0 { + panic("no return value specified for ExecuteCustomScript") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, sshutils.SSHConfiger, models.Machiner) error); ok { + r0 = rf(ctx, sshConfig, machine) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockClusterDeployerer_ExecuteCustomScript_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExecuteCustomScript' +type MockClusterDeployerer_ExecuteCustomScript_Call struct { + *mock.Call +} + +// ExecuteCustomScript is a helper method to define mock.On call +// - ctx context.Context +// - sshConfig sshutils.SSHConfiger +// - machine models.Machiner +func (_e *MockClusterDeployerer_Expecter) ExecuteCustomScript(ctx interface{}, sshConfig interface{}, machine interface{}) *MockClusterDeployerer_ExecuteCustomScript_Call { + return &MockClusterDeployerer_ExecuteCustomScript_Call{Call: _e.mock.On("ExecuteCustomScript", ctx, sshConfig, machine)} +} + +func (_c *MockClusterDeployerer_ExecuteCustomScript_Call) Run(run func(ctx context.Context, sshConfig sshutils.SSHConfiger, machine models.Machiner)) *MockClusterDeployerer_ExecuteCustomScript_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(sshutils.SSHConfiger), args[2].(models.Machiner)) + }) + return _c +} + +func (_c *MockClusterDeployerer_ExecuteCustomScript_Call) Return(_a0 error) *MockClusterDeployerer_ExecuteCustomScript_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockClusterDeployerer_ExecuteCustomScript_Call) RunAndReturn(run func(context.Context, sshutils.SSHConfiger, models.Machiner) error) *MockClusterDeployerer_ExecuteCustomScript_Call { + _c.Call.Return(run) + return _c +} + +// ProvisionBacalhauCluster provides a mock function with given fields: ctx +func (_m *MockClusterDeployerer) ProvisionBacalhauCluster(ctx context.Context) error { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for ProvisionBacalhauCluster") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context) error); ok { + r0 = rf(ctx) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockClusterDeployerer_ProvisionBacalhauCluster_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ProvisionBacalhauCluster' +type MockClusterDeployerer_ProvisionBacalhauCluster_Call struct { + *mock.Call +} + +// ProvisionBacalhauCluster is a helper method to define mock.On call +// - ctx context.Context +func (_e *MockClusterDeployerer_Expecter) ProvisionBacalhauCluster(ctx interface{}) *MockClusterDeployerer_ProvisionBacalhauCluster_Call { + return &MockClusterDeployerer_ProvisionBacalhauCluster_Call{Call: _e.mock.On("ProvisionBacalhauCluster", ctx)} +} + +func (_c *MockClusterDeployerer_ProvisionBacalhauCluster_Call) Run(run func(ctx context.Context)) *MockClusterDeployerer_ProvisionBacalhauCluster_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *MockClusterDeployerer_ProvisionBacalhauCluster_Call) Return(_a0 error) *MockClusterDeployerer_ProvisionBacalhauCluster_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockClusterDeployerer_ProvisionBacalhauCluster_Call) RunAndReturn(run func(context.Context) error) *MockClusterDeployerer_ProvisionBacalhauCluster_Call { + _c.Call.Return(run) + return _c +} + +// ProvisionMachine provides a mock function with given fields: ctx, sshConfig, machine +func (_m *MockClusterDeployerer) ProvisionMachine(ctx context.Context, sshConfig sshutils.SSHConfiger, machine models.Machiner) error { + ret := _m.Called(ctx, sshConfig, machine) + + if len(ret) == 0 { + panic("no return value specified for ProvisionMachine") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, sshutils.SSHConfiger, models.Machiner) error); ok { + r0 = rf(ctx, sshConfig, machine) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockClusterDeployerer_ProvisionMachine_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ProvisionMachine' +type MockClusterDeployerer_ProvisionMachine_Call struct { + *mock.Call +} + +// ProvisionMachine is a helper method to define mock.On call +// - ctx context.Context +// - sshConfig sshutils.SSHConfiger +// - machine models.Machiner +func (_e *MockClusterDeployerer_Expecter) ProvisionMachine(ctx interface{}, sshConfig interface{}, machine interface{}) *MockClusterDeployerer_ProvisionMachine_Call { + return &MockClusterDeployerer_ProvisionMachine_Call{Call: _e.mock.On("ProvisionMachine", ctx, sshConfig, machine)} +} + +func (_c *MockClusterDeployerer_ProvisionMachine_Call) Run(run func(ctx context.Context, sshConfig sshutils.SSHConfiger, machine models.Machiner)) *MockClusterDeployerer_ProvisionMachine_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(sshutils.SSHConfiger), args[2].(models.Machiner)) + }) + return _c +} + +func (_c *MockClusterDeployerer_ProvisionMachine_Call) Return(_a0 error) *MockClusterDeployerer_ProvisionMachine_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockClusterDeployerer_ProvisionMachine_Call) RunAndReturn(run func(context.Context, sshutils.SSHConfiger, models.Machiner) error) *MockClusterDeployerer_ProvisionMachine_Call { + _c.Call.Return(run) + return _c +} + +// ProvisionOrchestrator provides a mock function with given fields: ctx, machineName +func (_m *MockClusterDeployerer) ProvisionOrchestrator(ctx context.Context, machineName string) error { + ret := _m.Called(ctx, machineName) + + if len(ret) == 0 { + panic("no return value specified for ProvisionOrchestrator") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = rf(ctx, machineName) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockClusterDeployerer_ProvisionOrchestrator_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ProvisionOrchestrator' +type MockClusterDeployerer_ProvisionOrchestrator_Call struct { + *mock.Call +} + +// ProvisionOrchestrator is a helper method to define mock.On call +// - ctx context.Context +// - machineName string +func (_e *MockClusterDeployerer_Expecter) ProvisionOrchestrator(ctx interface{}, machineName interface{}) *MockClusterDeployerer_ProvisionOrchestrator_Call { + return &MockClusterDeployerer_ProvisionOrchestrator_Call{Call: _e.mock.On("ProvisionOrchestrator", ctx, machineName)} +} + +func (_c *MockClusterDeployerer_ProvisionOrchestrator_Call) Run(run func(ctx context.Context, machineName string)) *MockClusterDeployerer_ProvisionOrchestrator_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockClusterDeployerer_ProvisionOrchestrator_Call) Return(_a0 error) *MockClusterDeployerer_ProvisionOrchestrator_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockClusterDeployerer_ProvisionOrchestrator_Call) RunAndReturn(run func(context.Context, string) error) *MockClusterDeployerer_ProvisionOrchestrator_Call { + _c.Call.Return(run) + return _c +} + +// ProvisionWorker provides a mock function with given fields: ctx, machineName +func (_m *MockClusterDeployerer) ProvisionWorker(ctx context.Context, machineName string) error { + ret := _m.Called(ctx, machineName) + + if len(ret) == 0 { + panic("no return value specified for ProvisionWorker") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = rf(ctx, machineName) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockClusterDeployerer_ProvisionWorker_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ProvisionWorker' +type MockClusterDeployerer_ProvisionWorker_Call struct { + *mock.Call +} + +// ProvisionWorker is a helper method to define mock.On call +// - ctx context.Context +// - machineName string +func (_e *MockClusterDeployerer_Expecter) ProvisionWorker(ctx interface{}, machineName interface{}) *MockClusterDeployerer_ProvisionWorker_Call { + return &MockClusterDeployerer_ProvisionWorker_Call{Call: _e.mock.On("ProvisionWorker", ctx, machineName)} +} + +func (_c *MockClusterDeployerer_ProvisionWorker_Call) Run(run func(ctx context.Context, machineName string)) *MockClusterDeployerer_ProvisionWorker_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockClusterDeployerer_ProvisionWorker_Call) Return(_a0 error) *MockClusterDeployerer_ProvisionWorker_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockClusterDeployerer_ProvisionWorker_Call) RunAndReturn(run func(context.Context, string) error) *MockClusterDeployerer_ProvisionWorker_Call { + _c.Call.Return(run) + return _c +} + +// WaitForAllMachinesToReachState provides a mock function with given fields: ctx, resourceType, state +func (_m *MockClusterDeployerer) WaitForAllMachinesToReachState(ctx context.Context, resourceType string, state models.MachineResourceState) error { + ret := _m.Called(ctx, resourceType, state) + + if len(ret) == 0 { + panic("no return value specified for WaitForAllMachinesToReachState") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, models.MachineResourceState) error); ok { + r0 = rf(ctx, resourceType, state) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockClusterDeployerer_WaitForAllMachinesToReachState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WaitForAllMachinesToReachState' +type MockClusterDeployerer_WaitForAllMachinesToReachState_Call struct { + *mock.Call +} + +// WaitForAllMachinesToReachState is a helper method to define mock.On call +// - ctx context.Context +// - resourceType string +// - state models.MachineResourceState +func (_e *MockClusterDeployerer_Expecter) WaitForAllMachinesToReachState(ctx interface{}, resourceType interface{}, state interface{}) *MockClusterDeployerer_WaitForAllMachinesToReachState_Call { + return &MockClusterDeployerer_WaitForAllMachinesToReachState_Call{Call: _e.mock.On("WaitForAllMachinesToReachState", ctx, resourceType, state)} +} + +func (_c *MockClusterDeployerer_WaitForAllMachinesToReachState_Call) Run(run func(ctx context.Context, resourceType string, state models.MachineResourceState)) *MockClusterDeployerer_WaitForAllMachinesToReachState_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(models.MachineResourceState)) + }) + return _c +} + +func (_c *MockClusterDeployerer_WaitForAllMachinesToReachState_Call) Return(_a0 error) *MockClusterDeployerer_WaitForAllMachinesToReachState_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockClusterDeployerer_WaitForAllMachinesToReachState_Call) RunAndReturn(run func(context.Context, string, models.MachineResourceState) error) *MockClusterDeployerer_WaitForAllMachinesToReachState_Call { + _c.Call.Return(run) + return _c +} + +// NewMockClusterDeployerer creates a new instance of MockClusterDeployerer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockClusterDeployerer(t interface { + mock.TestingT + Cleanup(func()) +}) *MockClusterDeployerer { + mock := &MockClusterDeployerer{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/pkg/models/interfaces/aws/mocks/gcp/mock_GCPClienter.go b/pkg/models/interfaces/aws/mocks/gcp/mock_GCPClienter.go new file mode 100644 index 00000000..f3293591 --- /dev/null +++ b/pkg/models/interfaces/aws/mocks/gcp/mock_GCPClienter.go @@ -0,0 +1,1463 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package gcp_interface + +import ( + assetpb "cloud.google.com/go/asset/apiv1/assetpb" + computepb "cloud.google.com/go/compute/apiv1/computepb" + + context "context" + + iam "google.golang.org/api/iam/v1" + + mock "github.com/stretchr/testify/mock" + + models "github.com/bacalhau-project/andaime/pkg/models" + + resourcemanagerpb "cloud.google.com/go/resourcemanager/apiv3/resourcemanagerpb" +) + +// MockGCPClienter is an autogenerated mock type for the GCPClienter type +type MockGCPClienter struct { + mock.Mock +} + +type MockGCPClienter_Expecter struct { + mock *mock.Mock +} + +func (_m *MockGCPClienter) EXPECT() *MockGCPClienter_Expecter { + return &MockGCPClienter_Expecter{mock: &_m.Mock} +} + +// CheckAuthentication provides a mock function with given fields: ctx, projectID +func (_m *MockGCPClienter) CheckAuthentication(ctx context.Context, projectID string) error { + ret := _m.Called(ctx, projectID) + + if len(ret) == 0 { + panic("no return value specified for CheckAuthentication") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = rf(ctx, projectID) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockGCPClienter_CheckAuthentication_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CheckAuthentication' +type MockGCPClienter_CheckAuthentication_Call struct { + *mock.Call +} + +// CheckAuthentication is a helper method to define mock.On call +// - ctx context.Context +// - projectID string +func (_e *MockGCPClienter_Expecter) CheckAuthentication(ctx interface{}, projectID interface{}) *MockGCPClienter_CheckAuthentication_Call { + return &MockGCPClienter_CheckAuthentication_Call{Call: _e.mock.On("CheckAuthentication", ctx, projectID)} +} + +func (_c *MockGCPClienter_CheckAuthentication_Call) Run(run func(ctx context.Context, projectID string)) *MockGCPClienter_CheckAuthentication_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockGCPClienter_CheckAuthentication_Call) Return(_a0 error) *MockGCPClienter_CheckAuthentication_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockGCPClienter_CheckAuthentication_Call) RunAndReturn(run func(context.Context, string) error) *MockGCPClienter_CheckAuthentication_Call { + _c.Call.Return(run) + return _c +} + +// CheckFirewallRuleExists provides a mock function with given fields: ctx, projectID, ruleName +func (_m *MockGCPClienter) CheckFirewallRuleExists(ctx context.Context, projectID string, ruleName string) error { + ret := _m.Called(ctx, projectID, ruleName) + + if len(ret) == 0 { + panic("no return value specified for CheckFirewallRuleExists") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok { + r0 = rf(ctx, projectID, ruleName) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockGCPClienter_CheckFirewallRuleExists_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CheckFirewallRuleExists' +type MockGCPClienter_CheckFirewallRuleExists_Call struct { + *mock.Call +} + +// CheckFirewallRuleExists is a helper method to define mock.On call +// - ctx context.Context +// - projectID string +// - ruleName string +func (_e *MockGCPClienter_Expecter) CheckFirewallRuleExists(ctx interface{}, projectID interface{}, ruleName interface{}) *MockGCPClienter_CheckFirewallRuleExists_Call { + return &MockGCPClienter_CheckFirewallRuleExists_Call{Call: _e.mock.On("CheckFirewallRuleExists", ctx, projectID, ruleName)} +} + +func (_c *MockGCPClienter_CheckFirewallRuleExists_Call) Run(run func(ctx context.Context, projectID string, ruleName string)) *MockGCPClienter_CheckFirewallRuleExists_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *MockGCPClienter_CheckFirewallRuleExists_Call) Return(_a0 error) *MockGCPClienter_CheckFirewallRuleExists_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockGCPClienter_CheckFirewallRuleExists_Call) RunAndReturn(run func(context.Context, string, string) error) *MockGCPClienter_CheckFirewallRuleExists_Call { + _c.Call.Return(run) + return _c +} + +// CheckPermissions provides a mock function with given fields: ctx, projectID +func (_m *MockGCPClienter) CheckPermissions(ctx context.Context, projectID string) error { + ret := _m.Called(ctx, projectID) + + if len(ret) == 0 { + panic("no return value specified for CheckPermissions") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = rf(ctx, projectID) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockGCPClienter_CheckPermissions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CheckPermissions' +type MockGCPClienter_CheckPermissions_Call struct { + *mock.Call +} + +// CheckPermissions is a helper method to define mock.On call +// - ctx context.Context +// - projectID string +func (_e *MockGCPClienter_Expecter) CheckPermissions(ctx interface{}, projectID interface{}) *MockGCPClienter_CheckPermissions_Call { + return &MockGCPClienter_CheckPermissions_Call{Call: _e.mock.On("CheckPermissions", ctx, projectID)} +} + +func (_c *MockGCPClienter_CheckPermissions_Call) Run(run func(ctx context.Context, projectID string)) *MockGCPClienter_CheckPermissions_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockGCPClienter_CheckPermissions_Call) Return(_a0 error) *MockGCPClienter_CheckPermissions_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockGCPClienter_CheckPermissions_Call) RunAndReturn(run func(context.Context, string) error) *MockGCPClienter_CheckPermissions_Call { + _c.Call.Return(run) + return _c +} + +// CreateFirewallRules provides a mock function with given fields: ctx, projectID, networkName +func (_m *MockGCPClienter) CreateFirewallRules(ctx context.Context, projectID string, networkName string) error { + ret := _m.Called(ctx, projectID, networkName) + + if len(ret) == 0 { + panic("no return value specified for CreateFirewallRules") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok { + r0 = rf(ctx, projectID, networkName) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockGCPClienter_CreateFirewallRules_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateFirewallRules' +type MockGCPClienter_CreateFirewallRules_Call struct { + *mock.Call +} + +// CreateFirewallRules is a helper method to define mock.On call +// - ctx context.Context +// - projectID string +// - networkName string +func (_e *MockGCPClienter_Expecter) CreateFirewallRules(ctx interface{}, projectID interface{}, networkName interface{}) *MockGCPClienter_CreateFirewallRules_Call { + return &MockGCPClienter_CreateFirewallRules_Call{Call: _e.mock.On("CreateFirewallRules", ctx, projectID, networkName)} +} + +func (_c *MockGCPClienter_CreateFirewallRules_Call) Run(run func(ctx context.Context, projectID string, networkName string)) *MockGCPClienter_CreateFirewallRules_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *MockGCPClienter_CreateFirewallRules_Call) Return(_a0 error) *MockGCPClienter_CreateFirewallRules_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockGCPClienter_CreateFirewallRules_Call) RunAndReturn(run func(context.Context, string, string) error) *MockGCPClienter_CreateFirewallRules_Call { + _c.Call.Return(run) + return _c +} + +// CreateIP provides a mock function with given fields: ctx, projectID, location, address +func (_m *MockGCPClienter) CreateIP(ctx context.Context, projectID string, location string, address *computepb.Address) (*computepb.Address, error) { + ret := _m.Called(ctx, projectID, location, address) + + if len(ret) == 0 { + panic("no return value specified for CreateIP") + } + + var r0 *computepb.Address + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, *computepb.Address) (*computepb.Address, error)); ok { + return rf(ctx, projectID, location, address) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string, *computepb.Address) *computepb.Address); ok { + r0 = rf(ctx, projectID, location, address) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*computepb.Address) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string, *computepb.Address) error); ok { + r1 = rf(ctx, projectID, location, address) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockGCPClienter_CreateIP_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateIP' +type MockGCPClienter_CreateIP_Call struct { + *mock.Call +} + +// CreateIP is a helper method to define mock.On call +// - ctx context.Context +// - projectID string +// - location string +// - address *computepb.Address +func (_e *MockGCPClienter_Expecter) CreateIP(ctx interface{}, projectID interface{}, location interface{}, address interface{}) *MockGCPClienter_CreateIP_Call { + return &MockGCPClienter_CreateIP_Call{Call: _e.mock.On("CreateIP", ctx, projectID, location, address)} +} + +func (_c *MockGCPClienter_CreateIP_Call) Run(run func(ctx context.Context, projectID string, location string, address *computepb.Address)) *MockGCPClienter_CreateIP_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(*computepb.Address)) + }) + return _c +} + +func (_c *MockGCPClienter_CreateIP_Call) Return(_a0 *computepb.Address, _a1 error) *MockGCPClienter_CreateIP_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockGCPClienter_CreateIP_Call) RunAndReturn(run func(context.Context, string, string, *computepb.Address) (*computepb.Address, error)) *MockGCPClienter_CreateIP_Call { + _c.Call.Return(run) + return _c +} + +// CreateServiceAccount provides a mock function with given fields: ctx, projectID +func (_m *MockGCPClienter) CreateServiceAccount(ctx context.Context, projectID string) (*iam.ServiceAccount, error) { + ret := _m.Called(ctx, projectID) + + if len(ret) == 0 { + panic("no return value specified for CreateServiceAccount") + } + + var r0 *iam.ServiceAccount + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*iam.ServiceAccount, error)); ok { + return rf(ctx, projectID) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *iam.ServiceAccount); ok { + r0 = rf(ctx, projectID) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*iam.ServiceAccount) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, projectID) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockGCPClienter_CreateServiceAccount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateServiceAccount' +type MockGCPClienter_CreateServiceAccount_Call struct { + *mock.Call +} + +// CreateServiceAccount is a helper method to define mock.On call +// - ctx context.Context +// - projectID string +func (_e *MockGCPClienter_Expecter) CreateServiceAccount(ctx interface{}, projectID interface{}) *MockGCPClienter_CreateServiceAccount_Call { + return &MockGCPClienter_CreateServiceAccount_Call{Call: _e.mock.On("CreateServiceAccount", ctx, projectID)} +} + +func (_c *MockGCPClienter_CreateServiceAccount_Call) Run(run func(ctx context.Context, projectID string)) *MockGCPClienter_CreateServiceAccount_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockGCPClienter_CreateServiceAccount_Call) Return(_a0 *iam.ServiceAccount, _a1 error) *MockGCPClienter_CreateServiceAccount_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockGCPClienter_CreateServiceAccount_Call) RunAndReturn(run func(context.Context, string) (*iam.ServiceAccount, error)) *MockGCPClienter_CreateServiceAccount_Call { + _c.Call.Return(run) + return _c +} + +// CreateVM provides a mock function with given fields: ctx, projectID, machine, ip, networkName +func (_m *MockGCPClienter) CreateVM(ctx context.Context, projectID string, machine models.Machiner, ip *computepb.Address, networkName string) (*computepb.Instance, error) { + ret := _m.Called(ctx, projectID, machine, ip, networkName) + + if len(ret) == 0 { + panic("no return value specified for CreateVM") + } + + var r0 *computepb.Instance + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, models.Machiner, *computepb.Address, string) (*computepb.Instance, error)); ok { + return rf(ctx, projectID, machine, ip, networkName) + } + if rf, ok := ret.Get(0).(func(context.Context, string, models.Machiner, *computepb.Address, string) *computepb.Instance); ok { + r0 = rf(ctx, projectID, machine, ip, networkName) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*computepb.Instance) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, models.Machiner, *computepb.Address, string) error); ok { + r1 = rf(ctx, projectID, machine, ip, networkName) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockGCPClienter_CreateVM_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateVM' +type MockGCPClienter_CreateVM_Call struct { + *mock.Call +} + +// CreateVM is a helper method to define mock.On call +// - ctx context.Context +// - projectID string +// - machine models.Machiner +// - ip *computepb.Address +// - networkName string +func (_e *MockGCPClienter_Expecter) CreateVM(ctx interface{}, projectID interface{}, machine interface{}, ip interface{}, networkName interface{}) *MockGCPClienter_CreateVM_Call { + return &MockGCPClienter_CreateVM_Call{Call: _e.mock.On("CreateVM", ctx, projectID, machine, ip, networkName)} +} + +func (_c *MockGCPClienter_CreateVM_Call) Run(run func(ctx context.Context, projectID string, machine models.Machiner, ip *computepb.Address, networkName string)) *MockGCPClienter_CreateVM_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(models.Machiner), args[3].(*computepb.Address), args[4].(string)) + }) + return _c +} + +func (_c *MockGCPClienter_CreateVM_Call) Return(_a0 *computepb.Instance, _a1 error) *MockGCPClienter_CreateVM_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockGCPClienter_CreateVM_Call) RunAndReturn(run func(context.Context, string, models.Machiner, *computepb.Address, string) (*computepb.Instance, error)) *MockGCPClienter_CreateVM_Call { + _c.Call.Return(run) + return _c +} + +// CreateVPCNetwork provides a mock function with given fields: ctx, projectID, networkName +func (_m *MockGCPClienter) CreateVPCNetwork(ctx context.Context, projectID string, networkName string) error { + ret := _m.Called(ctx, projectID, networkName) + + if len(ret) == 0 { + panic("no return value specified for CreateVPCNetwork") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok { + r0 = rf(ctx, projectID, networkName) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockGCPClienter_CreateVPCNetwork_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateVPCNetwork' +type MockGCPClienter_CreateVPCNetwork_Call struct { + *mock.Call +} + +// CreateVPCNetwork is a helper method to define mock.On call +// - ctx context.Context +// - projectID string +// - networkName string +func (_e *MockGCPClienter_Expecter) CreateVPCNetwork(ctx interface{}, projectID interface{}, networkName interface{}) *MockGCPClienter_CreateVPCNetwork_Call { + return &MockGCPClienter_CreateVPCNetwork_Call{Call: _e.mock.On("CreateVPCNetwork", ctx, projectID, networkName)} +} + +func (_c *MockGCPClienter_CreateVPCNetwork_Call) Run(run func(ctx context.Context, projectID string, networkName string)) *MockGCPClienter_CreateVPCNetwork_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *MockGCPClienter_CreateVPCNetwork_Call) Return(_a0 error) *MockGCPClienter_CreateVPCNetwork_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockGCPClienter_CreateVPCNetwork_Call) RunAndReturn(run func(context.Context, string, string) error) *MockGCPClienter_CreateVPCNetwork_Call { + _c.Call.Return(run) + return _c +} + +// DeleteIP provides a mock function with given fields: ctx, projectID, location, addressName +func (_m *MockGCPClienter) DeleteIP(ctx context.Context, projectID string, location string, addressName string) error { + ret := _m.Called(ctx, projectID, location, addressName) + + if len(ret) == 0 { + panic("no return value specified for DeleteIP") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string) error); ok { + r0 = rf(ctx, projectID, location, addressName) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockGCPClienter_DeleteIP_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteIP' +type MockGCPClienter_DeleteIP_Call struct { + *mock.Call +} + +// DeleteIP is a helper method to define mock.On call +// - ctx context.Context +// - projectID string +// - location string +// - addressName string +func (_e *MockGCPClienter_Expecter) DeleteIP(ctx interface{}, projectID interface{}, location interface{}, addressName interface{}) *MockGCPClienter_DeleteIP_Call { + return &MockGCPClienter_DeleteIP_Call{Call: _e.mock.On("DeleteIP", ctx, projectID, location, addressName)} +} + +func (_c *MockGCPClienter_DeleteIP_Call) Run(run func(ctx context.Context, projectID string, location string, addressName string)) *MockGCPClienter_DeleteIP_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(string)) + }) + return _c +} + +func (_c *MockGCPClienter_DeleteIP_Call) Return(_a0 error) *MockGCPClienter_DeleteIP_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockGCPClienter_DeleteIP_Call) RunAndReturn(run func(context.Context, string, string, string) error) *MockGCPClienter_DeleteIP_Call { + _c.Call.Return(run) + return _c +} + +// DestroyProject provides a mock function with given fields: ctx, projectID +func (_m *MockGCPClienter) DestroyProject(ctx context.Context, projectID string) error { + ret := _m.Called(ctx, projectID) + + if len(ret) == 0 { + panic("no return value specified for DestroyProject") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = rf(ctx, projectID) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockGCPClienter_DestroyProject_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DestroyProject' +type MockGCPClienter_DestroyProject_Call struct { + *mock.Call +} + +// DestroyProject is a helper method to define mock.On call +// - ctx context.Context +// - projectID string +func (_e *MockGCPClienter_Expecter) DestroyProject(ctx interface{}, projectID interface{}) *MockGCPClienter_DestroyProject_Call { + return &MockGCPClienter_DestroyProject_Call{Call: _e.mock.On("DestroyProject", ctx, projectID)} +} + +func (_c *MockGCPClienter_DestroyProject_Call) Run(run func(ctx context.Context, projectID string)) *MockGCPClienter_DestroyProject_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockGCPClienter_DestroyProject_Call) Return(_a0 error) *MockGCPClienter_DestroyProject_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockGCPClienter_DestroyProject_Call) RunAndReturn(run func(context.Context, string) error) *MockGCPClienter_DestroyProject_Call { + _c.Call.Return(run) + return _c +} + +// EnableAPI provides a mock function with given fields: ctx, projectID, apiName +func (_m *MockGCPClienter) EnableAPI(ctx context.Context, projectID string, apiName string) error { + ret := _m.Called(ctx, projectID, apiName) + + if len(ret) == 0 { + panic("no return value specified for EnableAPI") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok { + r0 = rf(ctx, projectID, apiName) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockGCPClienter_EnableAPI_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EnableAPI' +type MockGCPClienter_EnableAPI_Call struct { + *mock.Call +} + +// EnableAPI is a helper method to define mock.On call +// - ctx context.Context +// - projectID string +// - apiName string +func (_e *MockGCPClienter_Expecter) EnableAPI(ctx interface{}, projectID interface{}, apiName interface{}) *MockGCPClienter_EnableAPI_Call { + return &MockGCPClienter_EnableAPI_Call{Call: _e.mock.On("EnableAPI", ctx, projectID, apiName)} +} + +func (_c *MockGCPClienter_EnableAPI_Call) Run(run func(ctx context.Context, projectID string, apiName string)) *MockGCPClienter_EnableAPI_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *MockGCPClienter_EnableAPI_Call) Return(_a0 error) *MockGCPClienter_EnableAPI_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockGCPClienter_EnableAPI_Call) RunAndReturn(run func(context.Context, string, string) error) *MockGCPClienter_EnableAPI_Call { + _c.Call.Return(run) + return _c +} + +// EnsureFirewallRules provides a mock function with given fields: ctx, projectID, networkName, allowedPorts +func (_m *MockGCPClienter) EnsureFirewallRules(ctx context.Context, projectID string, networkName string, allowedPorts []int) error { + ret := _m.Called(ctx, projectID, networkName, allowedPorts) + + if len(ret) == 0 { + panic("no return value specified for EnsureFirewallRules") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, []int) error); ok { + r0 = rf(ctx, projectID, networkName, allowedPorts) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockGCPClienter_EnsureFirewallRules_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EnsureFirewallRules' +type MockGCPClienter_EnsureFirewallRules_Call struct { + *mock.Call +} + +// EnsureFirewallRules is a helper method to define mock.On call +// - ctx context.Context +// - projectID string +// - networkName string +// - allowedPorts []int +func (_e *MockGCPClienter_Expecter) EnsureFirewallRules(ctx interface{}, projectID interface{}, networkName interface{}, allowedPorts interface{}) *MockGCPClienter_EnsureFirewallRules_Call { + return &MockGCPClienter_EnsureFirewallRules_Call{Call: _e.mock.On("EnsureFirewallRules", ctx, projectID, networkName, allowedPorts)} +} + +func (_c *MockGCPClienter_EnsureFirewallRules_Call) Run(run func(ctx context.Context, projectID string, networkName string, allowedPorts []int)) *MockGCPClienter_EnsureFirewallRules_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].([]int)) + }) + return _c +} + +func (_c *MockGCPClienter_EnsureFirewallRules_Call) Return(_a0 error) *MockGCPClienter_EnsureFirewallRules_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockGCPClienter_EnsureFirewallRules_Call) RunAndReturn(run func(context.Context, string, string, []int) error) *MockGCPClienter_EnsureFirewallRules_Call { + _c.Call.Return(run) + return _c +} + +// EnsureProject provides a mock function with given fields: ctx, organizationID, projectID, billingAccountID +func (_m *MockGCPClienter) EnsureProject(ctx context.Context, organizationID string, projectID string, billingAccountID string) (string, error) { + ret := _m.Called(ctx, organizationID, projectID, billingAccountID) + + if len(ret) == 0 { + panic("no return value specified for EnsureProject") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string) (string, error)); ok { + return rf(ctx, organizationID, projectID, billingAccountID) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string, string) string); ok { + r0 = rf(ctx, organizationID, projectID, billingAccountID) + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string, string) error); ok { + r1 = rf(ctx, organizationID, projectID, billingAccountID) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockGCPClienter_EnsureProject_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EnsureProject' +type MockGCPClienter_EnsureProject_Call struct { + *mock.Call +} + +// EnsureProject is a helper method to define mock.On call +// - ctx context.Context +// - organizationID string +// - projectID string +// - billingAccountID string +func (_e *MockGCPClienter_Expecter) EnsureProject(ctx interface{}, organizationID interface{}, projectID interface{}, billingAccountID interface{}) *MockGCPClienter_EnsureProject_Call { + return &MockGCPClienter_EnsureProject_Call{Call: _e.mock.On("EnsureProject", ctx, organizationID, projectID, billingAccountID)} +} + +func (_c *MockGCPClienter_EnsureProject_Call) Run(run func(ctx context.Context, organizationID string, projectID string, billingAccountID string)) *MockGCPClienter_EnsureProject_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(string)) + }) + return _c +} + +func (_c *MockGCPClienter_EnsureProject_Call) Return(_a0 string, _a1 error) *MockGCPClienter_EnsureProject_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockGCPClienter_EnsureProject_Call) RunAndReturn(run func(context.Context, string, string, string) (string, error)) *MockGCPClienter_EnsureProject_Call { + _c.Call.Return(run) + return _c +} + +// EnsureVPCNetwork provides a mock function with given fields: ctx, projectID, networkName +func (_m *MockGCPClienter) EnsureVPCNetwork(ctx context.Context, projectID string, networkName string) error { + ret := _m.Called(ctx, projectID, networkName) + + if len(ret) == 0 { + panic("no return value specified for EnsureVPCNetwork") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok { + r0 = rf(ctx, projectID, networkName) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockGCPClienter_EnsureVPCNetwork_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EnsureVPCNetwork' +type MockGCPClienter_EnsureVPCNetwork_Call struct { + *mock.Call +} + +// EnsureVPCNetwork is a helper method to define mock.On call +// - ctx context.Context +// - projectID string +// - networkName string +func (_e *MockGCPClienter_Expecter) EnsureVPCNetwork(ctx interface{}, projectID interface{}, networkName interface{}) *MockGCPClienter_EnsureVPCNetwork_Call { + return &MockGCPClienter_EnsureVPCNetwork_Call{Call: _e.mock.On("EnsureVPCNetwork", ctx, projectID, networkName)} +} + +func (_c *MockGCPClienter_EnsureVPCNetwork_Call) Run(run func(ctx context.Context, projectID string, networkName string)) *MockGCPClienter_EnsureVPCNetwork_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *MockGCPClienter_EnsureVPCNetwork_Call) Return(_a0 error) *MockGCPClienter_EnsureVPCNetwork_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockGCPClienter_EnsureVPCNetwork_Call) RunAndReturn(run func(context.Context, string, string) error) *MockGCPClienter_EnsureVPCNetwork_Call { + _c.Call.Return(run) + return _c +} + +// GetParentString provides a mock function with given fields: +func (_m *MockGCPClienter) GetParentString() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetParentString") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// MockGCPClienter_GetParentString_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetParentString' +type MockGCPClienter_GetParentString_Call struct { + *mock.Call +} + +// GetParentString is a helper method to define mock.On call +func (_e *MockGCPClienter_Expecter) GetParentString() *MockGCPClienter_GetParentString_Call { + return &MockGCPClienter_GetParentString_Call{Call: _e.mock.On("GetParentString")} +} + +func (_c *MockGCPClienter_GetParentString_Call) Run(run func()) *MockGCPClienter_GetParentString_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockGCPClienter_GetParentString_Call) Return(_a0 string) *MockGCPClienter_GetParentString_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockGCPClienter_GetParentString_Call) RunAndReturn(run func() string) *MockGCPClienter_GetParentString_Call { + _c.Call.Return(run) + return _c +} + +// GetVMExternalIP provides a mock function with given fields: ctx, vmName, locationData +func (_m *MockGCPClienter) GetVMExternalIP(ctx context.Context, vmName string, locationData map[string]string) (string, error) { + ret := _m.Called(ctx, vmName, locationData) + + if len(ret) == 0 { + panic("no return value specified for GetVMExternalIP") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, map[string]string) (string, error)); ok { + return rf(ctx, vmName, locationData) + } + if rf, ok := ret.Get(0).(func(context.Context, string, map[string]string) string); ok { + r0 = rf(ctx, vmName, locationData) + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func(context.Context, string, map[string]string) error); ok { + r1 = rf(ctx, vmName, locationData) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockGCPClienter_GetVMExternalIP_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetVMExternalIP' +type MockGCPClienter_GetVMExternalIP_Call struct { + *mock.Call +} + +// GetVMExternalIP is a helper method to define mock.On call +// - ctx context.Context +// - vmName string +// - locationData map[string]string +func (_e *MockGCPClienter_Expecter) GetVMExternalIP(ctx interface{}, vmName interface{}, locationData interface{}) *MockGCPClienter_GetVMExternalIP_Call { + return &MockGCPClienter_GetVMExternalIP_Call{Call: _e.mock.On("GetVMExternalIP", ctx, vmName, locationData)} +} + +func (_c *MockGCPClienter_GetVMExternalIP_Call) Run(run func(ctx context.Context, vmName string, locationData map[string]string)) *MockGCPClienter_GetVMExternalIP_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(map[string]string)) + }) + return _c +} + +func (_c *MockGCPClienter_GetVMExternalIP_Call) Return(_a0 string, _a1 error) *MockGCPClienter_GetVMExternalIP_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockGCPClienter_GetVMExternalIP_Call) RunAndReturn(run func(context.Context, string, map[string]string) (string, error)) *MockGCPClienter_GetVMExternalIP_Call { + _c.Call.Return(run) + return _c +} + +// GetVMZone provides a mock function with given fields: ctx, projectID, vmName +func (_m *MockGCPClienter) GetVMZone(ctx context.Context, projectID string, vmName string) (string, error) { + ret := _m.Called(ctx, projectID, vmName) + + if len(ret) == 0 { + panic("no return value specified for GetVMZone") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) (string, error)); ok { + return rf(ctx, projectID, vmName) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string) string); ok { + r0 = rf(ctx, projectID, vmName) + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { + r1 = rf(ctx, projectID, vmName) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockGCPClienter_GetVMZone_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetVMZone' +type MockGCPClienter_GetVMZone_Call struct { + *mock.Call +} + +// GetVMZone is a helper method to define mock.On call +// - ctx context.Context +// - projectID string +// - vmName string +func (_e *MockGCPClienter_Expecter) GetVMZone(ctx interface{}, projectID interface{}, vmName interface{}) *MockGCPClienter_GetVMZone_Call { + return &MockGCPClienter_GetVMZone_Call{Call: _e.mock.On("GetVMZone", ctx, projectID, vmName)} +} + +func (_c *MockGCPClienter_GetVMZone_Call) Run(run func(ctx context.Context, projectID string, vmName string)) *MockGCPClienter_GetVMZone_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *MockGCPClienter_GetVMZone_Call) Return(_a0 string, _a1 error) *MockGCPClienter_GetVMZone_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockGCPClienter_GetVMZone_Call) RunAndReturn(run func(context.Context, string, string) (string, error)) *MockGCPClienter_GetVMZone_Call { + _c.Call.Return(run) + return _c +} + +// IsAPIEnabled provides a mock function with given fields: ctx, projectID, apiName +func (_m *MockGCPClienter) IsAPIEnabled(ctx context.Context, projectID string, apiName string) (bool, error) { + ret := _m.Called(ctx, projectID, apiName) + + if len(ret) == 0 { + panic("no return value specified for IsAPIEnabled") + } + + var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) (bool, error)); ok { + return rf(ctx, projectID, apiName) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string) bool); ok { + r0 = rf(ctx, projectID, apiName) + } else { + r0 = ret.Get(0).(bool) + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { + r1 = rf(ctx, projectID, apiName) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockGCPClienter_IsAPIEnabled_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsAPIEnabled' +type MockGCPClienter_IsAPIEnabled_Call struct { + *mock.Call +} + +// IsAPIEnabled is a helper method to define mock.On call +// - ctx context.Context +// - projectID string +// - apiName string +func (_e *MockGCPClienter_Expecter) IsAPIEnabled(ctx interface{}, projectID interface{}, apiName interface{}) *MockGCPClienter_IsAPIEnabled_Call { + return &MockGCPClienter_IsAPIEnabled_Call{Call: _e.mock.On("IsAPIEnabled", ctx, projectID, apiName)} +} + +func (_c *MockGCPClienter_IsAPIEnabled_Call) Run(run func(ctx context.Context, projectID string, apiName string)) *MockGCPClienter_IsAPIEnabled_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *MockGCPClienter_IsAPIEnabled_Call) Return(_a0 bool, _a1 error) *MockGCPClienter_IsAPIEnabled_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockGCPClienter_IsAPIEnabled_Call) RunAndReturn(run func(context.Context, string, string) (bool, error)) *MockGCPClienter_IsAPIEnabled_Call { + _c.Call.Return(run) + return _c +} + +// ListAddresses provides a mock function with given fields: ctx, projectID, region +func (_m *MockGCPClienter) ListAddresses(ctx context.Context, projectID string, region string) ([]*computepb.Address, error) { + ret := _m.Called(ctx, projectID, region) + + if len(ret) == 0 { + panic("no return value specified for ListAddresses") + } + + var r0 []*computepb.Address + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) ([]*computepb.Address, error)); ok { + return rf(ctx, projectID, region) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string) []*computepb.Address); ok { + r0 = rf(ctx, projectID, region) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*computepb.Address) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { + r1 = rf(ctx, projectID, region) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockGCPClienter_ListAddresses_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListAddresses' +type MockGCPClienter_ListAddresses_Call struct { + *mock.Call +} + +// ListAddresses is a helper method to define mock.On call +// - ctx context.Context +// - projectID string +// - region string +func (_e *MockGCPClienter_Expecter) ListAddresses(ctx interface{}, projectID interface{}, region interface{}) *MockGCPClienter_ListAddresses_Call { + return &MockGCPClienter_ListAddresses_Call{Call: _e.mock.On("ListAddresses", ctx, projectID, region)} +} + +func (_c *MockGCPClienter_ListAddresses_Call) Run(run func(ctx context.Context, projectID string, region string)) *MockGCPClienter_ListAddresses_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *MockGCPClienter_ListAddresses_Call) Return(_a0 []*computepb.Address, _a1 error) *MockGCPClienter_ListAddresses_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockGCPClienter_ListAddresses_Call) RunAndReturn(run func(context.Context, string, string) ([]*computepb.Address, error)) *MockGCPClienter_ListAddresses_Call { + _c.Call.Return(run) + return _c +} + +// ListAllAssetsInProject provides a mock function with given fields: ctx, projectID +func (_m *MockGCPClienter) ListAllAssetsInProject(ctx context.Context, projectID string) ([]*assetpb.Asset, error) { + ret := _m.Called(ctx, projectID) + + if len(ret) == 0 { + panic("no return value specified for ListAllAssetsInProject") + } + + var r0 []*assetpb.Asset + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) ([]*assetpb.Asset, error)); ok { + return rf(ctx, projectID) + } + if rf, ok := ret.Get(0).(func(context.Context, string) []*assetpb.Asset); ok { + r0 = rf(ctx, projectID) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*assetpb.Asset) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, projectID) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockGCPClienter_ListAllAssetsInProject_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListAllAssetsInProject' +type MockGCPClienter_ListAllAssetsInProject_Call struct { + *mock.Call +} + +// ListAllAssetsInProject is a helper method to define mock.On call +// - ctx context.Context +// - projectID string +func (_e *MockGCPClienter_Expecter) ListAllAssetsInProject(ctx interface{}, projectID interface{}) *MockGCPClienter_ListAllAssetsInProject_Call { + return &MockGCPClienter_ListAllAssetsInProject_Call{Call: _e.mock.On("ListAllAssetsInProject", ctx, projectID)} +} + +func (_c *MockGCPClienter_ListAllAssetsInProject_Call) Run(run func(ctx context.Context, projectID string)) *MockGCPClienter_ListAllAssetsInProject_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockGCPClienter_ListAllAssetsInProject_Call) Return(_a0 []*assetpb.Asset, _a1 error) *MockGCPClienter_ListAllAssetsInProject_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockGCPClienter_ListAllAssetsInProject_Call) RunAndReturn(run func(context.Context, string) ([]*assetpb.Asset, error)) *MockGCPClienter_ListAllAssetsInProject_Call { + _c.Call.Return(run) + return _c +} + +// ListBillingAccounts provides a mock function with given fields: ctx +func (_m *MockGCPClienter) ListBillingAccounts(ctx context.Context) ([]string, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for ListBillingAccounts") + } + + var r0 []string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) ([]string, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) []string); ok { + r0 = rf(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]string) + } + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockGCPClienter_ListBillingAccounts_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListBillingAccounts' +type MockGCPClienter_ListBillingAccounts_Call struct { + *mock.Call +} + +// ListBillingAccounts is a helper method to define mock.On call +// - ctx context.Context +func (_e *MockGCPClienter_Expecter) ListBillingAccounts(ctx interface{}) *MockGCPClienter_ListBillingAccounts_Call { + return &MockGCPClienter_ListBillingAccounts_Call{Call: _e.mock.On("ListBillingAccounts", ctx)} +} + +func (_c *MockGCPClienter_ListBillingAccounts_Call) Run(run func(ctx context.Context)) *MockGCPClienter_ListBillingAccounts_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *MockGCPClienter_ListBillingAccounts_Call) Return(_a0 []string, _a1 error) *MockGCPClienter_ListBillingAccounts_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockGCPClienter_ListBillingAccounts_Call) RunAndReturn(run func(context.Context) ([]string, error)) *MockGCPClienter_ListBillingAccounts_Call { + _c.Call.Return(run) + return _c +} + +// ListProjects provides a mock function with given fields: ctx, req +func (_m *MockGCPClienter) ListProjects(ctx context.Context, req *resourcemanagerpb.ListProjectsRequest) ([]*resourcemanagerpb.Project, error) { + ret := _m.Called(ctx, req) + + if len(ret) == 0 { + panic("no return value specified for ListProjects") + } + + var r0 []*resourcemanagerpb.Project + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *resourcemanagerpb.ListProjectsRequest) ([]*resourcemanagerpb.Project, error)); ok { + return rf(ctx, req) + } + if rf, ok := ret.Get(0).(func(context.Context, *resourcemanagerpb.ListProjectsRequest) []*resourcemanagerpb.Project); ok { + r0 = rf(ctx, req) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*resourcemanagerpb.Project) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *resourcemanagerpb.ListProjectsRequest) error); ok { + r1 = rf(ctx, req) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockGCPClienter_ListProjects_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListProjects' +type MockGCPClienter_ListProjects_Call struct { + *mock.Call +} + +// ListProjects is a helper method to define mock.On call +// - ctx context.Context +// - req *resourcemanagerpb.ListProjectsRequest +func (_e *MockGCPClienter_Expecter) ListProjects(ctx interface{}, req interface{}) *MockGCPClienter_ListProjects_Call { + return &MockGCPClienter_ListProjects_Call{Call: _e.mock.On("ListProjects", ctx, req)} +} + +func (_c *MockGCPClienter_ListProjects_Call) Run(run func(ctx context.Context, req *resourcemanagerpb.ListProjectsRequest)) *MockGCPClienter_ListProjects_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*resourcemanagerpb.ListProjectsRequest)) + }) + return _c +} + +func (_c *MockGCPClienter_ListProjects_Call) Return(_a0 []*resourcemanagerpb.Project, _a1 error) *MockGCPClienter_ListProjects_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockGCPClienter_ListProjects_Call) RunAndReturn(run func(context.Context, *resourcemanagerpb.ListProjectsRequest) ([]*resourcemanagerpb.Project, error)) *MockGCPClienter_ListProjects_Call { + _c.Call.Return(run) + return _c +} + +// ProjectExists provides a mock function with given fields: ctx, projectID +func (_m *MockGCPClienter) ProjectExists(ctx context.Context, projectID string) (bool, error) { + ret := _m.Called(ctx, projectID) + + if len(ret) == 0 { + panic("no return value specified for ProjectExists") + } + + var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (bool, error)); ok { + return rf(ctx, projectID) + } + if rf, ok := ret.Get(0).(func(context.Context, string) bool); ok { + r0 = rf(ctx, projectID) + } else { + r0 = ret.Get(0).(bool) + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, projectID) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockGCPClienter_ProjectExists_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ProjectExists' +type MockGCPClienter_ProjectExists_Call struct { + *mock.Call +} + +// ProjectExists is a helper method to define mock.On call +// - ctx context.Context +// - projectID string +func (_e *MockGCPClienter_Expecter) ProjectExists(ctx interface{}, projectID interface{}) *MockGCPClienter_ProjectExists_Call { + return &MockGCPClienter_ProjectExists_Call{Call: _e.mock.On("ProjectExists", ctx, projectID)} +} + +func (_c *MockGCPClienter_ProjectExists_Call) Run(run func(ctx context.Context, projectID string)) *MockGCPClienter_ProjectExists_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockGCPClienter_ProjectExists_Call) Return(_a0 bool, _a1 error) *MockGCPClienter_ProjectExists_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockGCPClienter_ProjectExists_Call) RunAndReturn(run func(context.Context, string) (bool, error)) *MockGCPClienter_ProjectExists_Call { + _c.Call.Return(run) + return _c +} + +// SetBillingAccount provides a mock function with given fields: ctx, projectID, billingAccountID +func (_m *MockGCPClienter) SetBillingAccount(ctx context.Context, projectID string, billingAccountID string) error { + ret := _m.Called(ctx, projectID, billingAccountID) + + if len(ret) == 0 { + panic("no return value specified for SetBillingAccount") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok { + r0 = rf(ctx, projectID, billingAccountID) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockGCPClienter_SetBillingAccount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetBillingAccount' +type MockGCPClienter_SetBillingAccount_Call struct { + *mock.Call +} + +// SetBillingAccount is a helper method to define mock.On call +// - ctx context.Context +// - projectID string +// - billingAccountID string +func (_e *MockGCPClienter_Expecter) SetBillingAccount(ctx interface{}, projectID interface{}, billingAccountID interface{}) *MockGCPClienter_SetBillingAccount_Call { + return &MockGCPClienter_SetBillingAccount_Call{Call: _e.mock.On("SetBillingAccount", ctx, projectID, billingAccountID)} +} + +func (_c *MockGCPClienter_SetBillingAccount_Call) Run(run func(ctx context.Context, projectID string, billingAccountID string)) *MockGCPClienter_SetBillingAccount_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *MockGCPClienter_SetBillingAccount_Call) Return(_a0 error) *MockGCPClienter_SetBillingAccount_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockGCPClienter_SetBillingAccount_Call) RunAndReturn(run func(context.Context, string, string) error) *MockGCPClienter_SetBillingAccount_Call { + _c.Call.Return(run) + return _c +} + +// SetParentString provides a mock function with given fields: organizationID +func (_m *MockGCPClienter) SetParentString(organizationID string) { + _m.Called(organizationID) +} + +// MockGCPClienter_SetParentString_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetParentString' +type MockGCPClienter_SetParentString_Call struct { + *mock.Call +} + +// SetParentString is a helper method to define mock.On call +// - organizationID string +func (_e *MockGCPClienter_Expecter) SetParentString(organizationID interface{}) *MockGCPClienter_SetParentString_Call { + return &MockGCPClienter_SetParentString_Call{Call: _e.mock.On("SetParentString", organizationID)} +} + +func (_c *MockGCPClienter_SetParentString_Call) Run(run func(organizationID string)) *MockGCPClienter_SetParentString_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *MockGCPClienter_SetParentString_Call) Return() *MockGCPClienter_SetParentString_Call { + _c.Call.Return() + return _c +} + +func (_c *MockGCPClienter_SetParentString_Call) RunAndReturn(run func(string)) *MockGCPClienter_SetParentString_Call { + _c.Call.Return(run) + return _c +} + +// StartResourcePolling provides a mock function with given fields: ctx +func (_m *MockGCPClienter) StartResourcePolling(ctx context.Context) error { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for StartResourcePolling") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context) error); ok { + r0 = rf(ctx) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockGCPClienter_StartResourcePolling_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StartResourcePolling' +type MockGCPClienter_StartResourcePolling_Call struct { + *mock.Call +} + +// StartResourcePolling is a helper method to define mock.On call +// - ctx context.Context +func (_e *MockGCPClienter_Expecter) StartResourcePolling(ctx interface{}) *MockGCPClienter_StartResourcePolling_Call { + return &MockGCPClienter_StartResourcePolling_Call{Call: _e.mock.On("StartResourcePolling", ctx)} +} + +func (_c *MockGCPClienter_StartResourcePolling_Call) Run(run func(ctx context.Context)) *MockGCPClienter_StartResourcePolling_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *MockGCPClienter_StartResourcePolling_Call) Return(_a0 error) *MockGCPClienter_StartResourcePolling_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockGCPClienter_StartResourcePolling_Call) RunAndReturn(run func(context.Context) error) *MockGCPClienter_StartResourcePolling_Call { + _c.Call.Return(run) + return _c +} + +// ValidateMachineType provides a mock function with given fields: ctx, projectID, machineType, location +func (_m *MockGCPClienter) ValidateMachineType(ctx context.Context, projectID string, machineType string, location string) (bool, error) { + ret := _m.Called(ctx, projectID, machineType, location) + + if len(ret) == 0 { + panic("no return value specified for ValidateMachineType") + } + + var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string) (bool, error)); ok { + return rf(ctx, projectID, machineType, location) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string, string) bool); ok { + r0 = rf(ctx, projectID, machineType, location) + } else { + r0 = ret.Get(0).(bool) + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string, string) error); ok { + r1 = rf(ctx, projectID, machineType, location) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockGCPClienter_ValidateMachineType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ValidateMachineType' +type MockGCPClienter_ValidateMachineType_Call struct { + *mock.Call +} + +// ValidateMachineType is a helper method to define mock.On call +// - ctx context.Context +// - projectID string +// - machineType string +// - location string +func (_e *MockGCPClienter_Expecter) ValidateMachineType(ctx interface{}, projectID interface{}, machineType interface{}, location interface{}) *MockGCPClienter_ValidateMachineType_Call { + return &MockGCPClienter_ValidateMachineType_Call{Call: _e.mock.On("ValidateMachineType", ctx, projectID, machineType, location)} +} + +func (_c *MockGCPClienter_ValidateMachineType_Call) Run(run func(ctx context.Context, projectID string, machineType string, location string)) *MockGCPClienter_ValidateMachineType_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(string)) + }) + return _c +} + +func (_c *MockGCPClienter_ValidateMachineType_Call) Return(_a0 bool, _a1 error) *MockGCPClienter_ValidateMachineType_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockGCPClienter_ValidateMachineType_Call) RunAndReturn(run func(context.Context, string, string, string) (bool, error)) *MockGCPClienter_ValidateMachineType_Call { + _c.Call.Return(run) + return _c +} + +// NewMockGCPClienter creates a new instance of MockGCPClienter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockGCPClienter(t interface { + mock.TestingT + Cleanup(func()) +}) *MockGCPClienter { + mock := &MockGCPClienter{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/pkg/models/interfaces/aws/mocks/sshutils/mock_SFTPClientCreator.go b/pkg/models/interfaces/aws/mocks/sshutils/mock_SFTPClientCreator.go new file mode 100644 index 00000000..5fde916e --- /dev/null +++ b/pkg/models/interfaces/aws/mocks/sshutils/mock_SFTPClientCreator.go @@ -0,0 +1,95 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package sshutils + +import ( + sftp "github.com/pkg/sftp" + mock "github.com/stretchr/testify/mock" + + sshutils "github.com/bacalhau-project/andaime/pkg/models/interfaces/sshutils" +) + +// MockSFTPClientCreator is an autogenerated mock type for the SFTPClientCreator type +type MockSFTPClientCreator struct { + mock.Mock +} + +type MockSFTPClientCreator_Expecter struct { + mock *mock.Mock +} + +func (_m *MockSFTPClientCreator) EXPECT() *MockSFTPClientCreator_Expecter { + return &MockSFTPClientCreator_Expecter{mock: &_m.Mock} +} + +// NewSFTPClient provides a mock function with given fields: client +func (_m *MockSFTPClientCreator) NewSFTPClient(client sshutils.SSHClienter) (*sftp.Client, error) { + ret := _m.Called(client) + + if len(ret) == 0 { + panic("no return value specified for NewSFTPClient") + } + + var r0 *sftp.Client + var r1 error + if rf, ok := ret.Get(0).(func(sshutils.SSHClienter) (*sftp.Client, error)); ok { + return rf(client) + } + if rf, ok := ret.Get(0).(func(sshutils.SSHClienter) *sftp.Client); ok { + r0 = rf(client) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*sftp.Client) + } + } + + if rf, ok := ret.Get(1).(func(sshutils.SSHClienter) error); ok { + r1 = rf(client) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockSFTPClientCreator_NewSFTPClient_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewSFTPClient' +type MockSFTPClientCreator_NewSFTPClient_Call struct { + *mock.Call +} + +// NewSFTPClient is a helper method to define mock.On call +// - client sshutils.SSHClienter +func (_e *MockSFTPClientCreator_Expecter) NewSFTPClient(client interface{}) *MockSFTPClientCreator_NewSFTPClient_Call { + return &MockSFTPClientCreator_NewSFTPClient_Call{Call: _e.mock.On("NewSFTPClient", client)} +} + +func (_c *MockSFTPClientCreator_NewSFTPClient_Call) Run(run func(client sshutils.SSHClienter)) *MockSFTPClientCreator_NewSFTPClient_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(sshutils.SSHClienter)) + }) + return _c +} + +func (_c *MockSFTPClientCreator_NewSFTPClient_Call) Return(_a0 *sftp.Client, _a1 error) *MockSFTPClientCreator_NewSFTPClient_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockSFTPClientCreator_NewSFTPClient_Call) RunAndReturn(run func(sshutils.SSHClienter) (*sftp.Client, error)) *MockSFTPClientCreator_NewSFTPClient_Call { + _c.Call.Return(run) + return _c +} + +// NewMockSFTPClientCreator creates a new instance of MockSFTPClientCreator. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockSFTPClientCreator(t interface { + mock.TestingT + Cleanup(func()) +}) *MockSFTPClientCreator { + mock := &MockSFTPClientCreator{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/pkg/models/interfaces/aws/mocks/sshutils/mock_SFTPClienter.go b/pkg/models/interfaces/aws/mocks/sshutils/mock_SFTPClienter.go new file mode 100644 index 00000000..5356c02c --- /dev/null +++ b/pkg/models/interfaces/aws/mocks/sshutils/mock_SFTPClienter.go @@ -0,0 +1,291 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package sshutils + +import ( + io "io" + fs "io/fs" + + mock "github.com/stretchr/testify/mock" +) + +// MockSFTPClienter is an autogenerated mock type for the SFTPClienter type +type MockSFTPClienter struct { + mock.Mock +} + +type MockSFTPClienter_Expecter struct { + mock *mock.Mock +} + +func (_m *MockSFTPClienter) EXPECT() *MockSFTPClienter_Expecter { + return &MockSFTPClienter_Expecter{mock: &_m.Mock} +} + +// Chmod provides a mock function with given fields: _a0, _a1 +func (_m *MockSFTPClienter) Chmod(_a0 string, _a1 fs.FileMode) error { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for Chmod") + } + + var r0 error + if rf, ok := ret.Get(0).(func(string, fs.FileMode) error); ok { + r0 = rf(_a0, _a1) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockSFTPClienter_Chmod_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Chmod' +type MockSFTPClienter_Chmod_Call struct { + *mock.Call +} + +// Chmod is a helper method to define mock.On call +// - _a0 string +// - _a1 fs.FileMode +func (_e *MockSFTPClienter_Expecter) Chmod(_a0 interface{}, _a1 interface{}) *MockSFTPClienter_Chmod_Call { + return &MockSFTPClienter_Chmod_Call{Call: _e.mock.On("Chmod", _a0, _a1)} +} + +func (_c *MockSFTPClienter_Chmod_Call) Run(run func(_a0 string, _a1 fs.FileMode)) *MockSFTPClienter_Chmod_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(fs.FileMode)) + }) + return _c +} + +func (_c *MockSFTPClienter_Chmod_Call) Return(_a0 error) *MockSFTPClienter_Chmod_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSFTPClienter_Chmod_Call) RunAndReturn(run func(string, fs.FileMode) error) *MockSFTPClienter_Chmod_Call { + _c.Call.Return(run) + return _c +} + +// Close provides a mock function with given fields: +func (_m *MockSFTPClienter) Close() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Close") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockSFTPClienter_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type MockSFTPClienter_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *MockSFTPClienter_Expecter) Close() *MockSFTPClienter_Close_Call { + return &MockSFTPClienter_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *MockSFTPClienter_Close_Call) Run(run func()) *MockSFTPClienter_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSFTPClienter_Close_Call) Return(_a0 error) *MockSFTPClienter_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSFTPClienter_Close_Call) RunAndReturn(run func() error) *MockSFTPClienter_Close_Call { + _c.Call.Return(run) + return _c +} + +// Create provides a mock function with given fields: _a0 +func (_m *MockSFTPClienter) Create(_a0 string) (io.WriteCloser, error) { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for Create") + } + + var r0 io.WriteCloser + var r1 error + if rf, ok := ret.Get(0).(func(string) (io.WriteCloser, error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(string) io.WriteCloser); ok { + r0 = rf(_a0) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(io.WriteCloser) + } + } + + if rf, ok := ret.Get(1).(func(string) error); ok { + r1 = rf(_a0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockSFTPClienter_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' +type MockSFTPClienter_Create_Call struct { + *mock.Call +} + +// Create is a helper method to define mock.On call +// - _a0 string +func (_e *MockSFTPClienter_Expecter) Create(_a0 interface{}) *MockSFTPClienter_Create_Call { + return &MockSFTPClienter_Create_Call{Call: _e.mock.On("Create", _a0)} +} + +func (_c *MockSFTPClienter_Create_Call) Run(run func(_a0 string)) *MockSFTPClienter_Create_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *MockSFTPClienter_Create_Call) Return(_a0 io.WriteCloser, _a1 error) *MockSFTPClienter_Create_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockSFTPClienter_Create_Call) RunAndReturn(run func(string) (io.WriteCloser, error)) *MockSFTPClienter_Create_Call { + _c.Call.Return(run) + return _c +} + +// MkdirAll provides a mock function with given fields: _a0 +func (_m *MockSFTPClienter) MkdirAll(_a0 string) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for MkdirAll") + } + + var r0 error + if rf, ok := ret.Get(0).(func(string) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockSFTPClienter_MkdirAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MkdirAll' +type MockSFTPClienter_MkdirAll_Call struct { + *mock.Call +} + +// MkdirAll is a helper method to define mock.On call +// - _a0 string +func (_e *MockSFTPClienter_Expecter) MkdirAll(_a0 interface{}) *MockSFTPClienter_MkdirAll_Call { + return &MockSFTPClienter_MkdirAll_Call{Call: _e.mock.On("MkdirAll", _a0)} +} + +func (_c *MockSFTPClienter_MkdirAll_Call) Run(run func(_a0 string)) *MockSFTPClienter_MkdirAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *MockSFTPClienter_MkdirAll_Call) Return(_a0 error) *MockSFTPClienter_MkdirAll_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSFTPClienter_MkdirAll_Call) RunAndReturn(run func(string) error) *MockSFTPClienter_MkdirAll_Call { + _c.Call.Return(run) + return _c +} + +// Open provides a mock function with given fields: _a0 +func (_m *MockSFTPClienter) Open(_a0 string) (io.ReadCloser, error) { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for Open") + } + + var r0 io.ReadCloser + var r1 error + if rf, ok := ret.Get(0).(func(string) (io.ReadCloser, error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(string) io.ReadCloser); ok { + r0 = rf(_a0) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(io.ReadCloser) + } + } + + if rf, ok := ret.Get(1).(func(string) error); ok { + r1 = rf(_a0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockSFTPClienter_Open_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Open' +type MockSFTPClienter_Open_Call struct { + *mock.Call +} + +// Open is a helper method to define mock.On call +// - _a0 string +func (_e *MockSFTPClienter_Expecter) Open(_a0 interface{}) *MockSFTPClienter_Open_Call { + return &MockSFTPClienter_Open_Call{Call: _e.mock.On("Open", _a0)} +} + +func (_c *MockSFTPClienter_Open_Call) Run(run func(_a0 string)) *MockSFTPClienter_Open_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *MockSFTPClienter_Open_Call) Return(_a0 io.ReadCloser, _a1 error) *MockSFTPClienter_Open_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockSFTPClienter_Open_Call) RunAndReturn(run func(string) (io.ReadCloser, error)) *MockSFTPClienter_Open_Call { + _c.Call.Return(run) + return _c +} + +// NewMockSFTPClienter creates a new instance of MockSFTPClienter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockSFTPClienter(t interface { + mock.TestingT + Cleanup(func()) +}) *MockSFTPClienter { + mock := &MockSFTPClienter{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/pkg/models/interfaces/aws/mocks/sshutils/mock_SFTPFile.go b/pkg/models/interfaces/aws/mocks/sshutils/mock_SFTPFile.go new file mode 100644 index 00000000..50435c57 --- /dev/null +++ b/pkg/models/interfaces/aws/mocks/sshutils/mock_SFTPFile.go @@ -0,0 +1,133 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package sshutils + +import mock "github.com/stretchr/testify/mock" + +// MockSFTPFile is an autogenerated mock type for the SFTPFile type +type MockSFTPFile struct { + mock.Mock +} + +type MockSFTPFile_Expecter struct { + mock *mock.Mock +} + +func (_m *MockSFTPFile) EXPECT() *MockSFTPFile_Expecter { + return &MockSFTPFile_Expecter{mock: &_m.Mock} +} + +// Close provides a mock function with given fields: +func (_m *MockSFTPFile) Close() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Close") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockSFTPFile_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type MockSFTPFile_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *MockSFTPFile_Expecter) Close() *MockSFTPFile_Close_Call { + return &MockSFTPFile_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *MockSFTPFile_Close_Call) Run(run func()) *MockSFTPFile_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSFTPFile_Close_Call) Return(_a0 error) *MockSFTPFile_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSFTPFile_Close_Call) RunAndReturn(run func() error) *MockSFTPFile_Close_Call { + _c.Call.Return(run) + return _c +} + +// Write provides a mock function with given fields: p +func (_m *MockSFTPFile) Write(p []byte) (int, error) { + ret := _m.Called(p) + + if len(ret) == 0 { + panic("no return value specified for Write") + } + + var r0 int + var r1 error + if rf, ok := ret.Get(0).(func([]byte) (int, error)); ok { + return rf(p) + } + if rf, ok := ret.Get(0).(func([]byte) int); ok { + r0 = rf(p) + } else { + r0 = ret.Get(0).(int) + } + + if rf, ok := ret.Get(1).(func([]byte) error); ok { + r1 = rf(p) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockSFTPFile_Write_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Write' +type MockSFTPFile_Write_Call struct { + *mock.Call +} + +// Write is a helper method to define mock.On call +// - p []byte +func (_e *MockSFTPFile_Expecter) Write(p interface{}) *MockSFTPFile_Write_Call { + return &MockSFTPFile_Write_Call{Call: _e.mock.On("Write", p)} +} + +func (_c *MockSFTPFile_Write_Call) Run(run func(p []byte)) *MockSFTPFile_Write_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]byte)) + }) + return _c +} + +func (_c *MockSFTPFile_Write_Call) Return(n int, err error) *MockSFTPFile_Write_Call { + _c.Call.Return(n, err) + return _c +} + +func (_c *MockSFTPFile_Write_Call) RunAndReturn(run func([]byte) (int, error)) *MockSFTPFile_Write_Call { + _c.Call.Return(run) + return _c +} + +// NewMockSFTPFile creates a new instance of MockSFTPFile. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockSFTPFile(t interface { + mock.TestingT + Cleanup(func()) +}) *MockSFTPFile { + mock := &MockSFTPFile{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/pkg/models/interfaces/aws/mocks/sshutils/mock_SSHClientCreator.go b/pkg/models/interfaces/aws/mocks/sshutils/mock_SSHClientCreator.go new file mode 100644 index 00000000..e965f233 --- /dev/null +++ b/pkg/models/interfaces/aws/mocks/sshutils/mock_SSHClientCreator.go @@ -0,0 +1,99 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package sshutils + +import ( + mock "github.com/stretchr/testify/mock" + ssh "golang.org/x/crypto/ssh" + + sshutils "github.com/bacalhau-project/andaime/pkg/models/interfaces/sshutils" +) + +// MockSSHClientCreator is an autogenerated mock type for the SSHClientCreator type +type MockSSHClientCreator struct { + mock.Mock +} + +type MockSSHClientCreator_Expecter struct { + mock *mock.Mock +} + +func (_m *MockSSHClientCreator) EXPECT() *MockSSHClientCreator_Expecter { + return &MockSSHClientCreator_Expecter{mock: &_m.Mock} +} + +// NewClient provides a mock function with given fields: host, port, user, privateKeyPath, config +func (_m *MockSSHClientCreator) NewClient(host string, port int, user string, privateKeyPath string, config *ssh.ClientConfig) (sshutils.SSHClienter, error) { + ret := _m.Called(host, port, user, privateKeyPath, config) + + if len(ret) == 0 { + panic("no return value specified for NewClient") + } + + var r0 sshutils.SSHClienter + var r1 error + if rf, ok := ret.Get(0).(func(string, int, string, string, *ssh.ClientConfig) (sshutils.SSHClienter, error)); ok { + return rf(host, port, user, privateKeyPath, config) + } + if rf, ok := ret.Get(0).(func(string, int, string, string, *ssh.ClientConfig) sshutils.SSHClienter); ok { + r0 = rf(host, port, user, privateKeyPath, config) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(sshutils.SSHClienter) + } + } + + if rf, ok := ret.Get(1).(func(string, int, string, string, *ssh.ClientConfig) error); ok { + r1 = rf(host, port, user, privateKeyPath, config) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockSSHClientCreator_NewClient_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewClient' +type MockSSHClientCreator_NewClient_Call struct { + *mock.Call +} + +// NewClient is a helper method to define mock.On call +// - host string +// - port int +// - user string +// - privateKeyPath string +// - config *ssh.ClientConfig +func (_e *MockSSHClientCreator_Expecter) NewClient(host interface{}, port interface{}, user interface{}, privateKeyPath interface{}, config interface{}) *MockSSHClientCreator_NewClient_Call { + return &MockSSHClientCreator_NewClient_Call{Call: _e.mock.On("NewClient", host, port, user, privateKeyPath, config)} +} + +func (_c *MockSSHClientCreator_NewClient_Call) Run(run func(host string, port int, user string, privateKeyPath string, config *ssh.ClientConfig)) *MockSSHClientCreator_NewClient_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(int), args[2].(string), args[3].(string), args[4].(*ssh.ClientConfig)) + }) + return _c +} + +func (_c *MockSSHClientCreator_NewClient_Call) Return(_a0 sshutils.SSHClienter, _a1 error) *MockSSHClientCreator_NewClient_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockSSHClientCreator_NewClient_Call) RunAndReturn(run func(string, int, string, string, *ssh.ClientConfig) (sshutils.SSHClienter, error)) *MockSSHClientCreator_NewClient_Call { + _c.Call.Return(run) + return _c +} + +// NewMockSSHClientCreator creates a new instance of MockSSHClientCreator. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockSSHClientCreator(t interface { + mock.TestingT + Cleanup(func()) +}) *MockSSHClientCreator { + mock := &MockSSHClientCreator{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/pkg/models/interfaces/aws/mocks/sshutils/mock_SSHClienter.go b/pkg/models/interfaces/aws/mocks/sshutils/mock_SSHClienter.go new file mode 100644 index 00000000..552a006f --- /dev/null +++ b/pkg/models/interfaces/aws/mocks/sshutils/mock_SSHClienter.go @@ -0,0 +1,288 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package sshutils + +import ( + mock "github.com/stretchr/testify/mock" + ssh "golang.org/x/crypto/ssh" + + sshutils "github.com/bacalhau-project/andaime/pkg/models/interfaces/sshutils" +) + +// MockSSHClienter is an autogenerated mock type for the SSHClienter type +type MockSSHClienter struct { + mock.Mock +} + +type MockSSHClienter_Expecter struct { + mock *mock.Mock +} + +func (_m *MockSSHClienter) EXPECT() *MockSSHClienter_Expecter { + return &MockSSHClienter_Expecter{mock: &_m.Mock} +} + +// Close provides a mock function with given fields: +func (_m *MockSSHClienter) Close() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Close") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockSSHClienter_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type MockSSHClienter_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *MockSSHClienter_Expecter) Close() *MockSSHClienter_Close_Call { + return &MockSSHClienter_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *MockSSHClienter_Close_Call) Run(run func()) *MockSSHClienter_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSSHClienter_Close_Call) Return(_a0 error) *MockSSHClienter_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHClienter_Close_Call) RunAndReturn(run func() error) *MockSSHClienter_Close_Call { + _c.Call.Return(run) + return _c +} + +// Connect provides a mock function with given fields: +func (_m *MockSSHClienter) Connect() (sshutils.SSHClienter, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Connect") + } + + var r0 sshutils.SSHClienter + var r1 error + if rf, ok := ret.Get(0).(func() (sshutils.SSHClienter, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() sshutils.SSHClienter); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(sshutils.SSHClienter) + } + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockSSHClienter_Connect_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Connect' +type MockSSHClienter_Connect_Call struct { + *mock.Call +} + +// Connect is a helper method to define mock.On call +func (_e *MockSSHClienter_Expecter) Connect() *MockSSHClienter_Connect_Call { + return &MockSSHClienter_Connect_Call{Call: _e.mock.On("Connect")} +} + +func (_c *MockSSHClienter_Connect_Call) Run(run func()) *MockSSHClienter_Connect_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSSHClienter_Connect_Call) Return(_a0 sshutils.SSHClienter, _a1 error) *MockSSHClienter_Connect_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockSSHClienter_Connect_Call) RunAndReturn(run func() (sshutils.SSHClienter, error)) *MockSSHClienter_Connect_Call { + _c.Call.Return(run) + return _c +} + +// GetClient provides a mock function with given fields: +func (_m *MockSSHClienter) GetClient() *ssh.Client { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetClient") + } + + var r0 *ssh.Client + if rf, ok := ret.Get(0).(func() *ssh.Client); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ssh.Client) + } + } + + return r0 +} + +// MockSSHClienter_GetClient_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetClient' +type MockSSHClienter_GetClient_Call struct { + *mock.Call +} + +// GetClient is a helper method to define mock.On call +func (_e *MockSSHClienter_Expecter) GetClient() *MockSSHClienter_GetClient_Call { + return &MockSSHClienter_GetClient_Call{Call: _e.mock.On("GetClient")} +} + +func (_c *MockSSHClienter_GetClient_Call) Run(run func()) *MockSSHClienter_GetClient_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSSHClienter_GetClient_Call) Return(_a0 *ssh.Client) *MockSSHClienter_GetClient_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHClienter_GetClient_Call) RunAndReturn(run func() *ssh.Client) *MockSSHClienter_GetClient_Call { + _c.Call.Return(run) + return _c +} + +// IsConnected provides a mock function with given fields: +func (_m *MockSSHClienter) IsConnected() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for IsConnected") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// MockSSHClienter_IsConnected_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsConnected' +type MockSSHClienter_IsConnected_Call struct { + *mock.Call +} + +// IsConnected is a helper method to define mock.On call +func (_e *MockSSHClienter_Expecter) IsConnected() *MockSSHClienter_IsConnected_Call { + return &MockSSHClienter_IsConnected_Call{Call: _e.mock.On("IsConnected")} +} + +func (_c *MockSSHClienter_IsConnected_Call) Run(run func()) *MockSSHClienter_IsConnected_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSSHClienter_IsConnected_Call) Return(_a0 bool) *MockSSHClienter_IsConnected_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHClienter_IsConnected_Call) RunAndReturn(run func() bool) *MockSSHClienter_IsConnected_Call { + _c.Call.Return(run) + return _c +} + +// NewSession provides a mock function with given fields: +func (_m *MockSSHClienter) NewSession() (sshutils.SSHSessioner, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for NewSession") + } + + var r0 sshutils.SSHSessioner + var r1 error + if rf, ok := ret.Get(0).(func() (sshutils.SSHSessioner, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() sshutils.SSHSessioner); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(sshutils.SSHSessioner) + } + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockSSHClienter_NewSession_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewSession' +type MockSSHClienter_NewSession_Call struct { + *mock.Call +} + +// NewSession is a helper method to define mock.On call +func (_e *MockSSHClienter_Expecter) NewSession() *MockSSHClienter_NewSession_Call { + return &MockSSHClienter_NewSession_Call{Call: _e.mock.On("NewSession")} +} + +func (_c *MockSSHClienter_NewSession_Call) Run(run func()) *MockSSHClienter_NewSession_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSSHClienter_NewSession_Call) Return(_a0 sshutils.SSHSessioner, _a1 error) *MockSSHClienter_NewSession_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockSSHClienter_NewSession_Call) RunAndReturn(run func() (sshutils.SSHSessioner, error)) *MockSSHClienter_NewSession_Call { + _c.Call.Return(run) + return _c +} + +// NewMockSSHClienter creates a new instance of MockSSHClienter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockSSHClienter(t interface { + mock.TestingT + Cleanup(func()) +}) *MockSSHClienter { + mock := &MockSSHClienter{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/pkg/models/interfaces/aws/mocks/sshutils/mock_SSHConfiger.go b/pkg/models/interfaces/aws/mocks/sshutils/mock_SSHConfiger.go new file mode 100644 index 00000000..4a57c1ab --- /dev/null +++ b/pkg/models/interfaces/aws/mocks/sshutils/mock_SSHConfiger.go @@ -0,0 +1,1067 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package sshutils + +import ( + context "context" + + mock "github.com/stretchr/testify/mock" + ssh "golang.org/x/crypto/ssh" + + sshutils "github.com/bacalhau-project/andaime/pkg/models/interfaces/sshutils" + + time "time" +) + +// MockSSHConfiger is an autogenerated mock type for the SSHConfiger type +type MockSSHConfiger struct { + mock.Mock +} + +type MockSSHConfiger_Expecter struct { + mock *mock.Mock +} + +func (_m *MockSSHConfiger) EXPECT() *MockSSHConfiger_Expecter { + return &MockSSHConfiger_Expecter{mock: &_m.Mock} +} + +// Close provides a mock function with given fields: +func (_m *MockSSHConfiger) Close() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Close") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockSSHConfiger_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type MockSSHConfiger_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *MockSSHConfiger_Expecter) Close() *MockSSHConfiger_Close_Call { + return &MockSSHConfiger_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *MockSSHConfiger_Close_Call) Run(run func()) *MockSSHConfiger_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSSHConfiger_Close_Call) Return(_a0 error) *MockSSHConfiger_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHConfiger_Close_Call) RunAndReturn(run func() error) *MockSSHConfiger_Close_Call { + _c.Call.Return(run) + return _c +} + +// Connect provides a mock function with given fields: +func (_m *MockSSHConfiger) Connect() (sshutils.SSHClienter, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Connect") + } + + var r0 sshutils.SSHClienter + var r1 error + if rf, ok := ret.Get(0).(func() (sshutils.SSHClienter, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() sshutils.SSHClienter); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(sshutils.SSHClienter) + } + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockSSHConfiger_Connect_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Connect' +type MockSSHConfiger_Connect_Call struct { + *mock.Call +} + +// Connect is a helper method to define mock.On call +func (_e *MockSSHConfiger_Expecter) Connect() *MockSSHConfiger_Connect_Call { + return &MockSSHConfiger_Connect_Call{Call: _e.mock.On("Connect")} +} + +func (_c *MockSSHConfiger_Connect_Call) Run(run func()) *MockSSHConfiger_Connect_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSSHConfiger_Connect_Call) Return(_a0 sshutils.SSHClienter, _a1 error) *MockSSHConfiger_Connect_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockSSHConfiger_Connect_Call) RunAndReturn(run func() (sshutils.SSHClienter, error)) *MockSSHConfiger_Connect_Call { + _c.Call.Return(run) + return _c +} + +// ExecuteCommand provides a mock function with given fields: ctx, command +func (_m *MockSSHConfiger) ExecuteCommand(ctx context.Context, command string) (string, error) { + ret := _m.Called(ctx, command) + + if len(ret) == 0 { + panic("no return value specified for ExecuteCommand") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (string, error)); ok { + return rf(ctx, command) + } + if rf, ok := ret.Get(0).(func(context.Context, string) string); ok { + r0 = rf(ctx, command) + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, command) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockSSHConfiger_ExecuteCommand_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExecuteCommand' +type MockSSHConfiger_ExecuteCommand_Call struct { + *mock.Call +} + +// ExecuteCommand is a helper method to define mock.On call +// - ctx context.Context +// - command string +func (_e *MockSSHConfiger_Expecter) ExecuteCommand(ctx interface{}, command interface{}) *MockSSHConfiger_ExecuteCommand_Call { + return &MockSSHConfiger_ExecuteCommand_Call{Call: _e.mock.On("ExecuteCommand", ctx, command)} +} + +func (_c *MockSSHConfiger_ExecuteCommand_Call) Run(run func(ctx context.Context, command string)) *MockSSHConfiger_ExecuteCommand_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockSSHConfiger_ExecuteCommand_Call) Return(_a0 string, _a1 error) *MockSSHConfiger_ExecuteCommand_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockSSHConfiger_ExecuteCommand_Call) RunAndReturn(run func(context.Context, string) (string, error)) *MockSSHConfiger_ExecuteCommand_Call { + _c.Call.Return(run) + return _c +} + +// ExecuteCommandWithCallback provides a mock function with given fields: ctx, command, callback +func (_m *MockSSHConfiger) ExecuteCommandWithCallback(ctx context.Context, command string, callback func(string)) (string, error) { + ret := _m.Called(ctx, command, callback) + + if len(ret) == 0 { + panic("no return value specified for ExecuteCommandWithCallback") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, func(string)) (string, error)); ok { + return rf(ctx, command, callback) + } + if rf, ok := ret.Get(0).(func(context.Context, string, func(string)) string); ok { + r0 = rf(ctx, command, callback) + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func(context.Context, string, func(string)) error); ok { + r1 = rf(ctx, command, callback) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockSSHConfiger_ExecuteCommandWithCallback_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExecuteCommandWithCallback' +type MockSSHConfiger_ExecuteCommandWithCallback_Call struct { + *mock.Call +} + +// ExecuteCommandWithCallback is a helper method to define mock.On call +// - ctx context.Context +// - command string +// - callback func(string) +func (_e *MockSSHConfiger_Expecter) ExecuteCommandWithCallback(ctx interface{}, command interface{}, callback interface{}) *MockSSHConfiger_ExecuteCommandWithCallback_Call { + return &MockSSHConfiger_ExecuteCommandWithCallback_Call{Call: _e.mock.On("ExecuteCommandWithCallback", ctx, command, callback)} +} + +func (_c *MockSSHConfiger_ExecuteCommandWithCallback_Call) Run(run func(ctx context.Context, command string, callback func(string))) *MockSSHConfiger_ExecuteCommandWithCallback_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(func(string))) + }) + return _c +} + +func (_c *MockSSHConfiger_ExecuteCommandWithCallback_Call) Return(_a0 string, _a1 error) *MockSSHConfiger_ExecuteCommandWithCallback_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockSSHConfiger_ExecuteCommandWithCallback_Call) RunAndReturn(run func(context.Context, string, func(string)) (string, error)) *MockSSHConfiger_ExecuteCommandWithCallback_Call { + _c.Call.Return(run) + return _c +} + +// GetHost provides a mock function with given fields: +func (_m *MockSSHConfiger) GetHost() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetHost") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// MockSSHConfiger_GetHost_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetHost' +type MockSSHConfiger_GetHost_Call struct { + *mock.Call +} + +// GetHost is a helper method to define mock.On call +func (_e *MockSSHConfiger_Expecter) GetHost() *MockSSHConfiger_GetHost_Call { + return &MockSSHConfiger_GetHost_Call{Call: _e.mock.On("GetHost")} +} + +func (_c *MockSSHConfiger_GetHost_Call) Run(run func()) *MockSSHConfiger_GetHost_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSSHConfiger_GetHost_Call) Return(_a0 string) *MockSSHConfiger_GetHost_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHConfiger_GetHost_Call) RunAndReturn(run func() string) *MockSSHConfiger_GetHost_Call { + _c.Call.Return(run) + return _c +} + +// GetPort provides a mock function with given fields: +func (_m *MockSSHConfiger) GetPort() int { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetPort") + } + + var r0 int + if rf, ok := ret.Get(0).(func() int); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(int) + } + + return r0 +} + +// MockSSHConfiger_GetPort_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPort' +type MockSSHConfiger_GetPort_Call struct { + *mock.Call +} + +// GetPort is a helper method to define mock.On call +func (_e *MockSSHConfiger_Expecter) GetPort() *MockSSHConfiger_GetPort_Call { + return &MockSSHConfiger_GetPort_Call{Call: _e.mock.On("GetPort")} +} + +func (_c *MockSSHConfiger_GetPort_Call) Run(run func()) *MockSSHConfiger_GetPort_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSSHConfiger_GetPort_Call) Return(_a0 int) *MockSSHConfiger_GetPort_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHConfiger_GetPort_Call) RunAndReturn(run func() int) *MockSSHConfiger_GetPort_Call { + _c.Call.Return(run) + return _c +} + +// GetPrivateKeyMaterial provides a mock function with given fields: +func (_m *MockSSHConfiger) GetPrivateKeyMaterial() []byte { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetPrivateKeyMaterial") + } + + var r0 []byte + if rf, ok := ret.Get(0).(func() []byte); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]byte) + } + } + + return r0 +} + +// MockSSHConfiger_GetPrivateKeyMaterial_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPrivateKeyMaterial' +type MockSSHConfiger_GetPrivateKeyMaterial_Call struct { + *mock.Call +} + +// GetPrivateKeyMaterial is a helper method to define mock.On call +func (_e *MockSSHConfiger_Expecter) GetPrivateKeyMaterial() *MockSSHConfiger_GetPrivateKeyMaterial_Call { + return &MockSSHConfiger_GetPrivateKeyMaterial_Call{Call: _e.mock.On("GetPrivateKeyMaterial")} +} + +func (_c *MockSSHConfiger_GetPrivateKeyMaterial_Call) Run(run func()) *MockSSHConfiger_GetPrivateKeyMaterial_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSSHConfiger_GetPrivateKeyMaterial_Call) Return(_a0 []byte) *MockSSHConfiger_GetPrivateKeyMaterial_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHConfiger_GetPrivateKeyMaterial_Call) RunAndReturn(run func() []byte) *MockSSHConfiger_GetPrivateKeyMaterial_Call { + _c.Call.Return(run) + return _c +} + +// GetSFTPClientCreator provides a mock function with given fields: +func (_m *MockSSHConfiger) GetSFTPClientCreator() sshutils.SFTPClientCreator { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetSFTPClientCreator") + } + + var r0 sshutils.SFTPClientCreator + if rf, ok := ret.Get(0).(func() sshutils.SFTPClientCreator); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(sshutils.SFTPClientCreator) + } + } + + return r0 +} + +// MockSSHConfiger_GetSFTPClientCreator_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSFTPClientCreator' +type MockSSHConfiger_GetSFTPClientCreator_Call struct { + *mock.Call +} + +// GetSFTPClientCreator is a helper method to define mock.On call +func (_e *MockSSHConfiger_Expecter) GetSFTPClientCreator() *MockSSHConfiger_GetSFTPClientCreator_Call { + return &MockSSHConfiger_GetSFTPClientCreator_Call{Call: _e.mock.On("GetSFTPClientCreator")} +} + +func (_c *MockSSHConfiger_GetSFTPClientCreator_Call) Run(run func()) *MockSSHConfiger_GetSFTPClientCreator_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSSHConfiger_GetSFTPClientCreator_Call) Return(_a0 sshutils.SFTPClientCreator) *MockSSHConfiger_GetSFTPClientCreator_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHConfiger_GetSFTPClientCreator_Call) RunAndReturn(run func() sshutils.SFTPClientCreator) *MockSSHConfiger_GetSFTPClientCreator_Call { + _c.Call.Return(run) + return _c +} + +// GetSSHClient provides a mock function with given fields: +func (_m *MockSSHConfiger) GetSSHClient() *ssh.Client { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetSSHClient") + } + + var r0 *ssh.Client + if rf, ok := ret.Get(0).(func() *ssh.Client); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ssh.Client) + } + } + + return r0 +} + +// MockSSHConfiger_GetSSHClient_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSSHClient' +type MockSSHConfiger_GetSSHClient_Call struct { + *mock.Call +} + +// GetSSHClient is a helper method to define mock.On call +func (_e *MockSSHConfiger_Expecter) GetSSHClient() *MockSSHConfiger_GetSSHClient_Call { + return &MockSSHConfiger_GetSSHClient_Call{Call: _e.mock.On("GetSSHClient")} +} + +func (_c *MockSSHConfiger_GetSSHClient_Call) Run(run func()) *MockSSHConfiger_GetSSHClient_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSSHConfiger_GetSSHClient_Call) Return(_a0 *ssh.Client) *MockSSHConfiger_GetSSHClient_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHConfiger_GetSSHClient_Call) RunAndReturn(run func() *ssh.Client) *MockSSHConfiger_GetSSHClient_Call { + _c.Call.Return(run) + return _c +} + +// GetSSHClientCreator provides a mock function with given fields: +func (_m *MockSSHConfiger) GetSSHClientCreator() sshutils.SSHClientCreator { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetSSHClientCreator") + } + + var r0 sshutils.SSHClientCreator + if rf, ok := ret.Get(0).(func() sshutils.SSHClientCreator); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(sshutils.SSHClientCreator) + } + } + + return r0 +} + +// MockSSHConfiger_GetSSHClientCreator_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSSHClientCreator' +type MockSSHConfiger_GetSSHClientCreator_Call struct { + *mock.Call +} + +// GetSSHClientCreator is a helper method to define mock.On call +func (_e *MockSSHConfiger_Expecter) GetSSHClientCreator() *MockSSHConfiger_GetSSHClientCreator_Call { + return &MockSSHConfiger_GetSSHClientCreator_Call{Call: _e.mock.On("GetSSHClientCreator")} +} + +func (_c *MockSSHConfiger_GetSSHClientCreator_Call) Run(run func()) *MockSSHConfiger_GetSSHClientCreator_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSSHConfiger_GetSSHClientCreator_Call) Return(_a0 sshutils.SSHClientCreator) *MockSSHConfiger_GetSSHClientCreator_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHConfiger_GetSSHClientCreator_Call) RunAndReturn(run func() sshutils.SSHClientCreator) *MockSSHConfiger_GetSSHClientCreator_Call { + _c.Call.Return(run) + return _c +} + +// GetUser provides a mock function with given fields: +func (_m *MockSSHConfiger) GetUser() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetUser") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// MockSSHConfiger_GetUser_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUser' +type MockSSHConfiger_GetUser_Call struct { + *mock.Call +} + +// GetUser is a helper method to define mock.On call +func (_e *MockSSHConfiger_Expecter) GetUser() *MockSSHConfiger_GetUser_Call { + return &MockSSHConfiger_GetUser_Call{Call: _e.mock.On("GetUser")} +} + +func (_c *MockSSHConfiger_GetUser_Call) Run(run func()) *MockSSHConfiger_GetUser_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSSHConfiger_GetUser_Call) Return(_a0 string) *MockSSHConfiger_GetUser_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHConfiger_GetUser_Call) RunAndReturn(run func() string) *MockSSHConfiger_GetUser_Call { + _c.Call.Return(run) + return _c +} + +// InstallSystemdService provides a mock function with given fields: ctx, serviceName, serviceContent +func (_m *MockSSHConfiger) InstallSystemdService(ctx context.Context, serviceName string, serviceContent string) error { + ret := _m.Called(ctx, serviceName, serviceContent) + + if len(ret) == 0 { + panic("no return value specified for InstallSystemdService") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok { + r0 = rf(ctx, serviceName, serviceContent) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockSSHConfiger_InstallSystemdService_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'InstallSystemdService' +type MockSSHConfiger_InstallSystemdService_Call struct { + *mock.Call +} + +// InstallSystemdService is a helper method to define mock.On call +// - ctx context.Context +// - serviceName string +// - serviceContent string +func (_e *MockSSHConfiger_Expecter) InstallSystemdService(ctx interface{}, serviceName interface{}, serviceContent interface{}) *MockSSHConfiger_InstallSystemdService_Call { + return &MockSSHConfiger_InstallSystemdService_Call{Call: _e.mock.On("InstallSystemdService", ctx, serviceName, serviceContent)} +} + +func (_c *MockSSHConfiger_InstallSystemdService_Call) Run(run func(ctx context.Context, serviceName string, serviceContent string)) *MockSSHConfiger_InstallSystemdService_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *MockSSHConfiger_InstallSystemdService_Call) Return(_a0 error) *MockSSHConfiger_InstallSystemdService_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHConfiger_InstallSystemdService_Call) RunAndReturn(run func(context.Context, string, string) error) *MockSSHConfiger_InstallSystemdService_Call { + _c.Call.Return(run) + return _c +} + +// IsConnected provides a mock function with given fields: +func (_m *MockSSHConfiger) IsConnected() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for IsConnected") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// MockSSHConfiger_IsConnected_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsConnected' +type MockSSHConfiger_IsConnected_Call struct { + *mock.Call +} + +// IsConnected is a helper method to define mock.On call +func (_e *MockSSHConfiger_Expecter) IsConnected() *MockSSHConfiger_IsConnected_Call { + return &MockSSHConfiger_IsConnected_Call{Call: _e.mock.On("IsConnected")} +} + +func (_c *MockSSHConfiger_IsConnected_Call) Run(run func()) *MockSSHConfiger_IsConnected_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSSHConfiger_IsConnected_Call) Return(_a0 bool) *MockSSHConfiger_IsConnected_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHConfiger_IsConnected_Call) RunAndReturn(run func() bool) *MockSSHConfiger_IsConnected_Call { + _c.Call.Return(run) + return _c +} + +// PushFile provides a mock function with given fields: ctx, remotePath, content, executable +func (_m *MockSSHConfiger) PushFile(ctx context.Context, remotePath string, content []byte, executable bool) error { + ret := _m.Called(ctx, remotePath, content, executable) + + if len(ret) == 0 { + panic("no return value specified for PushFile") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, []byte, bool) error); ok { + r0 = rf(ctx, remotePath, content, executable) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockSSHConfiger_PushFile_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PushFile' +type MockSSHConfiger_PushFile_Call struct { + *mock.Call +} + +// PushFile is a helper method to define mock.On call +// - ctx context.Context +// - remotePath string +// - content []byte +// - executable bool +func (_e *MockSSHConfiger_Expecter) PushFile(ctx interface{}, remotePath interface{}, content interface{}, executable interface{}) *MockSSHConfiger_PushFile_Call { + return &MockSSHConfiger_PushFile_Call{Call: _e.mock.On("PushFile", ctx, remotePath, content, executable)} +} + +func (_c *MockSSHConfiger_PushFile_Call) Run(run func(ctx context.Context, remotePath string, content []byte, executable bool)) *MockSSHConfiger_PushFile_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].([]byte), args[3].(bool)) + }) + return _c +} + +func (_c *MockSSHConfiger_PushFile_Call) Return(_a0 error) *MockSSHConfiger_PushFile_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHConfiger_PushFile_Call) RunAndReturn(run func(context.Context, string, []byte, bool) error) *MockSSHConfiger_PushFile_Call { + _c.Call.Return(run) + return _c +} + +// PushFileWithCallback provides a mock function with given fields: ctx, remotePath, content, executable, callback +func (_m *MockSSHConfiger) PushFileWithCallback(ctx context.Context, remotePath string, content []byte, executable bool, callback func(int64, int64)) error { + ret := _m.Called(ctx, remotePath, content, executable, callback) + + if len(ret) == 0 { + panic("no return value specified for PushFileWithCallback") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, []byte, bool, func(int64, int64)) error); ok { + r0 = rf(ctx, remotePath, content, executable, callback) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockSSHConfiger_PushFileWithCallback_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PushFileWithCallback' +type MockSSHConfiger_PushFileWithCallback_Call struct { + *mock.Call +} + +// PushFileWithCallback is a helper method to define mock.On call +// - ctx context.Context +// - remotePath string +// - content []byte +// - executable bool +// - callback func(int64 , int64) +func (_e *MockSSHConfiger_Expecter) PushFileWithCallback(ctx interface{}, remotePath interface{}, content interface{}, executable interface{}, callback interface{}) *MockSSHConfiger_PushFileWithCallback_Call { + return &MockSSHConfiger_PushFileWithCallback_Call{Call: _e.mock.On("PushFileWithCallback", ctx, remotePath, content, executable, callback)} +} + +func (_c *MockSSHConfiger_PushFileWithCallback_Call) Run(run func(ctx context.Context, remotePath string, content []byte, executable bool, callback func(int64, int64))) *MockSSHConfiger_PushFileWithCallback_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].([]byte), args[3].(bool), args[4].(func(int64, int64))) + }) + return _c +} + +func (_c *MockSSHConfiger_PushFileWithCallback_Call) Return(_a0 error) *MockSSHConfiger_PushFileWithCallback_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHConfiger_PushFileWithCallback_Call) RunAndReturn(run func(context.Context, string, []byte, bool, func(int64, int64)) error) *MockSSHConfiger_PushFileWithCallback_Call { + _c.Call.Return(run) + return _c +} + +// RestartService provides a mock function with given fields: ctx, serviceName +func (_m *MockSSHConfiger) RestartService(ctx context.Context, serviceName string) (string, error) { + ret := _m.Called(ctx, serviceName) + + if len(ret) == 0 { + panic("no return value specified for RestartService") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (string, error)); ok { + return rf(ctx, serviceName) + } + if rf, ok := ret.Get(0).(func(context.Context, string) string); ok { + r0 = rf(ctx, serviceName) + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, serviceName) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockSSHConfiger_RestartService_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RestartService' +type MockSSHConfiger_RestartService_Call struct { + *mock.Call +} + +// RestartService is a helper method to define mock.On call +// - ctx context.Context +// - serviceName string +func (_e *MockSSHConfiger_Expecter) RestartService(ctx interface{}, serviceName interface{}) *MockSSHConfiger_RestartService_Call { + return &MockSSHConfiger_RestartService_Call{Call: _e.mock.On("RestartService", ctx, serviceName)} +} + +func (_c *MockSSHConfiger_RestartService_Call) Run(run func(ctx context.Context, serviceName string)) *MockSSHConfiger_RestartService_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockSSHConfiger_RestartService_Call) Return(_a0 string, _a1 error) *MockSSHConfiger_RestartService_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockSSHConfiger_RestartService_Call) RunAndReturn(run func(context.Context, string) (string, error)) *MockSSHConfiger_RestartService_Call { + _c.Call.Return(run) + return _c +} + +// SetSFTPClientCreator provides a mock function with given fields: clientCreator +func (_m *MockSSHConfiger) SetSFTPClientCreator(clientCreator sshutils.SFTPClientCreator) { + _m.Called(clientCreator) +} + +// MockSSHConfiger_SetSFTPClientCreator_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetSFTPClientCreator' +type MockSSHConfiger_SetSFTPClientCreator_Call struct { + *mock.Call +} + +// SetSFTPClientCreator is a helper method to define mock.On call +// - clientCreator sshutils.SFTPClientCreator +func (_e *MockSSHConfiger_Expecter) SetSFTPClientCreator(clientCreator interface{}) *MockSSHConfiger_SetSFTPClientCreator_Call { + return &MockSSHConfiger_SetSFTPClientCreator_Call{Call: _e.mock.On("SetSFTPClientCreator", clientCreator)} +} + +func (_c *MockSSHConfiger_SetSFTPClientCreator_Call) Run(run func(clientCreator sshutils.SFTPClientCreator)) *MockSSHConfiger_SetSFTPClientCreator_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(sshutils.SFTPClientCreator)) + }) + return _c +} + +func (_c *MockSSHConfiger_SetSFTPClientCreator_Call) Return() *MockSSHConfiger_SetSFTPClientCreator_Call { + _c.Call.Return() + return _c +} + +func (_c *MockSSHConfiger_SetSFTPClientCreator_Call) RunAndReturn(run func(sshutils.SFTPClientCreator)) *MockSSHConfiger_SetSFTPClientCreator_Call { + _c.Call.Return(run) + return _c +} + +// SetSSHClient provides a mock function with given fields: client +func (_m *MockSSHConfiger) SetSSHClient(client *ssh.Client) { + _m.Called(client) +} + +// MockSSHConfiger_SetSSHClient_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetSSHClient' +type MockSSHConfiger_SetSSHClient_Call struct { + *mock.Call +} + +// SetSSHClient is a helper method to define mock.On call +// - client *ssh.Client +func (_e *MockSSHConfiger_Expecter) SetSSHClient(client interface{}) *MockSSHConfiger_SetSSHClient_Call { + return &MockSSHConfiger_SetSSHClient_Call{Call: _e.mock.On("SetSSHClient", client)} +} + +func (_c *MockSSHConfiger_SetSSHClient_Call) Run(run func(client *ssh.Client)) *MockSSHConfiger_SetSSHClient_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*ssh.Client)) + }) + return _c +} + +func (_c *MockSSHConfiger_SetSSHClient_Call) Return() *MockSSHConfiger_SetSSHClient_Call { + _c.Call.Return() + return _c +} + +func (_c *MockSSHConfiger_SetSSHClient_Call) RunAndReturn(run func(*ssh.Client)) *MockSSHConfiger_SetSSHClient_Call { + _c.Call.Return(run) + return _c +} + +// SetSSHClientCreator provides a mock function with given fields: clientCreator +func (_m *MockSSHConfiger) SetSSHClientCreator(clientCreator sshutils.SSHClientCreator) { + _m.Called(clientCreator) +} + +// MockSSHConfiger_SetSSHClientCreator_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetSSHClientCreator' +type MockSSHConfiger_SetSSHClientCreator_Call struct { + *mock.Call +} + +// SetSSHClientCreator is a helper method to define mock.On call +// - clientCreator sshutils.SSHClientCreator +func (_e *MockSSHConfiger_Expecter) SetSSHClientCreator(clientCreator interface{}) *MockSSHConfiger_SetSSHClientCreator_Call { + return &MockSSHConfiger_SetSSHClientCreator_Call{Call: _e.mock.On("SetSSHClientCreator", clientCreator)} +} + +func (_c *MockSSHConfiger_SetSSHClientCreator_Call) Run(run func(clientCreator sshutils.SSHClientCreator)) *MockSSHConfiger_SetSSHClientCreator_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(sshutils.SSHClientCreator)) + }) + return _c +} + +func (_c *MockSSHConfiger_SetSSHClientCreator_Call) Return() *MockSSHConfiger_SetSSHClientCreator_Call { + _c.Call.Return() + return _c +} + +func (_c *MockSSHConfiger_SetSSHClientCreator_Call) RunAndReturn(run func(sshutils.SSHClientCreator)) *MockSSHConfiger_SetSSHClientCreator_Call { + _c.Call.Return(run) + return _c +} + +// SetValidateSSHConnection provides a mock function with given fields: fn +func (_m *MockSSHConfiger) SetValidateSSHConnection(fn func() error) { + _m.Called(fn) +} + +// MockSSHConfiger_SetValidateSSHConnection_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetValidateSSHConnection' +type MockSSHConfiger_SetValidateSSHConnection_Call struct { + *mock.Call +} + +// SetValidateSSHConnection is a helper method to define mock.On call +// - fn func() error +func (_e *MockSSHConfiger_Expecter) SetValidateSSHConnection(fn interface{}) *MockSSHConfiger_SetValidateSSHConnection_Call { + return &MockSSHConfiger_SetValidateSSHConnection_Call{Call: _e.mock.On("SetValidateSSHConnection", fn)} +} + +func (_c *MockSSHConfiger_SetValidateSSHConnection_Call) Run(run func(fn func() error)) *MockSSHConfiger_SetValidateSSHConnection_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(func() error)) + }) + return _c +} + +func (_c *MockSSHConfiger_SetValidateSSHConnection_Call) Return() *MockSSHConfiger_SetValidateSSHConnection_Call { + _c.Call.Return() + return _c +} + +func (_c *MockSSHConfiger_SetValidateSSHConnection_Call) RunAndReturn(run func(func() error)) *MockSSHConfiger_SetValidateSSHConnection_Call { + _c.Call.Return(run) + return _c +} + +// StartService provides a mock function with given fields: ctx, serviceName +func (_m *MockSSHConfiger) StartService(ctx context.Context, serviceName string) (string, error) { + ret := _m.Called(ctx, serviceName) + + if len(ret) == 0 { + panic("no return value specified for StartService") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (string, error)); ok { + return rf(ctx, serviceName) + } + if rf, ok := ret.Get(0).(func(context.Context, string) string); ok { + r0 = rf(ctx, serviceName) + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, serviceName) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockSSHConfiger_StartService_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StartService' +type MockSSHConfiger_StartService_Call struct { + *mock.Call +} + +// StartService is a helper method to define mock.On call +// - ctx context.Context +// - serviceName string +func (_e *MockSSHConfiger_Expecter) StartService(ctx interface{}, serviceName interface{}) *MockSSHConfiger_StartService_Call { + return &MockSSHConfiger_StartService_Call{Call: _e.mock.On("StartService", ctx, serviceName)} +} + +func (_c *MockSSHConfiger_StartService_Call) Run(run func(ctx context.Context, serviceName string)) *MockSSHConfiger_StartService_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockSSHConfiger_StartService_Call) Return(_a0 string, _a1 error) *MockSSHConfiger_StartService_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockSSHConfiger_StartService_Call) RunAndReturn(run func(context.Context, string) (string, error)) *MockSSHConfiger_StartService_Call { + _c.Call.Return(run) + return _c +} + +// WaitForSSH provides a mock function with given fields: ctx, retry, timeout +func (_m *MockSSHConfiger) WaitForSSH(ctx context.Context, retry int, timeout time.Duration) error { + ret := _m.Called(ctx, retry, timeout) + + if len(ret) == 0 { + panic("no return value specified for WaitForSSH") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, int, time.Duration) error); ok { + r0 = rf(ctx, retry, timeout) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockSSHConfiger_WaitForSSH_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WaitForSSH' +type MockSSHConfiger_WaitForSSH_Call struct { + *mock.Call +} + +// WaitForSSH is a helper method to define mock.On call +// - ctx context.Context +// - retry int +// - timeout time.Duration +func (_e *MockSSHConfiger_Expecter) WaitForSSH(ctx interface{}, retry interface{}, timeout interface{}) *MockSSHConfiger_WaitForSSH_Call { + return &MockSSHConfiger_WaitForSSH_Call{Call: _e.mock.On("WaitForSSH", ctx, retry, timeout)} +} + +func (_c *MockSSHConfiger_WaitForSSH_Call) Run(run func(ctx context.Context, retry int, timeout time.Duration)) *MockSSHConfiger_WaitForSSH_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int), args[2].(time.Duration)) + }) + return _c +} + +func (_c *MockSSHConfiger_WaitForSSH_Call) Return(_a0 error) *MockSSHConfiger_WaitForSSH_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHConfiger_WaitForSSH_Call) RunAndReturn(run func(context.Context, int, time.Duration) error) *MockSSHConfiger_WaitForSSH_Call { + _c.Call.Return(run) + return _c +} + +// NewMockSSHConfiger creates a new instance of MockSSHConfiger. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockSSHConfiger(t interface { + mock.TestingT + Cleanup(func()) +}) *MockSSHConfiger { + mock := &MockSSHConfiger{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/pkg/models/interfaces/aws/mocks/sshutils/mock_SSHSessioner.go b/pkg/models/interfaces/aws/mocks/sshutils/mock_SSHSessioner.go new file mode 100644 index 00000000..f8d1a556 --- /dev/null +++ b/pkg/models/interfaces/aws/mocks/sshutils/mock_SSHSessioner.go @@ -0,0 +1,446 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package sshutils + +import ( + io "io" + + mock "github.com/stretchr/testify/mock" + ssh "golang.org/x/crypto/ssh" +) + +// MockSSHSessioner is an autogenerated mock type for the SSHSessioner type +type MockSSHSessioner struct { + mock.Mock +} + +type MockSSHSessioner_Expecter struct { + mock *mock.Mock +} + +func (_m *MockSSHSessioner) EXPECT() *MockSSHSessioner_Expecter { + return &MockSSHSessioner_Expecter{mock: &_m.Mock} +} + +// Close provides a mock function with given fields: +func (_m *MockSSHSessioner) Close() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Close") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockSSHSessioner_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type MockSSHSessioner_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *MockSSHSessioner_Expecter) Close() *MockSSHSessioner_Close_Call { + return &MockSSHSessioner_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *MockSSHSessioner_Close_Call) Run(run func()) *MockSSHSessioner_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSSHSessioner_Close_Call) Return(_a0 error) *MockSSHSessioner_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHSessioner_Close_Call) RunAndReturn(run func() error) *MockSSHSessioner_Close_Call { + _c.Call.Return(run) + return _c +} + +// CombinedOutput provides a mock function with given fields: cmd +func (_m *MockSSHSessioner) CombinedOutput(cmd string) ([]byte, error) { + ret := _m.Called(cmd) + + if len(ret) == 0 { + panic("no return value specified for CombinedOutput") + } + + var r0 []byte + var r1 error + if rf, ok := ret.Get(0).(func(string) ([]byte, error)); ok { + return rf(cmd) + } + if rf, ok := ret.Get(0).(func(string) []byte); ok { + r0 = rf(cmd) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]byte) + } + } + + if rf, ok := ret.Get(1).(func(string) error); ok { + r1 = rf(cmd) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockSSHSessioner_CombinedOutput_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CombinedOutput' +type MockSSHSessioner_CombinedOutput_Call struct { + *mock.Call +} + +// CombinedOutput is a helper method to define mock.On call +// - cmd string +func (_e *MockSSHSessioner_Expecter) CombinedOutput(cmd interface{}) *MockSSHSessioner_CombinedOutput_Call { + return &MockSSHSessioner_CombinedOutput_Call{Call: _e.mock.On("CombinedOutput", cmd)} +} + +func (_c *MockSSHSessioner_CombinedOutput_Call) Run(run func(cmd string)) *MockSSHSessioner_CombinedOutput_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *MockSSHSessioner_CombinedOutput_Call) Return(_a0 []byte, _a1 error) *MockSSHSessioner_CombinedOutput_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockSSHSessioner_CombinedOutput_Call) RunAndReturn(run func(string) ([]byte, error)) *MockSSHSessioner_CombinedOutput_Call { + _c.Call.Return(run) + return _c +} + +// Run provides a mock function with given fields: cmd +func (_m *MockSSHSessioner) Run(cmd string) error { + ret := _m.Called(cmd) + + if len(ret) == 0 { + panic("no return value specified for Run") + } + + var r0 error + if rf, ok := ret.Get(0).(func(string) error); ok { + r0 = rf(cmd) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockSSHSessioner_Run_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Run' +type MockSSHSessioner_Run_Call struct { + *mock.Call +} + +// Run is a helper method to define mock.On call +// - cmd string +func (_e *MockSSHSessioner_Expecter) Run(cmd interface{}) *MockSSHSessioner_Run_Call { + return &MockSSHSessioner_Run_Call{Call: _e.mock.On("Run", cmd)} +} + +func (_c *MockSSHSessioner_Run_Call) Run(run func(cmd string)) *MockSSHSessioner_Run_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *MockSSHSessioner_Run_Call) Return(_a0 error) *MockSSHSessioner_Run_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHSessioner_Run_Call) RunAndReturn(run func(string) error) *MockSSHSessioner_Run_Call { + _c.Call.Return(run) + return _c +} + +// SetStderr provides a mock function with given fields: _a0 +func (_m *MockSSHSessioner) SetStderr(_a0 io.Writer) { + _m.Called(_a0) +} + +// MockSSHSessioner_SetStderr_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetStderr' +type MockSSHSessioner_SetStderr_Call struct { + *mock.Call +} + +// SetStderr is a helper method to define mock.On call +// - _a0 io.Writer +func (_e *MockSSHSessioner_Expecter) SetStderr(_a0 interface{}) *MockSSHSessioner_SetStderr_Call { + return &MockSSHSessioner_SetStderr_Call{Call: _e.mock.On("SetStderr", _a0)} +} + +func (_c *MockSSHSessioner_SetStderr_Call) Run(run func(_a0 io.Writer)) *MockSSHSessioner_SetStderr_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(io.Writer)) + }) + return _c +} + +func (_c *MockSSHSessioner_SetStderr_Call) Return() *MockSSHSessioner_SetStderr_Call { + _c.Call.Return() + return _c +} + +func (_c *MockSSHSessioner_SetStderr_Call) RunAndReturn(run func(io.Writer)) *MockSSHSessioner_SetStderr_Call { + _c.Call.Return(run) + return _c +} + +// SetStdout provides a mock function with given fields: _a0 +func (_m *MockSSHSessioner) SetStdout(_a0 io.Writer) { + _m.Called(_a0) +} + +// MockSSHSessioner_SetStdout_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetStdout' +type MockSSHSessioner_SetStdout_Call struct { + *mock.Call +} + +// SetStdout is a helper method to define mock.On call +// - _a0 io.Writer +func (_e *MockSSHSessioner_Expecter) SetStdout(_a0 interface{}) *MockSSHSessioner_SetStdout_Call { + return &MockSSHSessioner_SetStdout_Call{Call: _e.mock.On("SetStdout", _a0)} +} + +func (_c *MockSSHSessioner_SetStdout_Call) Run(run func(_a0 io.Writer)) *MockSSHSessioner_SetStdout_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(io.Writer)) + }) + return _c +} + +func (_c *MockSSHSessioner_SetStdout_Call) Return() *MockSSHSessioner_SetStdout_Call { + _c.Call.Return() + return _c +} + +func (_c *MockSSHSessioner_SetStdout_Call) RunAndReturn(run func(io.Writer)) *MockSSHSessioner_SetStdout_Call { + _c.Call.Return(run) + return _c +} + +// Signal provides a mock function with given fields: sig +func (_m *MockSSHSessioner) Signal(sig ssh.Signal) error { + ret := _m.Called(sig) + + if len(ret) == 0 { + panic("no return value specified for Signal") + } + + var r0 error + if rf, ok := ret.Get(0).(func(ssh.Signal) error); ok { + r0 = rf(sig) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockSSHSessioner_Signal_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Signal' +type MockSSHSessioner_Signal_Call struct { + *mock.Call +} + +// Signal is a helper method to define mock.On call +// - sig ssh.Signal +func (_e *MockSSHSessioner_Expecter) Signal(sig interface{}) *MockSSHSessioner_Signal_Call { + return &MockSSHSessioner_Signal_Call{Call: _e.mock.On("Signal", sig)} +} + +func (_c *MockSSHSessioner_Signal_Call) Run(run func(sig ssh.Signal)) *MockSSHSessioner_Signal_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(ssh.Signal)) + }) + return _c +} + +func (_c *MockSSHSessioner_Signal_Call) Return(_a0 error) *MockSSHSessioner_Signal_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHSessioner_Signal_Call) RunAndReturn(run func(ssh.Signal) error) *MockSSHSessioner_Signal_Call { + _c.Call.Return(run) + return _c +} + +// Start provides a mock function with given fields: cmd +func (_m *MockSSHSessioner) Start(cmd string) error { + ret := _m.Called(cmd) + + if len(ret) == 0 { + panic("no return value specified for Start") + } + + var r0 error + if rf, ok := ret.Get(0).(func(string) error); ok { + r0 = rf(cmd) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockSSHSessioner_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' +type MockSSHSessioner_Start_Call struct { + *mock.Call +} + +// Start is a helper method to define mock.On call +// - cmd string +func (_e *MockSSHSessioner_Expecter) Start(cmd interface{}) *MockSSHSessioner_Start_Call { + return &MockSSHSessioner_Start_Call{Call: _e.mock.On("Start", cmd)} +} + +func (_c *MockSSHSessioner_Start_Call) Run(run func(cmd string)) *MockSSHSessioner_Start_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *MockSSHSessioner_Start_Call) Return(_a0 error) *MockSSHSessioner_Start_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHSessioner_Start_Call) RunAndReturn(run func(string) error) *MockSSHSessioner_Start_Call { + _c.Call.Return(run) + return _c +} + +// StdinPipe provides a mock function with given fields: +func (_m *MockSSHSessioner) StdinPipe() (io.WriteCloser, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for StdinPipe") + } + + var r0 io.WriteCloser + var r1 error + if rf, ok := ret.Get(0).(func() (io.WriteCloser, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() io.WriteCloser); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(io.WriteCloser) + } + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockSSHSessioner_StdinPipe_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StdinPipe' +type MockSSHSessioner_StdinPipe_Call struct { + *mock.Call +} + +// StdinPipe is a helper method to define mock.On call +func (_e *MockSSHSessioner_Expecter) StdinPipe() *MockSSHSessioner_StdinPipe_Call { + return &MockSSHSessioner_StdinPipe_Call{Call: _e.mock.On("StdinPipe")} +} + +func (_c *MockSSHSessioner_StdinPipe_Call) Run(run func()) *MockSSHSessioner_StdinPipe_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSSHSessioner_StdinPipe_Call) Return(_a0 io.WriteCloser, _a1 error) *MockSSHSessioner_StdinPipe_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockSSHSessioner_StdinPipe_Call) RunAndReturn(run func() (io.WriteCloser, error)) *MockSSHSessioner_StdinPipe_Call { + _c.Call.Return(run) + return _c +} + +// Wait provides a mock function with given fields: +func (_m *MockSSHSessioner) Wait() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Wait") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockSSHSessioner_Wait_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Wait' +type MockSSHSessioner_Wait_Call struct { + *mock.Call +} + +// Wait is a helper method to define mock.On call +func (_e *MockSSHSessioner_Expecter) Wait() *MockSSHSessioner_Wait_Call { + return &MockSSHSessioner_Wait_Call{Call: _e.mock.On("Wait")} +} + +func (_c *MockSSHSessioner_Wait_Call) Run(run func()) *MockSSHSessioner_Wait_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSSHSessioner_Wait_Call) Return(_a0 error) *MockSSHSessioner_Wait_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHSessioner_Wait_Call) RunAndReturn(run func() error) *MockSSHSessioner_Wait_Call { + _c.Call.Return(run) + return _c +} + +// NewMockSSHSessioner creates a new instance of MockSSHSessioner. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockSSHSessioner(t interface { + mock.TestingT + Cleanup(func()) +}) *MockSSHSessioner { + mock := &MockSSHSessioner{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/pkg/models/interfaces/common/cluster_deployerer.go b/pkg/models/interfaces/common/cluster_deployerer.go index 5e8a16b1..464f9bf1 100644 --- a/pkg/models/interfaces/common/cluster_deployerer.go +++ b/pkg/models/interfaces/common/cluster_deployerer.go @@ -6,7 +6,7 @@ import ( "sort" "github.com/bacalhau-project/andaime/pkg/models" - "github.com/bacalhau-project/andaime/pkg/sshutils" + sshutils_interface "github.com/bacalhau-project/andaime/pkg/models/interfaces/sshutils" ) // Step represents a single step in the provisioning process @@ -171,7 +171,7 @@ func (s StepMessage) RenderDoneMessage(args ...any) string { type ClusterDeployerer interface { ProvisionMachine( ctx context.Context, - sshConfig sshutils.SSHConfiger, + sshConfig sshutils_interface.SSHConfiger, machine models.Machiner, ) error WaitForAllMachinesToReachState( @@ -182,11 +182,11 @@ type ClusterDeployerer interface { ExecuteCustomScript( ctx context.Context, - sshConfig sshutils.SSHConfiger, + sshConfig sshutils_interface.SSHConfiger, machine models.Machiner, ) error ApplyBacalhauConfigs(ctx context.Context, - sshConfig sshutils.SSHConfiger, + sshConfig sshutils_interface.SSHConfiger, bacalhauSettings []models.BacalhauSettings) error ProvisionBacalhauCluster(ctx context.Context) error diff --git a/pkg/models/interfaces/sshutils/mocks/aws/mock_EC2Clienter.go b/pkg/models/interfaces/sshutils/mocks/aws/mock_EC2Clienter.go new file mode 100644 index 00000000..45ad371c --- /dev/null +++ b/pkg/models/interfaces/sshutils/mocks/aws/mock_EC2Clienter.go @@ -0,0 +1,2109 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package aws + +import ( + context "context" + + ec2 "github.com/aws/aws-sdk-go-v2/service/ec2" + mock "github.com/stretchr/testify/mock" +) + +// MockEC2Clienter is an autogenerated mock type for the EC2Clienter type +type MockEC2Clienter struct { + mock.Mock +} + +type MockEC2Clienter_Expecter struct { + mock *mock.Mock +} + +func (_m *MockEC2Clienter) EXPECT() *MockEC2Clienter_Expecter { + return &MockEC2Clienter_Expecter{mock: &_m.Mock} +} + +// AssociateRouteTable provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) AssociateRouteTable(ctx context.Context, params *ec2.AssociateRouteTableInput, optFns ...func(*ec2.Options)) (*ec2.AssociateRouteTableOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for AssociateRouteTable") + } + + var r0 *ec2.AssociateRouteTableOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.AssociateRouteTableInput, ...func(*ec2.Options)) (*ec2.AssociateRouteTableOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.AssociateRouteTableInput, ...func(*ec2.Options)) *ec2.AssociateRouteTableOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.AssociateRouteTableOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.AssociateRouteTableInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_AssociateRouteTable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AssociateRouteTable' +type MockEC2Clienter_AssociateRouteTable_Call struct { + *mock.Call +} + +// AssociateRouteTable is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.AssociateRouteTableInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) AssociateRouteTable(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_AssociateRouteTable_Call { + return &MockEC2Clienter_AssociateRouteTable_Call{Call: _e.mock.On("AssociateRouteTable", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_AssociateRouteTable_Call) Run(run func(ctx context.Context, params *ec2.AssociateRouteTableInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_AssociateRouteTable_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.AssociateRouteTableInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_AssociateRouteTable_Call) Return(_a0 *ec2.AssociateRouteTableOutput, _a1 error) *MockEC2Clienter_AssociateRouteTable_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_AssociateRouteTable_Call) RunAndReturn(run func(context.Context, *ec2.AssociateRouteTableInput, ...func(*ec2.Options)) (*ec2.AssociateRouteTableOutput, error)) *MockEC2Clienter_AssociateRouteTable_Call { + _c.Call.Return(run) + return _c +} + +// AttachInternetGateway provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) AttachInternetGateway(ctx context.Context, params *ec2.AttachInternetGatewayInput, optFns ...func(*ec2.Options)) (*ec2.AttachInternetGatewayOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for AttachInternetGateway") + } + + var r0 *ec2.AttachInternetGatewayOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.AttachInternetGatewayInput, ...func(*ec2.Options)) (*ec2.AttachInternetGatewayOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.AttachInternetGatewayInput, ...func(*ec2.Options)) *ec2.AttachInternetGatewayOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.AttachInternetGatewayOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.AttachInternetGatewayInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_AttachInternetGateway_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AttachInternetGateway' +type MockEC2Clienter_AttachInternetGateway_Call struct { + *mock.Call +} + +// AttachInternetGateway is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.AttachInternetGatewayInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) AttachInternetGateway(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_AttachInternetGateway_Call { + return &MockEC2Clienter_AttachInternetGateway_Call{Call: _e.mock.On("AttachInternetGateway", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_AttachInternetGateway_Call) Run(run func(ctx context.Context, params *ec2.AttachInternetGatewayInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_AttachInternetGateway_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.AttachInternetGatewayInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_AttachInternetGateway_Call) Return(_a0 *ec2.AttachInternetGatewayOutput, _a1 error) *MockEC2Clienter_AttachInternetGateway_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_AttachInternetGateway_Call) RunAndReturn(run func(context.Context, *ec2.AttachInternetGatewayInput, ...func(*ec2.Options)) (*ec2.AttachInternetGatewayOutput, error)) *MockEC2Clienter_AttachInternetGateway_Call { + _c.Call.Return(run) + return _c +} + +// AuthorizeSecurityGroupIngress provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) AuthorizeSecurityGroupIngress(ctx context.Context, params *ec2.AuthorizeSecurityGroupIngressInput, optFns ...func(*ec2.Options)) (*ec2.AuthorizeSecurityGroupIngressOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for AuthorizeSecurityGroupIngress") + } + + var r0 *ec2.AuthorizeSecurityGroupIngressOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.AuthorizeSecurityGroupIngressInput, ...func(*ec2.Options)) (*ec2.AuthorizeSecurityGroupIngressOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.AuthorizeSecurityGroupIngressInput, ...func(*ec2.Options)) *ec2.AuthorizeSecurityGroupIngressOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.AuthorizeSecurityGroupIngressOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.AuthorizeSecurityGroupIngressInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_AuthorizeSecurityGroupIngress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AuthorizeSecurityGroupIngress' +type MockEC2Clienter_AuthorizeSecurityGroupIngress_Call struct { + *mock.Call +} + +// AuthorizeSecurityGroupIngress is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.AuthorizeSecurityGroupIngressInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) AuthorizeSecurityGroupIngress(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_AuthorizeSecurityGroupIngress_Call { + return &MockEC2Clienter_AuthorizeSecurityGroupIngress_Call{Call: _e.mock.On("AuthorizeSecurityGroupIngress", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_AuthorizeSecurityGroupIngress_Call) Run(run func(ctx context.Context, params *ec2.AuthorizeSecurityGroupIngressInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_AuthorizeSecurityGroupIngress_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.AuthorizeSecurityGroupIngressInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_AuthorizeSecurityGroupIngress_Call) Return(_a0 *ec2.AuthorizeSecurityGroupIngressOutput, _a1 error) *MockEC2Clienter_AuthorizeSecurityGroupIngress_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_AuthorizeSecurityGroupIngress_Call) RunAndReturn(run func(context.Context, *ec2.AuthorizeSecurityGroupIngressInput, ...func(*ec2.Options)) (*ec2.AuthorizeSecurityGroupIngressOutput, error)) *MockEC2Clienter_AuthorizeSecurityGroupIngress_Call { + _c.Call.Return(run) + return _c +} + +// CreateInternetGateway provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) CreateInternetGateway(ctx context.Context, params *ec2.CreateInternetGatewayInput, optFns ...func(*ec2.Options)) (*ec2.CreateInternetGatewayOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for CreateInternetGateway") + } + + var r0 *ec2.CreateInternetGatewayOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.CreateInternetGatewayInput, ...func(*ec2.Options)) (*ec2.CreateInternetGatewayOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.CreateInternetGatewayInput, ...func(*ec2.Options)) *ec2.CreateInternetGatewayOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.CreateInternetGatewayOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.CreateInternetGatewayInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_CreateInternetGateway_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateInternetGateway' +type MockEC2Clienter_CreateInternetGateway_Call struct { + *mock.Call +} + +// CreateInternetGateway is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.CreateInternetGatewayInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) CreateInternetGateway(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_CreateInternetGateway_Call { + return &MockEC2Clienter_CreateInternetGateway_Call{Call: _e.mock.On("CreateInternetGateway", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_CreateInternetGateway_Call) Run(run func(ctx context.Context, params *ec2.CreateInternetGatewayInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_CreateInternetGateway_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.CreateInternetGatewayInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_CreateInternetGateway_Call) Return(_a0 *ec2.CreateInternetGatewayOutput, _a1 error) *MockEC2Clienter_CreateInternetGateway_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_CreateInternetGateway_Call) RunAndReturn(run func(context.Context, *ec2.CreateInternetGatewayInput, ...func(*ec2.Options)) (*ec2.CreateInternetGatewayOutput, error)) *MockEC2Clienter_CreateInternetGateway_Call { + _c.Call.Return(run) + return _c +} + +// CreateRoute provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) CreateRoute(ctx context.Context, params *ec2.CreateRouteInput, optFns ...func(*ec2.Options)) (*ec2.CreateRouteOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for CreateRoute") + } + + var r0 *ec2.CreateRouteOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.CreateRouteInput, ...func(*ec2.Options)) (*ec2.CreateRouteOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.CreateRouteInput, ...func(*ec2.Options)) *ec2.CreateRouteOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.CreateRouteOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.CreateRouteInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_CreateRoute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateRoute' +type MockEC2Clienter_CreateRoute_Call struct { + *mock.Call +} + +// CreateRoute is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.CreateRouteInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) CreateRoute(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_CreateRoute_Call { + return &MockEC2Clienter_CreateRoute_Call{Call: _e.mock.On("CreateRoute", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_CreateRoute_Call) Run(run func(ctx context.Context, params *ec2.CreateRouteInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_CreateRoute_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.CreateRouteInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_CreateRoute_Call) Return(_a0 *ec2.CreateRouteOutput, _a1 error) *MockEC2Clienter_CreateRoute_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_CreateRoute_Call) RunAndReturn(run func(context.Context, *ec2.CreateRouteInput, ...func(*ec2.Options)) (*ec2.CreateRouteOutput, error)) *MockEC2Clienter_CreateRoute_Call { + _c.Call.Return(run) + return _c +} + +// CreateRouteTable provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) CreateRouteTable(ctx context.Context, params *ec2.CreateRouteTableInput, optFns ...func(*ec2.Options)) (*ec2.CreateRouteTableOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for CreateRouteTable") + } + + var r0 *ec2.CreateRouteTableOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.CreateRouteTableInput, ...func(*ec2.Options)) (*ec2.CreateRouteTableOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.CreateRouteTableInput, ...func(*ec2.Options)) *ec2.CreateRouteTableOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.CreateRouteTableOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.CreateRouteTableInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_CreateRouteTable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateRouteTable' +type MockEC2Clienter_CreateRouteTable_Call struct { + *mock.Call +} + +// CreateRouteTable is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.CreateRouteTableInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) CreateRouteTable(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_CreateRouteTable_Call { + return &MockEC2Clienter_CreateRouteTable_Call{Call: _e.mock.On("CreateRouteTable", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_CreateRouteTable_Call) Run(run func(ctx context.Context, params *ec2.CreateRouteTableInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_CreateRouteTable_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.CreateRouteTableInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_CreateRouteTable_Call) Return(_a0 *ec2.CreateRouteTableOutput, _a1 error) *MockEC2Clienter_CreateRouteTable_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_CreateRouteTable_Call) RunAndReturn(run func(context.Context, *ec2.CreateRouteTableInput, ...func(*ec2.Options)) (*ec2.CreateRouteTableOutput, error)) *MockEC2Clienter_CreateRouteTable_Call { + _c.Call.Return(run) + return _c +} + +// CreateSecurityGroup provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) CreateSecurityGroup(ctx context.Context, params *ec2.CreateSecurityGroupInput, optFns ...func(*ec2.Options)) (*ec2.CreateSecurityGroupOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for CreateSecurityGroup") + } + + var r0 *ec2.CreateSecurityGroupOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.CreateSecurityGroupInput, ...func(*ec2.Options)) (*ec2.CreateSecurityGroupOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.CreateSecurityGroupInput, ...func(*ec2.Options)) *ec2.CreateSecurityGroupOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.CreateSecurityGroupOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.CreateSecurityGroupInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_CreateSecurityGroup_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateSecurityGroup' +type MockEC2Clienter_CreateSecurityGroup_Call struct { + *mock.Call +} + +// CreateSecurityGroup is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.CreateSecurityGroupInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) CreateSecurityGroup(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_CreateSecurityGroup_Call { + return &MockEC2Clienter_CreateSecurityGroup_Call{Call: _e.mock.On("CreateSecurityGroup", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_CreateSecurityGroup_Call) Run(run func(ctx context.Context, params *ec2.CreateSecurityGroupInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_CreateSecurityGroup_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.CreateSecurityGroupInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_CreateSecurityGroup_Call) Return(_a0 *ec2.CreateSecurityGroupOutput, _a1 error) *MockEC2Clienter_CreateSecurityGroup_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_CreateSecurityGroup_Call) RunAndReturn(run func(context.Context, *ec2.CreateSecurityGroupInput, ...func(*ec2.Options)) (*ec2.CreateSecurityGroupOutput, error)) *MockEC2Clienter_CreateSecurityGroup_Call { + _c.Call.Return(run) + return _c +} + +// CreateSubnet provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) CreateSubnet(ctx context.Context, params *ec2.CreateSubnetInput, optFns ...func(*ec2.Options)) (*ec2.CreateSubnetOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for CreateSubnet") + } + + var r0 *ec2.CreateSubnetOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.CreateSubnetInput, ...func(*ec2.Options)) (*ec2.CreateSubnetOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.CreateSubnetInput, ...func(*ec2.Options)) *ec2.CreateSubnetOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.CreateSubnetOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.CreateSubnetInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_CreateSubnet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateSubnet' +type MockEC2Clienter_CreateSubnet_Call struct { + *mock.Call +} + +// CreateSubnet is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.CreateSubnetInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) CreateSubnet(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_CreateSubnet_Call { + return &MockEC2Clienter_CreateSubnet_Call{Call: _e.mock.On("CreateSubnet", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_CreateSubnet_Call) Run(run func(ctx context.Context, params *ec2.CreateSubnetInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_CreateSubnet_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.CreateSubnetInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_CreateSubnet_Call) Return(_a0 *ec2.CreateSubnetOutput, _a1 error) *MockEC2Clienter_CreateSubnet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_CreateSubnet_Call) RunAndReturn(run func(context.Context, *ec2.CreateSubnetInput, ...func(*ec2.Options)) (*ec2.CreateSubnetOutput, error)) *MockEC2Clienter_CreateSubnet_Call { + _c.Call.Return(run) + return _c +} + +// CreateVpc provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) CreateVpc(ctx context.Context, params *ec2.CreateVpcInput, optFns ...func(*ec2.Options)) (*ec2.CreateVpcOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for CreateVpc") + } + + var r0 *ec2.CreateVpcOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.CreateVpcInput, ...func(*ec2.Options)) (*ec2.CreateVpcOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.CreateVpcInput, ...func(*ec2.Options)) *ec2.CreateVpcOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.CreateVpcOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.CreateVpcInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_CreateVpc_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateVpc' +type MockEC2Clienter_CreateVpc_Call struct { + *mock.Call +} + +// CreateVpc is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.CreateVpcInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) CreateVpc(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_CreateVpc_Call { + return &MockEC2Clienter_CreateVpc_Call{Call: _e.mock.On("CreateVpc", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_CreateVpc_Call) Run(run func(ctx context.Context, params *ec2.CreateVpcInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_CreateVpc_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.CreateVpcInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_CreateVpc_Call) Return(_a0 *ec2.CreateVpcOutput, _a1 error) *MockEC2Clienter_CreateVpc_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_CreateVpc_Call) RunAndReturn(run func(context.Context, *ec2.CreateVpcInput, ...func(*ec2.Options)) (*ec2.CreateVpcOutput, error)) *MockEC2Clienter_CreateVpc_Call { + _c.Call.Return(run) + return _c +} + +// DeleteInternetGateway provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) DeleteInternetGateway(ctx context.Context, params *ec2.DeleteInternetGatewayInput, optFns ...func(*ec2.Options)) (*ec2.DeleteInternetGatewayOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for DeleteInternetGateway") + } + + var r0 *ec2.DeleteInternetGatewayOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DeleteInternetGatewayInput, ...func(*ec2.Options)) (*ec2.DeleteInternetGatewayOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DeleteInternetGatewayInput, ...func(*ec2.Options)) *ec2.DeleteInternetGatewayOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.DeleteInternetGatewayOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.DeleteInternetGatewayInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_DeleteInternetGateway_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteInternetGateway' +type MockEC2Clienter_DeleteInternetGateway_Call struct { + *mock.Call +} + +// DeleteInternetGateway is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.DeleteInternetGatewayInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) DeleteInternetGateway(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_DeleteInternetGateway_Call { + return &MockEC2Clienter_DeleteInternetGateway_Call{Call: _e.mock.On("DeleteInternetGateway", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_DeleteInternetGateway_Call) Run(run func(ctx context.Context, params *ec2.DeleteInternetGatewayInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_DeleteInternetGateway_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.DeleteInternetGatewayInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_DeleteInternetGateway_Call) Return(_a0 *ec2.DeleteInternetGatewayOutput, _a1 error) *MockEC2Clienter_DeleteInternetGateway_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_DeleteInternetGateway_Call) RunAndReturn(run func(context.Context, *ec2.DeleteInternetGatewayInput, ...func(*ec2.Options)) (*ec2.DeleteInternetGatewayOutput, error)) *MockEC2Clienter_DeleteInternetGateway_Call { + _c.Call.Return(run) + return _c +} + +// DeleteRouteTable provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) DeleteRouteTable(ctx context.Context, params *ec2.DeleteRouteTableInput, optFns ...func(*ec2.Options)) (*ec2.DeleteRouteTableOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for DeleteRouteTable") + } + + var r0 *ec2.DeleteRouteTableOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DeleteRouteTableInput, ...func(*ec2.Options)) (*ec2.DeleteRouteTableOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DeleteRouteTableInput, ...func(*ec2.Options)) *ec2.DeleteRouteTableOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.DeleteRouteTableOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.DeleteRouteTableInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_DeleteRouteTable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteRouteTable' +type MockEC2Clienter_DeleteRouteTable_Call struct { + *mock.Call +} + +// DeleteRouteTable is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.DeleteRouteTableInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) DeleteRouteTable(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_DeleteRouteTable_Call { + return &MockEC2Clienter_DeleteRouteTable_Call{Call: _e.mock.On("DeleteRouteTable", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_DeleteRouteTable_Call) Run(run func(ctx context.Context, params *ec2.DeleteRouteTableInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_DeleteRouteTable_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.DeleteRouteTableInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_DeleteRouteTable_Call) Return(_a0 *ec2.DeleteRouteTableOutput, _a1 error) *MockEC2Clienter_DeleteRouteTable_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_DeleteRouteTable_Call) RunAndReturn(run func(context.Context, *ec2.DeleteRouteTableInput, ...func(*ec2.Options)) (*ec2.DeleteRouteTableOutput, error)) *MockEC2Clienter_DeleteRouteTable_Call { + _c.Call.Return(run) + return _c +} + +// DeleteSecurityGroup provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) DeleteSecurityGroup(ctx context.Context, params *ec2.DeleteSecurityGroupInput, optFns ...func(*ec2.Options)) (*ec2.DeleteSecurityGroupOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for DeleteSecurityGroup") + } + + var r0 *ec2.DeleteSecurityGroupOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DeleteSecurityGroupInput, ...func(*ec2.Options)) (*ec2.DeleteSecurityGroupOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DeleteSecurityGroupInput, ...func(*ec2.Options)) *ec2.DeleteSecurityGroupOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.DeleteSecurityGroupOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.DeleteSecurityGroupInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_DeleteSecurityGroup_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteSecurityGroup' +type MockEC2Clienter_DeleteSecurityGroup_Call struct { + *mock.Call +} + +// DeleteSecurityGroup is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.DeleteSecurityGroupInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) DeleteSecurityGroup(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_DeleteSecurityGroup_Call { + return &MockEC2Clienter_DeleteSecurityGroup_Call{Call: _e.mock.On("DeleteSecurityGroup", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_DeleteSecurityGroup_Call) Run(run func(ctx context.Context, params *ec2.DeleteSecurityGroupInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_DeleteSecurityGroup_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.DeleteSecurityGroupInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_DeleteSecurityGroup_Call) Return(_a0 *ec2.DeleteSecurityGroupOutput, _a1 error) *MockEC2Clienter_DeleteSecurityGroup_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_DeleteSecurityGroup_Call) RunAndReturn(run func(context.Context, *ec2.DeleteSecurityGroupInput, ...func(*ec2.Options)) (*ec2.DeleteSecurityGroupOutput, error)) *MockEC2Clienter_DeleteSecurityGroup_Call { + _c.Call.Return(run) + return _c +} + +// DeleteSubnet provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) DeleteSubnet(ctx context.Context, params *ec2.DeleteSubnetInput, optFns ...func(*ec2.Options)) (*ec2.DeleteSubnetOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for DeleteSubnet") + } + + var r0 *ec2.DeleteSubnetOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DeleteSubnetInput, ...func(*ec2.Options)) (*ec2.DeleteSubnetOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DeleteSubnetInput, ...func(*ec2.Options)) *ec2.DeleteSubnetOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.DeleteSubnetOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.DeleteSubnetInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_DeleteSubnet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteSubnet' +type MockEC2Clienter_DeleteSubnet_Call struct { + *mock.Call +} + +// DeleteSubnet is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.DeleteSubnetInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) DeleteSubnet(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_DeleteSubnet_Call { + return &MockEC2Clienter_DeleteSubnet_Call{Call: _e.mock.On("DeleteSubnet", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_DeleteSubnet_Call) Run(run func(ctx context.Context, params *ec2.DeleteSubnetInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_DeleteSubnet_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.DeleteSubnetInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_DeleteSubnet_Call) Return(_a0 *ec2.DeleteSubnetOutput, _a1 error) *MockEC2Clienter_DeleteSubnet_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_DeleteSubnet_Call) RunAndReturn(run func(context.Context, *ec2.DeleteSubnetInput, ...func(*ec2.Options)) (*ec2.DeleteSubnetOutput, error)) *MockEC2Clienter_DeleteSubnet_Call { + _c.Call.Return(run) + return _c +} + +// DeleteVpc provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) DeleteVpc(ctx context.Context, params *ec2.DeleteVpcInput, optFns ...func(*ec2.Options)) (*ec2.DeleteVpcOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for DeleteVpc") + } + + var r0 *ec2.DeleteVpcOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DeleteVpcInput, ...func(*ec2.Options)) (*ec2.DeleteVpcOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DeleteVpcInput, ...func(*ec2.Options)) *ec2.DeleteVpcOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.DeleteVpcOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.DeleteVpcInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_DeleteVpc_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteVpc' +type MockEC2Clienter_DeleteVpc_Call struct { + *mock.Call +} + +// DeleteVpc is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.DeleteVpcInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) DeleteVpc(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_DeleteVpc_Call { + return &MockEC2Clienter_DeleteVpc_Call{Call: _e.mock.On("DeleteVpc", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_DeleteVpc_Call) Run(run func(ctx context.Context, params *ec2.DeleteVpcInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_DeleteVpc_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.DeleteVpcInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_DeleteVpc_Call) Return(_a0 *ec2.DeleteVpcOutput, _a1 error) *MockEC2Clienter_DeleteVpc_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_DeleteVpc_Call) RunAndReturn(run func(context.Context, *ec2.DeleteVpcInput, ...func(*ec2.Options)) (*ec2.DeleteVpcOutput, error)) *MockEC2Clienter_DeleteVpc_Call { + _c.Call.Return(run) + return _c +} + +// DescribeAvailabilityZones provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) DescribeAvailabilityZones(ctx context.Context, params *ec2.DescribeAvailabilityZonesInput, optFns ...func(*ec2.Options)) (*ec2.DescribeAvailabilityZonesOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for DescribeAvailabilityZones") + } + + var r0 *ec2.DescribeAvailabilityZonesOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeAvailabilityZonesInput, ...func(*ec2.Options)) (*ec2.DescribeAvailabilityZonesOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeAvailabilityZonesInput, ...func(*ec2.Options)) *ec2.DescribeAvailabilityZonesOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.DescribeAvailabilityZonesOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.DescribeAvailabilityZonesInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_DescribeAvailabilityZones_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DescribeAvailabilityZones' +type MockEC2Clienter_DescribeAvailabilityZones_Call struct { + *mock.Call +} + +// DescribeAvailabilityZones is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.DescribeAvailabilityZonesInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) DescribeAvailabilityZones(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_DescribeAvailabilityZones_Call { + return &MockEC2Clienter_DescribeAvailabilityZones_Call{Call: _e.mock.On("DescribeAvailabilityZones", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_DescribeAvailabilityZones_Call) Run(run func(ctx context.Context, params *ec2.DescribeAvailabilityZonesInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_DescribeAvailabilityZones_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.DescribeAvailabilityZonesInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_DescribeAvailabilityZones_Call) Return(_a0 *ec2.DescribeAvailabilityZonesOutput, _a1 error) *MockEC2Clienter_DescribeAvailabilityZones_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_DescribeAvailabilityZones_Call) RunAndReturn(run func(context.Context, *ec2.DescribeAvailabilityZonesInput, ...func(*ec2.Options)) (*ec2.DescribeAvailabilityZonesOutput, error)) *MockEC2Clienter_DescribeAvailabilityZones_Call { + _c.Call.Return(run) + return _c +} + +// DescribeImages provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) DescribeImages(ctx context.Context, params *ec2.DescribeImagesInput, optFns ...func(*ec2.Options)) (*ec2.DescribeImagesOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for DescribeImages") + } + + var r0 *ec2.DescribeImagesOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeImagesInput, ...func(*ec2.Options)) (*ec2.DescribeImagesOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeImagesInput, ...func(*ec2.Options)) *ec2.DescribeImagesOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.DescribeImagesOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.DescribeImagesInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_DescribeImages_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DescribeImages' +type MockEC2Clienter_DescribeImages_Call struct { + *mock.Call +} + +// DescribeImages is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.DescribeImagesInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) DescribeImages(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_DescribeImages_Call { + return &MockEC2Clienter_DescribeImages_Call{Call: _e.mock.On("DescribeImages", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_DescribeImages_Call) Run(run func(ctx context.Context, params *ec2.DescribeImagesInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_DescribeImages_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.DescribeImagesInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_DescribeImages_Call) Return(_a0 *ec2.DescribeImagesOutput, _a1 error) *MockEC2Clienter_DescribeImages_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_DescribeImages_Call) RunAndReturn(run func(context.Context, *ec2.DescribeImagesInput, ...func(*ec2.Options)) (*ec2.DescribeImagesOutput, error)) *MockEC2Clienter_DescribeImages_Call { + _c.Call.Return(run) + return _c +} + +// DescribeInstances provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) DescribeInstances(ctx context.Context, params *ec2.DescribeInstancesInput, optFns ...func(*ec2.Options)) (*ec2.DescribeInstancesOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for DescribeInstances") + } + + var r0 *ec2.DescribeInstancesOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeInstancesInput, ...func(*ec2.Options)) (*ec2.DescribeInstancesOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeInstancesInput, ...func(*ec2.Options)) *ec2.DescribeInstancesOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.DescribeInstancesOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.DescribeInstancesInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_DescribeInstances_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DescribeInstances' +type MockEC2Clienter_DescribeInstances_Call struct { + *mock.Call +} + +// DescribeInstances is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.DescribeInstancesInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) DescribeInstances(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_DescribeInstances_Call { + return &MockEC2Clienter_DescribeInstances_Call{Call: _e.mock.On("DescribeInstances", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_DescribeInstances_Call) Run(run func(ctx context.Context, params *ec2.DescribeInstancesInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_DescribeInstances_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.DescribeInstancesInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_DescribeInstances_Call) Return(_a0 *ec2.DescribeInstancesOutput, _a1 error) *MockEC2Clienter_DescribeInstances_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_DescribeInstances_Call) RunAndReturn(run func(context.Context, *ec2.DescribeInstancesInput, ...func(*ec2.Options)) (*ec2.DescribeInstancesOutput, error)) *MockEC2Clienter_DescribeInstances_Call { + _c.Call.Return(run) + return _c +} + +// DescribeInternetGateways provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) DescribeInternetGateways(ctx context.Context, params *ec2.DescribeInternetGatewaysInput, optFns ...func(*ec2.Options)) (*ec2.DescribeInternetGatewaysOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for DescribeInternetGateways") + } + + var r0 *ec2.DescribeInternetGatewaysOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeInternetGatewaysInput, ...func(*ec2.Options)) (*ec2.DescribeInternetGatewaysOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeInternetGatewaysInput, ...func(*ec2.Options)) *ec2.DescribeInternetGatewaysOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.DescribeInternetGatewaysOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.DescribeInternetGatewaysInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_DescribeInternetGateways_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DescribeInternetGateways' +type MockEC2Clienter_DescribeInternetGateways_Call struct { + *mock.Call +} + +// DescribeInternetGateways is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.DescribeInternetGatewaysInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) DescribeInternetGateways(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_DescribeInternetGateways_Call { + return &MockEC2Clienter_DescribeInternetGateways_Call{Call: _e.mock.On("DescribeInternetGateways", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_DescribeInternetGateways_Call) Run(run func(ctx context.Context, params *ec2.DescribeInternetGatewaysInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_DescribeInternetGateways_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.DescribeInternetGatewaysInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_DescribeInternetGateways_Call) Return(_a0 *ec2.DescribeInternetGatewaysOutput, _a1 error) *MockEC2Clienter_DescribeInternetGateways_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_DescribeInternetGateways_Call) RunAndReturn(run func(context.Context, *ec2.DescribeInternetGatewaysInput, ...func(*ec2.Options)) (*ec2.DescribeInternetGatewaysOutput, error)) *MockEC2Clienter_DescribeInternetGateways_Call { + _c.Call.Return(run) + return _c +} + +// DescribeRegions provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) DescribeRegions(ctx context.Context, params *ec2.DescribeRegionsInput, optFns ...func(*ec2.Options)) (*ec2.DescribeRegionsOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for DescribeRegions") + } + + var r0 *ec2.DescribeRegionsOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeRegionsInput, ...func(*ec2.Options)) (*ec2.DescribeRegionsOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeRegionsInput, ...func(*ec2.Options)) *ec2.DescribeRegionsOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.DescribeRegionsOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.DescribeRegionsInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_DescribeRegions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DescribeRegions' +type MockEC2Clienter_DescribeRegions_Call struct { + *mock.Call +} + +// DescribeRegions is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.DescribeRegionsInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) DescribeRegions(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_DescribeRegions_Call { + return &MockEC2Clienter_DescribeRegions_Call{Call: _e.mock.On("DescribeRegions", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_DescribeRegions_Call) Run(run func(ctx context.Context, params *ec2.DescribeRegionsInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_DescribeRegions_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.DescribeRegionsInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_DescribeRegions_Call) Return(_a0 *ec2.DescribeRegionsOutput, _a1 error) *MockEC2Clienter_DescribeRegions_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_DescribeRegions_Call) RunAndReturn(run func(context.Context, *ec2.DescribeRegionsInput, ...func(*ec2.Options)) (*ec2.DescribeRegionsOutput, error)) *MockEC2Clienter_DescribeRegions_Call { + _c.Call.Return(run) + return _c +} + +// DescribeRouteTables provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) DescribeRouteTables(ctx context.Context, params *ec2.DescribeRouteTablesInput, optFns ...func(*ec2.Options)) (*ec2.DescribeRouteTablesOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for DescribeRouteTables") + } + + var r0 *ec2.DescribeRouteTablesOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeRouteTablesInput, ...func(*ec2.Options)) (*ec2.DescribeRouteTablesOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeRouteTablesInput, ...func(*ec2.Options)) *ec2.DescribeRouteTablesOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.DescribeRouteTablesOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.DescribeRouteTablesInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_DescribeRouteTables_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DescribeRouteTables' +type MockEC2Clienter_DescribeRouteTables_Call struct { + *mock.Call +} + +// DescribeRouteTables is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.DescribeRouteTablesInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) DescribeRouteTables(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_DescribeRouteTables_Call { + return &MockEC2Clienter_DescribeRouteTables_Call{Call: _e.mock.On("DescribeRouteTables", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_DescribeRouteTables_Call) Run(run func(ctx context.Context, params *ec2.DescribeRouteTablesInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_DescribeRouteTables_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.DescribeRouteTablesInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_DescribeRouteTables_Call) Return(_a0 *ec2.DescribeRouteTablesOutput, _a1 error) *MockEC2Clienter_DescribeRouteTables_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_DescribeRouteTables_Call) RunAndReturn(run func(context.Context, *ec2.DescribeRouteTablesInput, ...func(*ec2.Options)) (*ec2.DescribeRouteTablesOutput, error)) *MockEC2Clienter_DescribeRouteTables_Call { + _c.Call.Return(run) + return _c +} + +// DescribeSecurityGroups provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) DescribeSecurityGroups(ctx context.Context, params *ec2.DescribeSecurityGroupsInput, optFns ...func(*ec2.Options)) (*ec2.DescribeSecurityGroupsOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for DescribeSecurityGroups") + } + + var r0 *ec2.DescribeSecurityGroupsOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeSecurityGroupsInput, ...func(*ec2.Options)) (*ec2.DescribeSecurityGroupsOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeSecurityGroupsInput, ...func(*ec2.Options)) *ec2.DescribeSecurityGroupsOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.DescribeSecurityGroupsOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.DescribeSecurityGroupsInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_DescribeSecurityGroups_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DescribeSecurityGroups' +type MockEC2Clienter_DescribeSecurityGroups_Call struct { + *mock.Call +} + +// DescribeSecurityGroups is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.DescribeSecurityGroupsInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) DescribeSecurityGroups(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_DescribeSecurityGroups_Call { + return &MockEC2Clienter_DescribeSecurityGroups_Call{Call: _e.mock.On("DescribeSecurityGroups", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_DescribeSecurityGroups_Call) Run(run func(ctx context.Context, params *ec2.DescribeSecurityGroupsInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_DescribeSecurityGroups_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.DescribeSecurityGroupsInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_DescribeSecurityGroups_Call) Return(_a0 *ec2.DescribeSecurityGroupsOutput, _a1 error) *MockEC2Clienter_DescribeSecurityGroups_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_DescribeSecurityGroups_Call) RunAndReturn(run func(context.Context, *ec2.DescribeSecurityGroupsInput, ...func(*ec2.Options)) (*ec2.DescribeSecurityGroupsOutput, error)) *MockEC2Clienter_DescribeSecurityGroups_Call { + _c.Call.Return(run) + return _c +} + +// DescribeSubnets provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) DescribeSubnets(ctx context.Context, params *ec2.DescribeSubnetsInput, optFns ...func(*ec2.Options)) (*ec2.DescribeSubnetsOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for DescribeSubnets") + } + + var r0 *ec2.DescribeSubnetsOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeSubnetsInput, ...func(*ec2.Options)) (*ec2.DescribeSubnetsOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeSubnetsInput, ...func(*ec2.Options)) *ec2.DescribeSubnetsOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.DescribeSubnetsOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.DescribeSubnetsInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_DescribeSubnets_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DescribeSubnets' +type MockEC2Clienter_DescribeSubnets_Call struct { + *mock.Call +} + +// DescribeSubnets is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.DescribeSubnetsInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) DescribeSubnets(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_DescribeSubnets_Call { + return &MockEC2Clienter_DescribeSubnets_Call{Call: _e.mock.On("DescribeSubnets", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_DescribeSubnets_Call) Run(run func(ctx context.Context, params *ec2.DescribeSubnetsInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_DescribeSubnets_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.DescribeSubnetsInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_DescribeSubnets_Call) Return(_a0 *ec2.DescribeSubnetsOutput, _a1 error) *MockEC2Clienter_DescribeSubnets_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_DescribeSubnets_Call) RunAndReturn(run func(context.Context, *ec2.DescribeSubnetsInput, ...func(*ec2.Options)) (*ec2.DescribeSubnetsOutput, error)) *MockEC2Clienter_DescribeSubnets_Call { + _c.Call.Return(run) + return _c +} + +// DescribeVpcs provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) DescribeVpcs(ctx context.Context, params *ec2.DescribeVpcsInput, optFns ...func(*ec2.Options)) (*ec2.DescribeVpcsOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for DescribeVpcs") + } + + var r0 *ec2.DescribeVpcsOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeVpcsInput, ...func(*ec2.Options)) (*ec2.DescribeVpcsOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DescribeVpcsInput, ...func(*ec2.Options)) *ec2.DescribeVpcsOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.DescribeVpcsOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.DescribeVpcsInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_DescribeVpcs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DescribeVpcs' +type MockEC2Clienter_DescribeVpcs_Call struct { + *mock.Call +} + +// DescribeVpcs is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.DescribeVpcsInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) DescribeVpcs(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_DescribeVpcs_Call { + return &MockEC2Clienter_DescribeVpcs_Call{Call: _e.mock.On("DescribeVpcs", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_DescribeVpcs_Call) Run(run func(ctx context.Context, params *ec2.DescribeVpcsInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_DescribeVpcs_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.DescribeVpcsInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_DescribeVpcs_Call) Return(_a0 *ec2.DescribeVpcsOutput, _a1 error) *MockEC2Clienter_DescribeVpcs_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_DescribeVpcs_Call) RunAndReturn(run func(context.Context, *ec2.DescribeVpcsInput, ...func(*ec2.Options)) (*ec2.DescribeVpcsOutput, error)) *MockEC2Clienter_DescribeVpcs_Call { + _c.Call.Return(run) + return _c +} + +// DetachInternetGateway provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) DetachInternetGateway(ctx context.Context, params *ec2.DetachInternetGatewayInput, optFns ...func(*ec2.Options)) (*ec2.DetachInternetGatewayOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for DetachInternetGateway") + } + + var r0 *ec2.DetachInternetGatewayOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DetachInternetGatewayInput, ...func(*ec2.Options)) (*ec2.DetachInternetGatewayOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DetachInternetGatewayInput, ...func(*ec2.Options)) *ec2.DetachInternetGatewayOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.DetachInternetGatewayOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.DetachInternetGatewayInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_DetachInternetGateway_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DetachInternetGateway' +type MockEC2Clienter_DetachInternetGateway_Call struct { + *mock.Call +} + +// DetachInternetGateway is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.DetachInternetGatewayInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) DetachInternetGateway(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_DetachInternetGateway_Call { + return &MockEC2Clienter_DetachInternetGateway_Call{Call: _e.mock.On("DetachInternetGateway", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_DetachInternetGateway_Call) Run(run func(ctx context.Context, params *ec2.DetachInternetGatewayInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_DetachInternetGateway_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.DetachInternetGatewayInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_DetachInternetGateway_Call) Return(_a0 *ec2.DetachInternetGatewayOutput, _a1 error) *MockEC2Clienter_DetachInternetGateway_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_DetachInternetGateway_Call) RunAndReturn(run func(context.Context, *ec2.DetachInternetGatewayInput, ...func(*ec2.Options)) (*ec2.DetachInternetGatewayOutput, error)) *MockEC2Clienter_DetachInternetGateway_Call { + _c.Call.Return(run) + return _c +} + +// DisassociateRouteTable provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) DisassociateRouteTable(ctx context.Context, params *ec2.DisassociateRouteTableInput, optFns ...func(*ec2.Options)) (*ec2.DisassociateRouteTableOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for DisassociateRouteTable") + } + + var r0 *ec2.DisassociateRouteTableOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DisassociateRouteTableInput, ...func(*ec2.Options)) (*ec2.DisassociateRouteTableOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.DisassociateRouteTableInput, ...func(*ec2.Options)) *ec2.DisassociateRouteTableOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.DisassociateRouteTableOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.DisassociateRouteTableInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_DisassociateRouteTable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DisassociateRouteTable' +type MockEC2Clienter_DisassociateRouteTable_Call struct { + *mock.Call +} + +// DisassociateRouteTable is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.DisassociateRouteTableInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) DisassociateRouteTable(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_DisassociateRouteTable_Call { + return &MockEC2Clienter_DisassociateRouteTable_Call{Call: _e.mock.On("DisassociateRouteTable", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_DisassociateRouteTable_Call) Run(run func(ctx context.Context, params *ec2.DisassociateRouteTableInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_DisassociateRouteTable_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.DisassociateRouteTableInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_DisassociateRouteTable_Call) Return(_a0 *ec2.DisassociateRouteTableOutput, _a1 error) *MockEC2Clienter_DisassociateRouteTable_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_DisassociateRouteTable_Call) RunAndReturn(run func(context.Context, *ec2.DisassociateRouteTableInput, ...func(*ec2.Options)) (*ec2.DisassociateRouteTableOutput, error)) *MockEC2Clienter_DisassociateRouteTable_Call { + _c.Call.Return(run) + return _c +} + +// ModifyVpcAttribute provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) ModifyVpcAttribute(ctx context.Context, params *ec2.ModifyVpcAttributeInput, optFns ...func(*ec2.Options)) (*ec2.ModifyVpcAttributeOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for ModifyVpcAttribute") + } + + var r0 *ec2.ModifyVpcAttributeOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.ModifyVpcAttributeInput, ...func(*ec2.Options)) (*ec2.ModifyVpcAttributeOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.ModifyVpcAttributeInput, ...func(*ec2.Options)) *ec2.ModifyVpcAttributeOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.ModifyVpcAttributeOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.ModifyVpcAttributeInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_ModifyVpcAttribute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ModifyVpcAttribute' +type MockEC2Clienter_ModifyVpcAttribute_Call struct { + *mock.Call +} + +// ModifyVpcAttribute is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.ModifyVpcAttributeInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) ModifyVpcAttribute(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_ModifyVpcAttribute_Call { + return &MockEC2Clienter_ModifyVpcAttribute_Call{Call: _e.mock.On("ModifyVpcAttribute", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_ModifyVpcAttribute_Call) Run(run func(ctx context.Context, params *ec2.ModifyVpcAttributeInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_ModifyVpcAttribute_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.ModifyVpcAttributeInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_ModifyVpcAttribute_Call) Return(_a0 *ec2.ModifyVpcAttributeOutput, _a1 error) *MockEC2Clienter_ModifyVpcAttribute_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_ModifyVpcAttribute_Call) RunAndReturn(run func(context.Context, *ec2.ModifyVpcAttributeInput, ...func(*ec2.Options)) (*ec2.ModifyVpcAttributeOutput, error)) *MockEC2Clienter_ModifyVpcAttribute_Call { + _c.Call.Return(run) + return _c +} + +// RunInstances provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) RunInstances(ctx context.Context, params *ec2.RunInstancesInput, optFns ...func(*ec2.Options)) (*ec2.RunInstancesOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for RunInstances") + } + + var r0 *ec2.RunInstancesOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.RunInstancesInput, ...func(*ec2.Options)) (*ec2.RunInstancesOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.RunInstancesInput, ...func(*ec2.Options)) *ec2.RunInstancesOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.RunInstancesOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.RunInstancesInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_RunInstances_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RunInstances' +type MockEC2Clienter_RunInstances_Call struct { + *mock.Call +} + +// RunInstances is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.RunInstancesInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) RunInstances(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_RunInstances_Call { + return &MockEC2Clienter_RunInstances_Call{Call: _e.mock.On("RunInstances", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_RunInstances_Call) Run(run func(ctx context.Context, params *ec2.RunInstancesInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_RunInstances_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.RunInstancesInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_RunInstances_Call) Return(_a0 *ec2.RunInstancesOutput, _a1 error) *MockEC2Clienter_RunInstances_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_RunInstances_Call) RunAndReturn(run func(context.Context, *ec2.RunInstancesInput, ...func(*ec2.Options)) (*ec2.RunInstancesOutput, error)) *MockEC2Clienter_RunInstances_Call { + _c.Call.Return(run) + return _c +} + +// TerminateInstances provides a mock function with given fields: ctx, params, optFns +func (_m *MockEC2Clienter) TerminateInstances(ctx context.Context, params *ec2.TerminateInstancesInput, optFns ...func(*ec2.Options)) (*ec2.TerminateInstancesOutput, error) { + _va := make([]interface{}, len(optFns)) + for _i := range optFns { + _va[_i] = optFns[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, params) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for TerminateInstances") + } + + var r0 *ec2.TerminateInstancesOutput + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *ec2.TerminateInstancesInput, ...func(*ec2.Options)) (*ec2.TerminateInstancesOutput, error)); ok { + return rf(ctx, params, optFns...) + } + if rf, ok := ret.Get(0).(func(context.Context, *ec2.TerminateInstancesInput, ...func(*ec2.Options)) *ec2.TerminateInstancesOutput); ok { + r0 = rf(ctx, params, optFns...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ec2.TerminateInstancesOutput) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *ec2.TerminateInstancesInput, ...func(*ec2.Options)) error); ok { + r1 = rf(ctx, params, optFns...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEC2Clienter_TerminateInstances_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TerminateInstances' +type MockEC2Clienter_TerminateInstances_Call struct { + *mock.Call +} + +// TerminateInstances is a helper method to define mock.On call +// - ctx context.Context +// - params *ec2.TerminateInstancesInput +// - optFns ...func(*ec2.Options) +func (_e *MockEC2Clienter_Expecter) TerminateInstances(ctx interface{}, params interface{}, optFns ...interface{}) *MockEC2Clienter_TerminateInstances_Call { + return &MockEC2Clienter_TerminateInstances_Call{Call: _e.mock.On("TerminateInstances", + append([]interface{}{ctx, params}, optFns...)...)} +} + +func (_c *MockEC2Clienter_TerminateInstances_Call) Run(run func(ctx context.Context, params *ec2.TerminateInstancesInput, optFns ...func(*ec2.Options))) *MockEC2Clienter_TerminateInstances_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]func(*ec2.Options), len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(func(*ec2.Options)) + } + } + run(args[0].(context.Context), args[1].(*ec2.TerminateInstancesInput), variadicArgs...) + }) + return _c +} + +func (_c *MockEC2Clienter_TerminateInstances_Call) Return(_a0 *ec2.TerminateInstancesOutput, _a1 error) *MockEC2Clienter_TerminateInstances_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEC2Clienter_TerminateInstances_Call) RunAndReturn(run func(context.Context, *ec2.TerminateInstancesInput, ...func(*ec2.Options)) (*ec2.TerminateInstancesOutput, error)) *MockEC2Clienter_TerminateInstances_Call { + _c.Call.Return(run) + return _c +} + +// NewMockEC2Clienter creates a new instance of MockEC2Clienter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockEC2Clienter(t interface { + mock.TestingT + Cleanup(func()) +}) *MockEC2Clienter { + mock := &MockEC2Clienter{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/pkg/models/interfaces/sshutils/mocks/azure/mock_AzureClienter.go b/pkg/models/interfaces/sshutils/mocks/azure/mock_AzureClienter.go new file mode 100644 index 00000000..41afb75b --- /dev/null +++ b/pkg/models/interfaces/sshutils/mocks/azure/mock_AzureClienter.go @@ -0,0 +1,856 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package azure_interface + +import ( + armcompute "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute" + armnetwork "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork" + + armresources "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources" + + armsubscription "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/subscription/armsubscription" + + azure_interface "github.com/bacalhau-project/andaime/pkg/models/interfaces/azure" + + context "context" + + mock "github.com/stretchr/testify/mock" + + runtime "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" +) + +// MockAzureClienter is an autogenerated mock type for the AzureClienter type +type MockAzureClienter struct { + mock.Mock +} + +type MockAzureClienter_Expecter struct { + mock *mock.Mock +} + +func (_m *MockAzureClienter) EXPECT() *MockAzureClienter_Expecter { + return &MockAzureClienter_Expecter{mock: &_m.Mock} +} + +// DeployTemplate provides a mock function with given fields: ctx, resourceGroupName, deploymentName, template, params, tags +func (_m *MockAzureClienter) DeployTemplate(ctx context.Context, resourceGroupName string, deploymentName string, template map[string]interface{}, params map[string]interface{}, tags map[string]*string) (azure_interface.Pollerer, error) { + ret := _m.Called(ctx, resourceGroupName, deploymentName, template, params, tags) + + if len(ret) == 0 { + panic("no return value specified for DeployTemplate") + } + + var r0 azure_interface.Pollerer + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, map[string]interface{}, map[string]interface{}, map[string]*string) (azure_interface.Pollerer, error)); ok { + return rf(ctx, resourceGroupName, deploymentName, template, params, tags) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string, map[string]interface{}, map[string]interface{}, map[string]*string) azure_interface.Pollerer); ok { + r0 = rf(ctx, resourceGroupName, deploymentName, template, params, tags) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(azure_interface.Pollerer) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string, map[string]interface{}, map[string]interface{}, map[string]*string) error); ok { + r1 = rf(ctx, resourceGroupName, deploymentName, template, params, tags) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockAzureClienter_DeployTemplate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeployTemplate' +type MockAzureClienter_DeployTemplate_Call struct { + *mock.Call +} + +// DeployTemplate is a helper method to define mock.On call +// - ctx context.Context +// - resourceGroupName string +// - deploymentName string +// - template map[string]interface{} +// - params map[string]interface{} +// - tags map[string]*string +func (_e *MockAzureClienter_Expecter) DeployTemplate(ctx interface{}, resourceGroupName interface{}, deploymentName interface{}, template interface{}, params interface{}, tags interface{}) *MockAzureClienter_DeployTemplate_Call { + return &MockAzureClienter_DeployTemplate_Call{Call: _e.mock.On("DeployTemplate", ctx, resourceGroupName, deploymentName, template, params, tags)} +} + +func (_c *MockAzureClienter_DeployTemplate_Call) Run(run func(ctx context.Context, resourceGroupName string, deploymentName string, template map[string]interface{}, params map[string]interface{}, tags map[string]*string)) *MockAzureClienter_DeployTemplate_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(map[string]interface{}), args[4].(map[string]interface{}), args[5].(map[string]*string)) + }) + return _c +} + +func (_c *MockAzureClienter_DeployTemplate_Call) Return(_a0 azure_interface.Pollerer, _a1 error) *MockAzureClienter_DeployTemplate_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockAzureClienter_DeployTemplate_Call) RunAndReturn(run func(context.Context, string, string, map[string]interface{}, map[string]interface{}, map[string]*string) (azure_interface.Pollerer, error)) *MockAzureClienter_DeployTemplate_Call { + _c.Call.Return(run) + return _c +} + +// DestroyResourceGroup provides a mock function with given fields: ctx, resourceGroupName +func (_m *MockAzureClienter) DestroyResourceGroup(ctx context.Context, resourceGroupName string) error { + ret := _m.Called(ctx, resourceGroupName) + + if len(ret) == 0 { + panic("no return value specified for DestroyResourceGroup") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = rf(ctx, resourceGroupName) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockAzureClienter_DestroyResourceGroup_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DestroyResourceGroup' +type MockAzureClienter_DestroyResourceGroup_Call struct { + *mock.Call +} + +// DestroyResourceGroup is a helper method to define mock.On call +// - ctx context.Context +// - resourceGroupName string +func (_e *MockAzureClienter_Expecter) DestroyResourceGroup(ctx interface{}, resourceGroupName interface{}) *MockAzureClienter_DestroyResourceGroup_Call { + return &MockAzureClienter_DestroyResourceGroup_Call{Call: _e.mock.On("DestroyResourceGroup", ctx, resourceGroupName)} +} + +func (_c *MockAzureClienter_DestroyResourceGroup_Call) Run(run func(ctx context.Context, resourceGroupName string)) *MockAzureClienter_DestroyResourceGroup_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockAzureClienter_DestroyResourceGroup_Call) Return(_a0 error) *MockAzureClienter_DestroyResourceGroup_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockAzureClienter_DestroyResourceGroup_Call) RunAndReturn(run func(context.Context, string) error) *MockAzureClienter_DestroyResourceGroup_Call { + _c.Call.Return(run) + return _c +} + +// GetNetworkInterface provides a mock function with given fields: ctx, resourceGroupName, networkInterfaceName +func (_m *MockAzureClienter) GetNetworkInterface(ctx context.Context, resourceGroupName string, networkInterfaceName string) (*armnetwork.Interface, error) { + ret := _m.Called(ctx, resourceGroupName, networkInterfaceName) + + if len(ret) == 0 { + panic("no return value specified for GetNetworkInterface") + } + + var r0 *armnetwork.Interface + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) (*armnetwork.Interface, error)); ok { + return rf(ctx, resourceGroupName, networkInterfaceName) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string) *armnetwork.Interface); ok { + r0 = rf(ctx, resourceGroupName, networkInterfaceName) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*armnetwork.Interface) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { + r1 = rf(ctx, resourceGroupName, networkInterfaceName) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockAzureClienter_GetNetworkInterface_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetNetworkInterface' +type MockAzureClienter_GetNetworkInterface_Call struct { + *mock.Call +} + +// GetNetworkInterface is a helper method to define mock.On call +// - ctx context.Context +// - resourceGroupName string +// - networkInterfaceName string +func (_e *MockAzureClienter_Expecter) GetNetworkInterface(ctx interface{}, resourceGroupName interface{}, networkInterfaceName interface{}) *MockAzureClienter_GetNetworkInterface_Call { + return &MockAzureClienter_GetNetworkInterface_Call{Call: _e.mock.On("GetNetworkInterface", ctx, resourceGroupName, networkInterfaceName)} +} + +func (_c *MockAzureClienter_GetNetworkInterface_Call) Run(run func(ctx context.Context, resourceGroupName string, networkInterfaceName string)) *MockAzureClienter_GetNetworkInterface_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *MockAzureClienter_GetNetworkInterface_Call) Return(_a0 *armnetwork.Interface, _a1 error) *MockAzureClienter_GetNetworkInterface_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockAzureClienter_GetNetworkInterface_Call) RunAndReturn(run func(context.Context, string, string) (*armnetwork.Interface, error)) *MockAzureClienter_GetNetworkInterface_Call { + _c.Call.Return(run) + return _c +} + +// GetOrCreateResourceGroup provides a mock function with given fields: ctx, resourceGroupName, location, tags +func (_m *MockAzureClienter) GetOrCreateResourceGroup(ctx context.Context, resourceGroupName string, location string, tags map[string]string) (*armresources.ResourceGroup, error) { + ret := _m.Called(ctx, resourceGroupName, location, tags) + + if len(ret) == 0 { + panic("no return value specified for GetOrCreateResourceGroup") + } + + var r0 *armresources.ResourceGroup + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, map[string]string) (*armresources.ResourceGroup, error)); ok { + return rf(ctx, resourceGroupName, location, tags) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string, map[string]string) *armresources.ResourceGroup); ok { + r0 = rf(ctx, resourceGroupName, location, tags) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*armresources.ResourceGroup) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string, map[string]string) error); ok { + r1 = rf(ctx, resourceGroupName, location, tags) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockAzureClienter_GetOrCreateResourceGroup_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetOrCreateResourceGroup' +type MockAzureClienter_GetOrCreateResourceGroup_Call struct { + *mock.Call +} + +// GetOrCreateResourceGroup is a helper method to define mock.On call +// - ctx context.Context +// - resourceGroupName string +// - location string +// - tags map[string]string +func (_e *MockAzureClienter_Expecter) GetOrCreateResourceGroup(ctx interface{}, resourceGroupName interface{}, location interface{}, tags interface{}) *MockAzureClienter_GetOrCreateResourceGroup_Call { + return &MockAzureClienter_GetOrCreateResourceGroup_Call{Call: _e.mock.On("GetOrCreateResourceGroup", ctx, resourceGroupName, location, tags)} +} + +func (_c *MockAzureClienter_GetOrCreateResourceGroup_Call) Run(run func(ctx context.Context, resourceGroupName string, location string, tags map[string]string)) *MockAzureClienter_GetOrCreateResourceGroup_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(map[string]string)) + }) + return _c +} + +func (_c *MockAzureClienter_GetOrCreateResourceGroup_Call) Return(_a0 *armresources.ResourceGroup, _a1 error) *MockAzureClienter_GetOrCreateResourceGroup_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockAzureClienter_GetOrCreateResourceGroup_Call) RunAndReturn(run func(context.Context, string, string, map[string]string) (*armresources.ResourceGroup, error)) *MockAzureClienter_GetOrCreateResourceGroup_Call { + _c.Call.Return(run) + return _c +} + +// GetPublicIPAddress provides a mock function with given fields: ctx, resourceGroupName, publicIPAddress +func (_m *MockAzureClienter) GetPublicIPAddress(ctx context.Context, resourceGroupName string, publicIPAddress *armnetwork.PublicIPAddress) (string, error) { + ret := _m.Called(ctx, resourceGroupName, publicIPAddress) + + if len(ret) == 0 { + panic("no return value specified for GetPublicIPAddress") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, *armnetwork.PublicIPAddress) (string, error)); ok { + return rf(ctx, resourceGroupName, publicIPAddress) + } + if rf, ok := ret.Get(0).(func(context.Context, string, *armnetwork.PublicIPAddress) string); ok { + r0 = rf(ctx, resourceGroupName, publicIPAddress) + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func(context.Context, string, *armnetwork.PublicIPAddress) error); ok { + r1 = rf(ctx, resourceGroupName, publicIPAddress) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockAzureClienter_GetPublicIPAddress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPublicIPAddress' +type MockAzureClienter_GetPublicIPAddress_Call struct { + *mock.Call +} + +// GetPublicIPAddress is a helper method to define mock.On call +// - ctx context.Context +// - resourceGroupName string +// - publicIPAddress *armnetwork.PublicIPAddress +func (_e *MockAzureClienter_Expecter) GetPublicIPAddress(ctx interface{}, resourceGroupName interface{}, publicIPAddress interface{}) *MockAzureClienter_GetPublicIPAddress_Call { + return &MockAzureClienter_GetPublicIPAddress_Call{Call: _e.mock.On("GetPublicIPAddress", ctx, resourceGroupName, publicIPAddress)} +} + +func (_c *MockAzureClienter_GetPublicIPAddress_Call) Run(run func(ctx context.Context, resourceGroupName string, publicIPAddress *armnetwork.PublicIPAddress)) *MockAzureClienter_GetPublicIPAddress_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(*armnetwork.PublicIPAddress)) + }) + return _c +} + +func (_c *MockAzureClienter_GetPublicIPAddress_Call) Return(_a0 string, _a1 error) *MockAzureClienter_GetPublicIPAddress_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockAzureClienter_GetPublicIPAddress_Call) RunAndReturn(run func(context.Context, string, *armnetwork.PublicIPAddress) (string, error)) *MockAzureClienter_GetPublicIPAddress_Call { + _c.Call.Return(run) + return _c +} + +// GetResources provides a mock function with given fields: ctx, subscriptionID, resourceGroupName, tags +func (_m *MockAzureClienter) GetResources(ctx context.Context, subscriptionID string, resourceGroupName string, tags map[string]*string) ([]interface{}, error) { + ret := _m.Called(ctx, subscriptionID, resourceGroupName, tags) + + if len(ret) == 0 { + panic("no return value specified for GetResources") + } + + var r0 []interface{} + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, map[string]*string) ([]interface{}, error)); ok { + return rf(ctx, subscriptionID, resourceGroupName, tags) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string, map[string]*string) []interface{}); ok { + r0 = rf(ctx, subscriptionID, resourceGroupName, tags) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]interface{}) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string, map[string]*string) error); ok { + r1 = rf(ctx, subscriptionID, resourceGroupName, tags) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockAzureClienter_GetResources_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetResources' +type MockAzureClienter_GetResources_Call struct { + *mock.Call +} + +// GetResources is a helper method to define mock.On call +// - ctx context.Context +// - subscriptionID string +// - resourceGroupName string +// - tags map[string]*string +func (_e *MockAzureClienter_Expecter) GetResources(ctx interface{}, subscriptionID interface{}, resourceGroupName interface{}, tags interface{}) *MockAzureClienter_GetResources_Call { + return &MockAzureClienter_GetResources_Call{Call: _e.mock.On("GetResources", ctx, subscriptionID, resourceGroupName, tags)} +} + +func (_c *MockAzureClienter_GetResources_Call) Run(run func(ctx context.Context, subscriptionID string, resourceGroupName string, tags map[string]*string)) *MockAzureClienter_GetResources_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(map[string]*string)) + }) + return _c +} + +func (_c *MockAzureClienter_GetResources_Call) Return(_a0 []interface{}, _a1 error) *MockAzureClienter_GetResources_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockAzureClienter_GetResources_Call) RunAndReturn(run func(context.Context, string, string, map[string]*string) ([]interface{}, error)) *MockAzureClienter_GetResources_Call { + _c.Call.Return(run) + return _c +} + +// GetSKUsByLocation provides a mock function with given fields: ctx, location +func (_m *MockAzureClienter) GetSKUsByLocation(ctx context.Context, location string) ([]armcompute.ResourceSKU, error) { + ret := _m.Called(ctx, location) + + if len(ret) == 0 { + panic("no return value specified for GetSKUsByLocation") + } + + var r0 []armcompute.ResourceSKU + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) ([]armcompute.ResourceSKU, error)); ok { + return rf(ctx, location) + } + if rf, ok := ret.Get(0).(func(context.Context, string) []armcompute.ResourceSKU); ok { + r0 = rf(ctx, location) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]armcompute.ResourceSKU) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, location) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockAzureClienter_GetSKUsByLocation_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSKUsByLocation' +type MockAzureClienter_GetSKUsByLocation_Call struct { + *mock.Call +} + +// GetSKUsByLocation is a helper method to define mock.On call +// - ctx context.Context +// - location string +func (_e *MockAzureClienter_Expecter) GetSKUsByLocation(ctx interface{}, location interface{}) *MockAzureClienter_GetSKUsByLocation_Call { + return &MockAzureClienter_GetSKUsByLocation_Call{Call: _e.mock.On("GetSKUsByLocation", ctx, location)} +} + +func (_c *MockAzureClienter_GetSKUsByLocation_Call) Run(run func(ctx context.Context, location string)) *MockAzureClienter_GetSKUsByLocation_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockAzureClienter_GetSKUsByLocation_Call) Return(_a0 []armcompute.ResourceSKU, _a1 error) *MockAzureClienter_GetSKUsByLocation_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockAzureClienter_GetSKUsByLocation_Call) RunAndReturn(run func(context.Context, string) ([]armcompute.ResourceSKU, error)) *MockAzureClienter_GetSKUsByLocation_Call { + _c.Call.Return(run) + return _c +} + +// GetVMExternalIP provides a mock function with given fields: ctx, vmName, locationData +func (_m *MockAzureClienter) GetVMExternalIP(ctx context.Context, vmName string, locationData map[string]string) (string, error) { + ret := _m.Called(ctx, vmName, locationData) + + if len(ret) == 0 { + panic("no return value specified for GetVMExternalIP") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, map[string]string) (string, error)); ok { + return rf(ctx, vmName, locationData) + } + if rf, ok := ret.Get(0).(func(context.Context, string, map[string]string) string); ok { + r0 = rf(ctx, vmName, locationData) + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func(context.Context, string, map[string]string) error); ok { + r1 = rf(ctx, vmName, locationData) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockAzureClienter_GetVMExternalIP_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetVMExternalIP' +type MockAzureClienter_GetVMExternalIP_Call struct { + *mock.Call +} + +// GetVMExternalIP is a helper method to define mock.On call +// - ctx context.Context +// - vmName string +// - locationData map[string]string +func (_e *MockAzureClienter_Expecter) GetVMExternalIP(ctx interface{}, vmName interface{}, locationData interface{}) *MockAzureClienter_GetVMExternalIP_Call { + return &MockAzureClienter_GetVMExternalIP_Call{Call: _e.mock.On("GetVMExternalIP", ctx, vmName, locationData)} +} + +func (_c *MockAzureClienter_GetVMExternalIP_Call) Run(run func(ctx context.Context, vmName string, locationData map[string]string)) *MockAzureClienter_GetVMExternalIP_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(map[string]string)) + }) + return _c +} + +func (_c *MockAzureClienter_GetVMExternalIP_Call) Return(_a0 string, _a1 error) *MockAzureClienter_GetVMExternalIP_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockAzureClienter_GetVMExternalIP_Call) RunAndReturn(run func(context.Context, string, map[string]string) (string, error)) *MockAzureClienter_GetVMExternalIP_Call { + _c.Call.Return(run) + return _c +} + +// GetVirtualMachine provides a mock function with given fields: ctx, resourceGroupName, vmName +func (_m *MockAzureClienter) GetVirtualMachine(ctx context.Context, resourceGroupName string, vmName string) (*armcompute.VirtualMachine, error) { + ret := _m.Called(ctx, resourceGroupName, vmName) + + if len(ret) == 0 { + panic("no return value specified for GetVirtualMachine") + } + + var r0 *armcompute.VirtualMachine + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) (*armcompute.VirtualMachine, error)); ok { + return rf(ctx, resourceGroupName, vmName) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string) *armcompute.VirtualMachine); ok { + r0 = rf(ctx, resourceGroupName, vmName) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*armcompute.VirtualMachine) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { + r1 = rf(ctx, resourceGroupName, vmName) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockAzureClienter_GetVirtualMachine_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetVirtualMachine' +type MockAzureClienter_GetVirtualMachine_Call struct { + *mock.Call +} + +// GetVirtualMachine is a helper method to define mock.On call +// - ctx context.Context +// - resourceGroupName string +// - vmName string +func (_e *MockAzureClienter_Expecter) GetVirtualMachine(ctx interface{}, resourceGroupName interface{}, vmName interface{}) *MockAzureClienter_GetVirtualMachine_Call { + return &MockAzureClienter_GetVirtualMachine_Call{Call: _e.mock.On("GetVirtualMachine", ctx, resourceGroupName, vmName)} +} + +func (_c *MockAzureClienter_GetVirtualMachine_Call) Run(run func(ctx context.Context, resourceGroupName string, vmName string)) *MockAzureClienter_GetVirtualMachine_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *MockAzureClienter_GetVirtualMachine_Call) Return(_a0 *armcompute.VirtualMachine, _a1 error) *MockAzureClienter_GetVirtualMachine_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockAzureClienter_GetVirtualMachine_Call) RunAndReturn(run func(context.Context, string, string) (*armcompute.VirtualMachine, error)) *MockAzureClienter_GetVirtualMachine_Call { + _c.Call.Return(run) + return _c +} + +// ListAllResourceGroups provides a mock function with given fields: ctx +func (_m *MockAzureClienter) ListAllResourceGroups(ctx context.Context) ([]*armresources.ResourceGroup, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for ListAllResourceGroups") + } + + var r0 []*armresources.ResourceGroup + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) ([]*armresources.ResourceGroup, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) []*armresources.ResourceGroup); ok { + r0 = rf(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*armresources.ResourceGroup) + } + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockAzureClienter_ListAllResourceGroups_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListAllResourceGroups' +type MockAzureClienter_ListAllResourceGroups_Call struct { + *mock.Call +} + +// ListAllResourceGroups is a helper method to define mock.On call +// - ctx context.Context +func (_e *MockAzureClienter_Expecter) ListAllResourceGroups(ctx interface{}) *MockAzureClienter_ListAllResourceGroups_Call { + return &MockAzureClienter_ListAllResourceGroups_Call{Call: _e.mock.On("ListAllResourceGroups", ctx)} +} + +func (_c *MockAzureClienter_ListAllResourceGroups_Call) Run(run func(ctx context.Context)) *MockAzureClienter_ListAllResourceGroups_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *MockAzureClienter_ListAllResourceGroups_Call) Return(_a0 []*armresources.ResourceGroup, _a1 error) *MockAzureClienter_ListAllResourceGroups_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockAzureClienter_ListAllResourceGroups_Call) RunAndReturn(run func(context.Context) ([]*armresources.ResourceGroup, error)) *MockAzureClienter_ListAllResourceGroups_Call { + _c.Call.Return(run) + return _c +} + +// ListAllResourcesInSubscription provides a mock function with given fields: ctx, subscriptionID, tags +func (_m *MockAzureClienter) ListAllResourcesInSubscription(ctx context.Context, subscriptionID string, tags map[string]*string) ([]interface{}, error) { + ret := _m.Called(ctx, subscriptionID, tags) + + if len(ret) == 0 { + panic("no return value specified for ListAllResourcesInSubscription") + } + + var r0 []interface{} + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, map[string]*string) ([]interface{}, error)); ok { + return rf(ctx, subscriptionID, tags) + } + if rf, ok := ret.Get(0).(func(context.Context, string, map[string]*string) []interface{}); ok { + r0 = rf(ctx, subscriptionID, tags) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]interface{}) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, map[string]*string) error); ok { + r1 = rf(ctx, subscriptionID, tags) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockAzureClienter_ListAllResourcesInSubscription_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListAllResourcesInSubscription' +type MockAzureClienter_ListAllResourcesInSubscription_Call struct { + *mock.Call +} + +// ListAllResourcesInSubscription is a helper method to define mock.On call +// - ctx context.Context +// - subscriptionID string +// - tags map[string]*string +func (_e *MockAzureClienter_Expecter) ListAllResourcesInSubscription(ctx interface{}, subscriptionID interface{}, tags interface{}) *MockAzureClienter_ListAllResourcesInSubscription_Call { + return &MockAzureClienter_ListAllResourcesInSubscription_Call{Call: _e.mock.On("ListAllResourcesInSubscription", ctx, subscriptionID, tags)} +} + +func (_c *MockAzureClienter_ListAllResourcesInSubscription_Call) Run(run func(ctx context.Context, subscriptionID string, tags map[string]*string)) *MockAzureClienter_ListAllResourcesInSubscription_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(map[string]*string)) + }) + return _c +} + +func (_c *MockAzureClienter_ListAllResourcesInSubscription_Call) Return(_a0 []interface{}, _a1 error) *MockAzureClienter_ListAllResourcesInSubscription_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockAzureClienter_ListAllResourcesInSubscription_Call) RunAndReturn(run func(context.Context, string, map[string]*string) ([]interface{}, error)) *MockAzureClienter_ListAllResourcesInSubscription_Call { + _c.Call.Return(run) + return _c +} + +// NewSubscriptionListPager provides a mock function with given fields: ctx, options +func (_m *MockAzureClienter) NewSubscriptionListPager(ctx context.Context, options *armsubscription.SubscriptionsClientListOptions) *runtime.Pager[armsubscription.SubscriptionsClientListResponse] { + ret := _m.Called(ctx, options) + + if len(ret) == 0 { + panic("no return value specified for NewSubscriptionListPager") + } + + var r0 *runtime.Pager[armsubscription.SubscriptionsClientListResponse] + if rf, ok := ret.Get(0).(func(context.Context, *armsubscription.SubscriptionsClientListOptions) *runtime.Pager[armsubscription.SubscriptionsClientListResponse]); ok { + r0 = rf(ctx, options) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*runtime.Pager[armsubscription.SubscriptionsClientListResponse]) + } + } + + return r0 +} + +// MockAzureClienter_NewSubscriptionListPager_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewSubscriptionListPager' +type MockAzureClienter_NewSubscriptionListPager_Call struct { + *mock.Call +} + +// NewSubscriptionListPager is a helper method to define mock.On call +// - ctx context.Context +// - options *armsubscription.SubscriptionsClientListOptions +func (_e *MockAzureClienter_Expecter) NewSubscriptionListPager(ctx interface{}, options interface{}) *MockAzureClienter_NewSubscriptionListPager_Call { + return &MockAzureClienter_NewSubscriptionListPager_Call{Call: _e.mock.On("NewSubscriptionListPager", ctx, options)} +} + +func (_c *MockAzureClienter_NewSubscriptionListPager_Call) Run(run func(ctx context.Context, options *armsubscription.SubscriptionsClientListOptions)) *MockAzureClienter_NewSubscriptionListPager_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*armsubscription.SubscriptionsClientListOptions)) + }) + return _c +} + +func (_c *MockAzureClienter_NewSubscriptionListPager_Call) Return(_a0 *runtime.Pager[armsubscription.SubscriptionsClientListResponse]) *MockAzureClienter_NewSubscriptionListPager_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockAzureClienter_NewSubscriptionListPager_Call) RunAndReturn(run func(context.Context, *armsubscription.SubscriptionsClientListOptions) *runtime.Pager[armsubscription.SubscriptionsClientListResponse]) *MockAzureClienter_NewSubscriptionListPager_Call { + _c.Call.Return(run) + return _c +} + +// ResourceGroupExists provides a mock function with given fields: ctx, resourceGroupName +func (_m *MockAzureClienter) ResourceGroupExists(ctx context.Context, resourceGroupName string) (bool, error) { + ret := _m.Called(ctx, resourceGroupName) + + if len(ret) == 0 { + panic("no return value specified for ResourceGroupExists") + } + + var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (bool, error)); ok { + return rf(ctx, resourceGroupName) + } + if rf, ok := ret.Get(0).(func(context.Context, string) bool); ok { + r0 = rf(ctx, resourceGroupName) + } else { + r0 = ret.Get(0).(bool) + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, resourceGroupName) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockAzureClienter_ResourceGroupExists_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ResourceGroupExists' +type MockAzureClienter_ResourceGroupExists_Call struct { + *mock.Call +} + +// ResourceGroupExists is a helper method to define mock.On call +// - ctx context.Context +// - resourceGroupName string +func (_e *MockAzureClienter_Expecter) ResourceGroupExists(ctx interface{}, resourceGroupName interface{}) *MockAzureClienter_ResourceGroupExists_Call { + return &MockAzureClienter_ResourceGroupExists_Call{Call: _e.mock.On("ResourceGroupExists", ctx, resourceGroupName)} +} + +func (_c *MockAzureClienter_ResourceGroupExists_Call) Run(run func(ctx context.Context, resourceGroupName string)) *MockAzureClienter_ResourceGroupExists_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockAzureClienter_ResourceGroupExists_Call) Return(_a0 bool, _a1 error) *MockAzureClienter_ResourceGroupExists_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockAzureClienter_ResourceGroupExists_Call) RunAndReturn(run func(context.Context, string) (bool, error)) *MockAzureClienter_ResourceGroupExists_Call { + _c.Call.Return(run) + return _c +} + +// ValidateMachineType provides a mock function with given fields: ctx, location, vmSize +func (_m *MockAzureClienter) ValidateMachineType(ctx context.Context, location string, vmSize string) (bool, error) { + ret := _m.Called(ctx, location, vmSize) + + if len(ret) == 0 { + panic("no return value specified for ValidateMachineType") + } + + var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) (bool, error)); ok { + return rf(ctx, location, vmSize) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string) bool); ok { + r0 = rf(ctx, location, vmSize) + } else { + r0 = ret.Get(0).(bool) + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { + r1 = rf(ctx, location, vmSize) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockAzureClienter_ValidateMachineType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ValidateMachineType' +type MockAzureClienter_ValidateMachineType_Call struct { + *mock.Call +} + +// ValidateMachineType is a helper method to define mock.On call +// - ctx context.Context +// - location string +// - vmSize string +func (_e *MockAzureClienter_Expecter) ValidateMachineType(ctx interface{}, location interface{}, vmSize interface{}) *MockAzureClienter_ValidateMachineType_Call { + return &MockAzureClienter_ValidateMachineType_Call{Call: _e.mock.On("ValidateMachineType", ctx, location, vmSize)} +} + +func (_c *MockAzureClienter_ValidateMachineType_Call) Run(run func(ctx context.Context, location string, vmSize string)) *MockAzureClienter_ValidateMachineType_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *MockAzureClienter_ValidateMachineType_Call) Return(_a0 bool, _a1 error) *MockAzureClienter_ValidateMachineType_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockAzureClienter_ValidateMachineType_Call) RunAndReturn(run func(context.Context, string, string) (bool, error)) *MockAzureClienter_ValidateMachineType_Call { + _c.Call.Return(run) + return _c +} + +// NewMockAzureClienter creates a new instance of MockAzureClienter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockAzureClienter(t interface { + mock.TestingT + Cleanup(func()) +}) *MockAzureClienter { + mock := &MockAzureClienter{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/pkg/models/interfaces/sshutils/mocks/azure/mock_Pollerer.go b/pkg/models/interfaces/sshutils/mocks/azure/mock_Pollerer.go new file mode 100644 index 00000000..40c2f5c6 --- /dev/null +++ b/pkg/models/interfaces/sshutils/mocks/azure/mock_Pollerer.go @@ -0,0 +1,313 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package azure_interface + +import ( + armresources "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources" + + context "context" + + http "net/http" + + mock "github.com/stretchr/testify/mock" + + runtime "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" +) + +// MockPollerer is an autogenerated mock type for the Pollerer type +type MockPollerer struct { + mock.Mock +} + +type MockPollerer_Expecter struct { + mock *mock.Mock +} + +func (_m *MockPollerer) EXPECT() *MockPollerer_Expecter { + return &MockPollerer_Expecter{mock: &_m.Mock} +} + +// Done provides a mock function with given fields: +func (_m *MockPollerer) Done() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Done") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// MockPollerer_Done_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Done' +type MockPollerer_Done_Call struct { + *mock.Call +} + +// Done is a helper method to define mock.On call +func (_e *MockPollerer_Expecter) Done() *MockPollerer_Done_Call { + return &MockPollerer_Done_Call{Call: _e.mock.On("Done")} +} + +func (_c *MockPollerer_Done_Call) Run(run func()) *MockPollerer_Done_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockPollerer_Done_Call) Return(_a0 bool) *MockPollerer_Done_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockPollerer_Done_Call) RunAndReturn(run func() bool) *MockPollerer_Done_Call { + _c.Call.Return(run) + return _c +} + +// Poll provides a mock function with given fields: ctx +func (_m *MockPollerer) Poll(ctx context.Context) (*http.Response, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for Poll") + } + + var r0 *http.Response + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*http.Response, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) *http.Response); ok { + r0 = rf(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*http.Response) + } + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockPollerer_Poll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Poll' +type MockPollerer_Poll_Call struct { + *mock.Call +} + +// Poll is a helper method to define mock.On call +// - ctx context.Context +func (_e *MockPollerer_Expecter) Poll(ctx interface{}) *MockPollerer_Poll_Call { + return &MockPollerer_Poll_Call{Call: _e.mock.On("Poll", ctx)} +} + +func (_c *MockPollerer_Poll_Call) Run(run func(ctx context.Context)) *MockPollerer_Poll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *MockPollerer_Poll_Call) Return(_a0 *http.Response, _a1 error) *MockPollerer_Poll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockPollerer_Poll_Call) RunAndReturn(run func(context.Context) (*http.Response, error)) *MockPollerer_Poll_Call { + _c.Call.Return(run) + return _c +} + +// PollUntilDone provides a mock function with given fields: ctx, options +func (_m *MockPollerer) PollUntilDone(ctx context.Context, options *runtime.PollUntilDoneOptions) (armresources.DeploymentsClientCreateOrUpdateResponse, error) { + ret := _m.Called(ctx, options) + + if len(ret) == 0 { + panic("no return value specified for PollUntilDone") + } + + var r0 armresources.DeploymentsClientCreateOrUpdateResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *runtime.PollUntilDoneOptions) (armresources.DeploymentsClientCreateOrUpdateResponse, error)); ok { + return rf(ctx, options) + } + if rf, ok := ret.Get(0).(func(context.Context, *runtime.PollUntilDoneOptions) armresources.DeploymentsClientCreateOrUpdateResponse); ok { + r0 = rf(ctx, options) + } else { + r0 = ret.Get(0).(armresources.DeploymentsClientCreateOrUpdateResponse) + } + + if rf, ok := ret.Get(1).(func(context.Context, *runtime.PollUntilDoneOptions) error); ok { + r1 = rf(ctx, options) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockPollerer_PollUntilDone_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PollUntilDone' +type MockPollerer_PollUntilDone_Call struct { + *mock.Call +} + +// PollUntilDone is a helper method to define mock.On call +// - ctx context.Context +// - options *runtime.PollUntilDoneOptions +func (_e *MockPollerer_Expecter) PollUntilDone(ctx interface{}, options interface{}) *MockPollerer_PollUntilDone_Call { + return &MockPollerer_PollUntilDone_Call{Call: _e.mock.On("PollUntilDone", ctx, options)} +} + +func (_c *MockPollerer_PollUntilDone_Call) Run(run func(ctx context.Context, options *runtime.PollUntilDoneOptions)) *MockPollerer_PollUntilDone_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*runtime.PollUntilDoneOptions)) + }) + return _c +} + +func (_c *MockPollerer_PollUntilDone_Call) Return(_a0 armresources.DeploymentsClientCreateOrUpdateResponse, _a1 error) *MockPollerer_PollUntilDone_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockPollerer_PollUntilDone_Call) RunAndReturn(run func(context.Context, *runtime.PollUntilDoneOptions) (armresources.DeploymentsClientCreateOrUpdateResponse, error)) *MockPollerer_PollUntilDone_Call { + _c.Call.Return(run) + return _c +} + +// Result provides a mock function with given fields: ctx +func (_m *MockPollerer) Result(ctx context.Context) (armresources.DeploymentsClientCreateOrUpdateResponse, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for Result") + } + + var r0 armresources.DeploymentsClientCreateOrUpdateResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (armresources.DeploymentsClientCreateOrUpdateResponse, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) armresources.DeploymentsClientCreateOrUpdateResponse); ok { + r0 = rf(ctx) + } else { + r0 = ret.Get(0).(armresources.DeploymentsClientCreateOrUpdateResponse) + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockPollerer_Result_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Result' +type MockPollerer_Result_Call struct { + *mock.Call +} + +// Result is a helper method to define mock.On call +// - ctx context.Context +func (_e *MockPollerer_Expecter) Result(ctx interface{}) *MockPollerer_Result_Call { + return &MockPollerer_Result_Call{Call: _e.mock.On("Result", ctx)} +} + +func (_c *MockPollerer_Result_Call) Run(run func(ctx context.Context)) *MockPollerer_Result_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *MockPollerer_Result_Call) Return(_a0 armresources.DeploymentsClientCreateOrUpdateResponse, _a1 error) *MockPollerer_Result_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockPollerer_Result_Call) RunAndReturn(run func(context.Context) (armresources.DeploymentsClientCreateOrUpdateResponse, error)) *MockPollerer_Result_Call { + _c.Call.Return(run) + return _c +} + +// ResumeToken provides a mock function with given fields: +func (_m *MockPollerer) ResumeToken() (string, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for ResumeToken") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func() (string, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockPollerer_ResumeToken_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ResumeToken' +type MockPollerer_ResumeToken_Call struct { + *mock.Call +} + +// ResumeToken is a helper method to define mock.On call +func (_e *MockPollerer_Expecter) ResumeToken() *MockPollerer_ResumeToken_Call { + return &MockPollerer_ResumeToken_Call{Call: _e.mock.On("ResumeToken")} +} + +func (_c *MockPollerer_ResumeToken_Call) Run(run func()) *MockPollerer_ResumeToken_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockPollerer_ResumeToken_Call) Return(_a0 string, _a1 error) *MockPollerer_ResumeToken_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockPollerer_ResumeToken_Call) RunAndReturn(run func() (string, error)) *MockPollerer_ResumeToken_Call { + _c.Call.Return(run) + return _c +} + +// NewMockPollerer creates a new instance of MockPollerer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockPollerer(t interface { + mock.TestingT + Cleanup(func()) +}) *MockPollerer { + mock := &MockPollerer{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/pkg/models/interfaces/sshutils/mocks/common/mock_Clienter.go b/pkg/models/interfaces/sshutils/mocks/common/mock_Clienter.go new file mode 100644 index 00000000..7cc1d6de --- /dev/null +++ b/pkg/models/interfaces/sshutils/mocks/common/mock_Clienter.go @@ -0,0 +1,32 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package common_interface + +import mock "github.com/stretchr/testify/mock" + +// MockClienter is an autogenerated mock type for the Clienter type +type MockClienter struct { + mock.Mock +} + +type MockClienter_Expecter struct { + mock *mock.Mock +} + +func (_m *MockClienter) EXPECT() *MockClienter_Expecter { + return &MockClienter_Expecter{mock: &_m.Mock} +} + +// NewMockClienter creates a new instance of MockClienter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockClienter(t interface { + mock.TestingT + Cleanup(func()) +}) *MockClienter { + mock := &MockClienter{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/pkg/models/interfaces/sshutils/mocks/common/mock_ClusterDeployerer.go b/pkg/models/interfaces/sshutils/mocks/common/mock_ClusterDeployerer.go new file mode 100644 index 00000000..80a73774 --- /dev/null +++ b/pkg/models/interfaces/sshutils/mocks/common/mock_ClusterDeployerer.go @@ -0,0 +1,371 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package common_interface + +import ( + context "context" + + models "github.com/bacalhau-project/andaime/pkg/models" + mock "github.com/stretchr/testify/mock" + + sshutils "github.com/bacalhau-project/andaime/pkg/models/interfaces/sshutils" +) + +// MockClusterDeployerer is an autogenerated mock type for the ClusterDeployerer type +type MockClusterDeployerer struct { + mock.Mock +} + +type MockClusterDeployerer_Expecter struct { + mock *mock.Mock +} + +func (_m *MockClusterDeployerer) EXPECT() *MockClusterDeployerer_Expecter { + return &MockClusterDeployerer_Expecter{mock: &_m.Mock} +} + +// ApplyBacalhauConfigs provides a mock function with given fields: ctx, sshConfig, bacalhauSettings +func (_m *MockClusterDeployerer) ApplyBacalhauConfigs(ctx context.Context, sshConfig sshutils.SSHConfiger, bacalhauSettings []models.BacalhauSettings) error { + ret := _m.Called(ctx, sshConfig, bacalhauSettings) + + if len(ret) == 0 { + panic("no return value specified for ApplyBacalhauConfigs") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, sshutils.SSHConfiger, []models.BacalhauSettings) error); ok { + r0 = rf(ctx, sshConfig, bacalhauSettings) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockClusterDeployerer_ApplyBacalhauConfigs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ApplyBacalhauConfigs' +type MockClusterDeployerer_ApplyBacalhauConfigs_Call struct { + *mock.Call +} + +// ApplyBacalhauConfigs is a helper method to define mock.On call +// - ctx context.Context +// - sshConfig sshutils.SSHConfiger +// - bacalhauSettings []models.BacalhauSettings +func (_e *MockClusterDeployerer_Expecter) ApplyBacalhauConfigs(ctx interface{}, sshConfig interface{}, bacalhauSettings interface{}) *MockClusterDeployerer_ApplyBacalhauConfigs_Call { + return &MockClusterDeployerer_ApplyBacalhauConfigs_Call{Call: _e.mock.On("ApplyBacalhauConfigs", ctx, sshConfig, bacalhauSettings)} +} + +func (_c *MockClusterDeployerer_ApplyBacalhauConfigs_Call) Run(run func(ctx context.Context, sshConfig sshutils.SSHConfiger, bacalhauSettings []models.BacalhauSettings)) *MockClusterDeployerer_ApplyBacalhauConfigs_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(sshutils.SSHConfiger), args[2].([]models.BacalhauSettings)) + }) + return _c +} + +func (_c *MockClusterDeployerer_ApplyBacalhauConfigs_Call) Return(_a0 error) *MockClusterDeployerer_ApplyBacalhauConfigs_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockClusterDeployerer_ApplyBacalhauConfigs_Call) RunAndReturn(run func(context.Context, sshutils.SSHConfiger, []models.BacalhauSettings) error) *MockClusterDeployerer_ApplyBacalhauConfigs_Call { + _c.Call.Return(run) + return _c +} + +// ExecuteCustomScript provides a mock function with given fields: ctx, sshConfig, machine +func (_m *MockClusterDeployerer) ExecuteCustomScript(ctx context.Context, sshConfig sshutils.SSHConfiger, machine models.Machiner) error { + ret := _m.Called(ctx, sshConfig, machine) + + if len(ret) == 0 { + panic("no return value specified for ExecuteCustomScript") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, sshutils.SSHConfiger, models.Machiner) error); ok { + r0 = rf(ctx, sshConfig, machine) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockClusterDeployerer_ExecuteCustomScript_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExecuteCustomScript' +type MockClusterDeployerer_ExecuteCustomScript_Call struct { + *mock.Call +} + +// ExecuteCustomScript is a helper method to define mock.On call +// - ctx context.Context +// - sshConfig sshutils.SSHConfiger +// - machine models.Machiner +func (_e *MockClusterDeployerer_Expecter) ExecuteCustomScript(ctx interface{}, sshConfig interface{}, machine interface{}) *MockClusterDeployerer_ExecuteCustomScript_Call { + return &MockClusterDeployerer_ExecuteCustomScript_Call{Call: _e.mock.On("ExecuteCustomScript", ctx, sshConfig, machine)} +} + +func (_c *MockClusterDeployerer_ExecuteCustomScript_Call) Run(run func(ctx context.Context, sshConfig sshutils.SSHConfiger, machine models.Machiner)) *MockClusterDeployerer_ExecuteCustomScript_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(sshutils.SSHConfiger), args[2].(models.Machiner)) + }) + return _c +} + +func (_c *MockClusterDeployerer_ExecuteCustomScript_Call) Return(_a0 error) *MockClusterDeployerer_ExecuteCustomScript_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockClusterDeployerer_ExecuteCustomScript_Call) RunAndReturn(run func(context.Context, sshutils.SSHConfiger, models.Machiner) error) *MockClusterDeployerer_ExecuteCustomScript_Call { + _c.Call.Return(run) + return _c +} + +// ProvisionBacalhauCluster provides a mock function with given fields: ctx +func (_m *MockClusterDeployerer) ProvisionBacalhauCluster(ctx context.Context) error { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for ProvisionBacalhauCluster") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context) error); ok { + r0 = rf(ctx) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockClusterDeployerer_ProvisionBacalhauCluster_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ProvisionBacalhauCluster' +type MockClusterDeployerer_ProvisionBacalhauCluster_Call struct { + *mock.Call +} + +// ProvisionBacalhauCluster is a helper method to define mock.On call +// - ctx context.Context +func (_e *MockClusterDeployerer_Expecter) ProvisionBacalhauCluster(ctx interface{}) *MockClusterDeployerer_ProvisionBacalhauCluster_Call { + return &MockClusterDeployerer_ProvisionBacalhauCluster_Call{Call: _e.mock.On("ProvisionBacalhauCluster", ctx)} +} + +func (_c *MockClusterDeployerer_ProvisionBacalhauCluster_Call) Run(run func(ctx context.Context)) *MockClusterDeployerer_ProvisionBacalhauCluster_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *MockClusterDeployerer_ProvisionBacalhauCluster_Call) Return(_a0 error) *MockClusterDeployerer_ProvisionBacalhauCluster_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockClusterDeployerer_ProvisionBacalhauCluster_Call) RunAndReturn(run func(context.Context) error) *MockClusterDeployerer_ProvisionBacalhauCluster_Call { + _c.Call.Return(run) + return _c +} + +// ProvisionMachine provides a mock function with given fields: ctx, sshConfig, machine +func (_m *MockClusterDeployerer) ProvisionMachine(ctx context.Context, sshConfig sshutils.SSHConfiger, machine models.Machiner) error { + ret := _m.Called(ctx, sshConfig, machine) + + if len(ret) == 0 { + panic("no return value specified for ProvisionMachine") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, sshutils.SSHConfiger, models.Machiner) error); ok { + r0 = rf(ctx, sshConfig, machine) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockClusterDeployerer_ProvisionMachine_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ProvisionMachine' +type MockClusterDeployerer_ProvisionMachine_Call struct { + *mock.Call +} + +// ProvisionMachine is a helper method to define mock.On call +// - ctx context.Context +// - sshConfig sshutils.SSHConfiger +// - machine models.Machiner +func (_e *MockClusterDeployerer_Expecter) ProvisionMachine(ctx interface{}, sshConfig interface{}, machine interface{}) *MockClusterDeployerer_ProvisionMachine_Call { + return &MockClusterDeployerer_ProvisionMachine_Call{Call: _e.mock.On("ProvisionMachine", ctx, sshConfig, machine)} +} + +func (_c *MockClusterDeployerer_ProvisionMachine_Call) Run(run func(ctx context.Context, sshConfig sshutils.SSHConfiger, machine models.Machiner)) *MockClusterDeployerer_ProvisionMachine_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(sshutils.SSHConfiger), args[2].(models.Machiner)) + }) + return _c +} + +func (_c *MockClusterDeployerer_ProvisionMachine_Call) Return(_a0 error) *MockClusterDeployerer_ProvisionMachine_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockClusterDeployerer_ProvisionMachine_Call) RunAndReturn(run func(context.Context, sshutils.SSHConfiger, models.Machiner) error) *MockClusterDeployerer_ProvisionMachine_Call { + _c.Call.Return(run) + return _c +} + +// ProvisionOrchestrator provides a mock function with given fields: ctx, machineName +func (_m *MockClusterDeployerer) ProvisionOrchestrator(ctx context.Context, machineName string) error { + ret := _m.Called(ctx, machineName) + + if len(ret) == 0 { + panic("no return value specified for ProvisionOrchestrator") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = rf(ctx, machineName) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockClusterDeployerer_ProvisionOrchestrator_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ProvisionOrchestrator' +type MockClusterDeployerer_ProvisionOrchestrator_Call struct { + *mock.Call +} + +// ProvisionOrchestrator is a helper method to define mock.On call +// - ctx context.Context +// - machineName string +func (_e *MockClusterDeployerer_Expecter) ProvisionOrchestrator(ctx interface{}, machineName interface{}) *MockClusterDeployerer_ProvisionOrchestrator_Call { + return &MockClusterDeployerer_ProvisionOrchestrator_Call{Call: _e.mock.On("ProvisionOrchestrator", ctx, machineName)} +} + +func (_c *MockClusterDeployerer_ProvisionOrchestrator_Call) Run(run func(ctx context.Context, machineName string)) *MockClusterDeployerer_ProvisionOrchestrator_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockClusterDeployerer_ProvisionOrchestrator_Call) Return(_a0 error) *MockClusterDeployerer_ProvisionOrchestrator_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockClusterDeployerer_ProvisionOrchestrator_Call) RunAndReturn(run func(context.Context, string) error) *MockClusterDeployerer_ProvisionOrchestrator_Call { + _c.Call.Return(run) + return _c +} + +// ProvisionWorker provides a mock function with given fields: ctx, machineName +func (_m *MockClusterDeployerer) ProvisionWorker(ctx context.Context, machineName string) error { + ret := _m.Called(ctx, machineName) + + if len(ret) == 0 { + panic("no return value specified for ProvisionWorker") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = rf(ctx, machineName) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockClusterDeployerer_ProvisionWorker_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ProvisionWorker' +type MockClusterDeployerer_ProvisionWorker_Call struct { + *mock.Call +} + +// ProvisionWorker is a helper method to define mock.On call +// - ctx context.Context +// - machineName string +func (_e *MockClusterDeployerer_Expecter) ProvisionWorker(ctx interface{}, machineName interface{}) *MockClusterDeployerer_ProvisionWorker_Call { + return &MockClusterDeployerer_ProvisionWorker_Call{Call: _e.mock.On("ProvisionWorker", ctx, machineName)} +} + +func (_c *MockClusterDeployerer_ProvisionWorker_Call) Run(run func(ctx context.Context, machineName string)) *MockClusterDeployerer_ProvisionWorker_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockClusterDeployerer_ProvisionWorker_Call) Return(_a0 error) *MockClusterDeployerer_ProvisionWorker_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockClusterDeployerer_ProvisionWorker_Call) RunAndReturn(run func(context.Context, string) error) *MockClusterDeployerer_ProvisionWorker_Call { + _c.Call.Return(run) + return _c +} + +// WaitForAllMachinesToReachState provides a mock function with given fields: ctx, resourceType, state +func (_m *MockClusterDeployerer) WaitForAllMachinesToReachState(ctx context.Context, resourceType string, state models.MachineResourceState) error { + ret := _m.Called(ctx, resourceType, state) + + if len(ret) == 0 { + panic("no return value specified for WaitForAllMachinesToReachState") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, models.MachineResourceState) error); ok { + r0 = rf(ctx, resourceType, state) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockClusterDeployerer_WaitForAllMachinesToReachState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WaitForAllMachinesToReachState' +type MockClusterDeployerer_WaitForAllMachinesToReachState_Call struct { + *mock.Call +} + +// WaitForAllMachinesToReachState is a helper method to define mock.On call +// - ctx context.Context +// - resourceType string +// - state models.MachineResourceState +func (_e *MockClusterDeployerer_Expecter) WaitForAllMachinesToReachState(ctx interface{}, resourceType interface{}, state interface{}) *MockClusterDeployerer_WaitForAllMachinesToReachState_Call { + return &MockClusterDeployerer_WaitForAllMachinesToReachState_Call{Call: _e.mock.On("WaitForAllMachinesToReachState", ctx, resourceType, state)} +} + +func (_c *MockClusterDeployerer_WaitForAllMachinesToReachState_Call) Run(run func(ctx context.Context, resourceType string, state models.MachineResourceState)) *MockClusterDeployerer_WaitForAllMachinesToReachState_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(models.MachineResourceState)) + }) + return _c +} + +func (_c *MockClusterDeployerer_WaitForAllMachinesToReachState_Call) Return(_a0 error) *MockClusterDeployerer_WaitForAllMachinesToReachState_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockClusterDeployerer_WaitForAllMachinesToReachState_Call) RunAndReturn(run func(context.Context, string, models.MachineResourceState) error) *MockClusterDeployerer_WaitForAllMachinesToReachState_Call { + _c.Call.Return(run) + return _c +} + +// NewMockClusterDeployerer creates a new instance of MockClusterDeployerer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockClusterDeployerer(t interface { + mock.TestingT + Cleanup(func()) +}) *MockClusterDeployerer { + mock := &MockClusterDeployerer{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/pkg/models/interfaces/sshutils/mocks/gcp/mock_GCPClienter.go b/pkg/models/interfaces/sshutils/mocks/gcp/mock_GCPClienter.go new file mode 100644 index 00000000..f3293591 --- /dev/null +++ b/pkg/models/interfaces/sshutils/mocks/gcp/mock_GCPClienter.go @@ -0,0 +1,1463 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package gcp_interface + +import ( + assetpb "cloud.google.com/go/asset/apiv1/assetpb" + computepb "cloud.google.com/go/compute/apiv1/computepb" + + context "context" + + iam "google.golang.org/api/iam/v1" + + mock "github.com/stretchr/testify/mock" + + models "github.com/bacalhau-project/andaime/pkg/models" + + resourcemanagerpb "cloud.google.com/go/resourcemanager/apiv3/resourcemanagerpb" +) + +// MockGCPClienter is an autogenerated mock type for the GCPClienter type +type MockGCPClienter struct { + mock.Mock +} + +type MockGCPClienter_Expecter struct { + mock *mock.Mock +} + +func (_m *MockGCPClienter) EXPECT() *MockGCPClienter_Expecter { + return &MockGCPClienter_Expecter{mock: &_m.Mock} +} + +// CheckAuthentication provides a mock function with given fields: ctx, projectID +func (_m *MockGCPClienter) CheckAuthentication(ctx context.Context, projectID string) error { + ret := _m.Called(ctx, projectID) + + if len(ret) == 0 { + panic("no return value specified for CheckAuthentication") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = rf(ctx, projectID) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockGCPClienter_CheckAuthentication_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CheckAuthentication' +type MockGCPClienter_CheckAuthentication_Call struct { + *mock.Call +} + +// CheckAuthentication is a helper method to define mock.On call +// - ctx context.Context +// - projectID string +func (_e *MockGCPClienter_Expecter) CheckAuthentication(ctx interface{}, projectID interface{}) *MockGCPClienter_CheckAuthentication_Call { + return &MockGCPClienter_CheckAuthentication_Call{Call: _e.mock.On("CheckAuthentication", ctx, projectID)} +} + +func (_c *MockGCPClienter_CheckAuthentication_Call) Run(run func(ctx context.Context, projectID string)) *MockGCPClienter_CheckAuthentication_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockGCPClienter_CheckAuthentication_Call) Return(_a0 error) *MockGCPClienter_CheckAuthentication_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockGCPClienter_CheckAuthentication_Call) RunAndReturn(run func(context.Context, string) error) *MockGCPClienter_CheckAuthentication_Call { + _c.Call.Return(run) + return _c +} + +// CheckFirewallRuleExists provides a mock function with given fields: ctx, projectID, ruleName +func (_m *MockGCPClienter) CheckFirewallRuleExists(ctx context.Context, projectID string, ruleName string) error { + ret := _m.Called(ctx, projectID, ruleName) + + if len(ret) == 0 { + panic("no return value specified for CheckFirewallRuleExists") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok { + r0 = rf(ctx, projectID, ruleName) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockGCPClienter_CheckFirewallRuleExists_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CheckFirewallRuleExists' +type MockGCPClienter_CheckFirewallRuleExists_Call struct { + *mock.Call +} + +// CheckFirewallRuleExists is a helper method to define mock.On call +// - ctx context.Context +// - projectID string +// - ruleName string +func (_e *MockGCPClienter_Expecter) CheckFirewallRuleExists(ctx interface{}, projectID interface{}, ruleName interface{}) *MockGCPClienter_CheckFirewallRuleExists_Call { + return &MockGCPClienter_CheckFirewallRuleExists_Call{Call: _e.mock.On("CheckFirewallRuleExists", ctx, projectID, ruleName)} +} + +func (_c *MockGCPClienter_CheckFirewallRuleExists_Call) Run(run func(ctx context.Context, projectID string, ruleName string)) *MockGCPClienter_CheckFirewallRuleExists_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *MockGCPClienter_CheckFirewallRuleExists_Call) Return(_a0 error) *MockGCPClienter_CheckFirewallRuleExists_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockGCPClienter_CheckFirewallRuleExists_Call) RunAndReturn(run func(context.Context, string, string) error) *MockGCPClienter_CheckFirewallRuleExists_Call { + _c.Call.Return(run) + return _c +} + +// CheckPermissions provides a mock function with given fields: ctx, projectID +func (_m *MockGCPClienter) CheckPermissions(ctx context.Context, projectID string) error { + ret := _m.Called(ctx, projectID) + + if len(ret) == 0 { + panic("no return value specified for CheckPermissions") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = rf(ctx, projectID) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockGCPClienter_CheckPermissions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CheckPermissions' +type MockGCPClienter_CheckPermissions_Call struct { + *mock.Call +} + +// CheckPermissions is a helper method to define mock.On call +// - ctx context.Context +// - projectID string +func (_e *MockGCPClienter_Expecter) CheckPermissions(ctx interface{}, projectID interface{}) *MockGCPClienter_CheckPermissions_Call { + return &MockGCPClienter_CheckPermissions_Call{Call: _e.mock.On("CheckPermissions", ctx, projectID)} +} + +func (_c *MockGCPClienter_CheckPermissions_Call) Run(run func(ctx context.Context, projectID string)) *MockGCPClienter_CheckPermissions_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockGCPClienter_CheckPermissions_Call) Return(_a0 error) *MockGCPClienter_CheckPermissions_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockGCPClienter_CheckPermissions_Call) RunAndReturn(run func(context.Context, string) error) *MockGCPClienter_CheckPermissions_Call { + _c.Call.Return(run) + return _c +} + +// CreateFirewallRules provides a mock function with given fields: ctx, projectID, networkName +func (_m *MockGCPClienter) CreateFirewallRules(ctx context.Context, projectID string, networkName string) error { + ret := _m.Called(ctx, projectID, networkName) + + if len(ret) == 0 { + panic("no return value specified for CreateFirewallRules") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok { + r0 = rf(ctx, projectID, networkName) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockGCPClienter_CreateFirewallRules_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateFirewallRules' +type MockGCPClienter_CreateFirewallRules_Call struct { + *mock.Call +} + +// CreateFirewallRules is a helper method to define mock.On call +// - ctx context.Context +// - projectID string +// - networkName string +func (_e *MockGCPClienter_Expecter) CreateFirewallRules(ctx interface{}, projectID interface{}, networkName interface{}) *MockGCPClienter_CreateFirewallRules_Call { + return &MockGCPClienter_CreateFirewallRules_Call{Call: _e.mock.On("CreateFirewallRules", ctx, projectID, networkName)} +} + +func (_c *MockGCPClienter_CreateFirewallRules_Call) Run(run func(ctx context.Context, projectID string, networkName string)) *MockGCPClienter_CreateFirewallRules_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *MockGCPClienter_CreateFirewallRules_Call) Return(_a0 error) *MockGCPClienter_CreateFirewallRules_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockGCPClienter_CreateFirewallRules_Call) RunAndReturn(run func(context.Context, string, string) error) *MockGCPClienter_CreateFirewallRules_Call { + _c.Call.Return(run) + return _c +} + +// CreateIP provides a mock function with given fields: ctx, projectID, location, address +func (_m *MockGCPClienter) CreateIP(ctx context.Context, projectID string, location string, address *computepb.Address) (*computepb.Address, error) { + ret := _m.Called(ctx, projectID, location, address) + + if len(ret) == 0 { + panic("no return value specified for CreateIP") + } + + var r0 *computepb.Address + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, *computepb.Address) (*computepb.Address, error)); ok { + return rf(ctx, projectID, location, address) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string, *computepb.Address) *computepb.Address); ok { + r0 = rf(ctx, projectID, location, address) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*computepb.Address) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string, *computepb.Address) error); ok { + r1 = rf(ctx, projectID, location, address) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockGCPClienter_CreateIP_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateIP' +type MockGCPClienter_CreateIP_Call struct { + *mock.Call +} + +// CreateIP is a helper method to define mock.On call +// - ctx context.Context +// - projectID string +// - location string +// - address *computepb.Address +func (_e *MockGCPClienter_Expecter) CreateIP(ctx interface{}, projectID interface{}, location interface{}, address interface{}) *MockGCPClienter_CreateIP_Call { + return &MockGCPClienter_CreateIP_Call{Call: _e.mock.On("CreateIP", ctx, projectID, location, address)} +} + +func (_c *MockGCPClienter_CreateIP_Call) Run(run func(ctx context.Context, projectID string, location string, address *computepb.Address)) *MockGCPClienter_CreateIP_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(*computepb.Address)) + }) + return _c +} + +func (_c *MockGCPClienter_CreateIP_Call) Return(_a0 *computepb.Address, _a1 error) *MockGCPClienter_CreateIP_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockGCPClienter_CreateIP_Call) RunAndReturn(run func(context.Context, string, string, *computepb.Address) (*computepb.Address, error)) *MockGCPClienter_CreateIP_Call { + _c.Call.Return(run) + return _c +} + +// CreateServiceAccount provides a mock function with given fields: ctx, projectID +func (_m *MockGCPClienter) CreateServiceAccount(ctx context.Context, projectID string) (*iam.ServiceAccount, error) { + ret := _m.Called(ctx, projectID) + + if len(ret) == 0 { + panic("no return value specified for CreateServiceAccount") + } + + var r0 *iam.ServiceAccount + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*iam.ServiceAccount, error)); ok { + return rf(ctx, projectID) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *iam.ServiceAccount); ok { + r0 = rf(ctx, projectID) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*iam.ServiceAccount) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, projectID) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockGCPClienter_CreateServiceAccount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateServiceAccount' +type MockGCPClienter_CreateServiceAccount_Call struct { + *mock.Call +} + +// CreateServiceAccount is a helper method to define mock.On call +// - ctx context.Context +// - projectID string +func (_e *MockGCPClienter_Expecter) CreateServiceAccount(ctx interface{}, projectID interface{}) *MockGCPClienter_CreateServiceAccount_Call { + return &MockGCPClienter_CreateServiceAccount_Call{Call: _e.mock.On("CreateServiceAccount", ctx, projectID)} +} + +func (_c *MockGCPClienter_CreateServiceAccount_Call) Run(run func(ctx context.Context, projectID string)) *MockGCPClienter_CreateServiceAccount_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockGCPClienter_CreateServiceAccount_Call) Return(_a0 *iam.ServiceAccount, _a1 error) *MockGCPClienter_CreateServiceAccount_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockGCPClienter_CreateServiceAccount_Call) RunAndReturn(run func(context.Context, string) (*iam.ServiceAccount, error)) *MockGCPClienter_CreateServiceAccount_Call { + _c.Call.Return(run) + return _c +} + +// CreateVM provides a mock function with given fields: ctx, projectID, machine, ip, networkName +func (_m *MockGCPClienter) CreateVM(ctx context.Context, projectID string, machine models.Machiner, ip *computepb.Address, networkName string) (*computepb.Instance, error) { + ret := _m.Called(ctx, projectID, machine, ip, networkName) + + if len(ret) == 0 { + panic("no return value specified for CreateVM") + } + + var r0 *computepb.Instance + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, models.Machiner, *computepb.Address, string) (*computepb.Instance, error)); ok { + return rf(ctx, projectID, machine, ip, networkName) + } + if rf, ok := ret.Get(0).(func(context.Context, string, models.Machiner, *computepb.Address, string) *computepb.Instance); ok { + r0 = rf(ctx, projectID, machine, ip, networkName) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*computepb.Instance) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, models.Machiner, *computepb.Address, string) error); ok { + r1 = rf(ctx, projectID, machine, ip, networkName) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockGCPClienter_CreateVM_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateVM' +type MockGCPClienter_CreateVM_Call struct { + *mock.Call +} + +// CreateVM is a helper method to define mock.On call +// - ctx context.Context +// - projectID string +// - machine models.Machiner +// - ip *computepb.Address +// - networkName string +func (_e *MockGCPClienter_Expecter) CreateVM(ctx interface{}, projectID interface{}, machine interface{}, ip interface{}, networkName interface{}) *MockGCPClienter_CreateVM_Call { + return &MockGCPClienter_CreateVM_Call{Call: _e.mock.On("CreateVM", ctx, projectID, machine, ip, networkName)} +} + +func (_c *MockGCPClienter_CreateVM_Call) Run(run func(ctx context.Context, projectID string, machine models.Machiner, ip *computepb.Address, networkName string)) *MockGCPClienter_CreateVM_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(models.Machiner), args[3].(*computepb.Address), args[4].(string)) + }) + return _c +} + +func (_c *MockGCPClienter_CreateVM_Call) Return(_a0 *computepb.Instance, _a1 error) *MockGCPClienter_CreateVM_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockGCPClienter_CreateVM_Call) RunAndReturn(run func(context.Context, string, models.Machiner, *computepb.Address, string) (*computepb.Instance, error)) *MockGCPClienter_CreateVM_Call { + _c.Call.Return(run) + return _c +} + +// CreateVPCNetwork provides a mock function with given fields: ctx, projectID, networkName +func (_m *MockGCPClienter) CreateVPCNetwork(ctx context.Context, projectID string, networkName string) error { + ret := _m.Called(ctx, projectID, networkName) + + if len(ret) == 0 { + panic("no return value specified for CreateVPCNetwork") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok { + r0 = rf(ctx, projectID, networkName) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockGCPClienter_CreateVPCNetwork_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateVPCNetwork' +type MockGCPClienter_CreateVPCNetwork_Call struct { + *mock.Call +} + +// CreateVPCNetwork is a helper method to define mock.On call +// - ctx context.Context +// - projectID string +// - networkName string +func (_e *MockGCPClienter_Expecter) CreateVPCNetwork(ctx interface{}, projectID interface{}, networkName interface{}) *MockGCPClienter_CreateVPCNetwork_Call { + return &MockGCPClienter_CreateVPCNetwork_Call{Call: _e.mock.On("CreateVPCNetwork", ctx, projectID, networkName)} +} + +func (_c *MockGCPClienter_CreateVPCNetwork_Call) Run(run func(ctx context.Context, projectID string, networkName string)) *MockGCPClienter_CreateVPCNetwork_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *MockGCPClienter_CreateVPCNetwork_Call) Return(_a0 error) *MockGCPClienter_CreateVPCNetwork_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockGCPClienter_CreateVPCNetwork_Call) RunAndReturn(run func(context.Context, string, string) error) *MockGCPClienter_CreateVPCNetwork_Call { + _c.Call.Return(run) + return _c +} + +// DeleteIP provides a mock function with given fields: ctx, projectID, location, addressName +func (_m *MockGCPClienter) DeleteIP(ctx context.Context, projectID string, location string, addressName string) error { + ret := _m.Called(ctx, projectID, location, addressName) + + if len(ret) == 0 { + panic("no return value specified for DeleteIP") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string) error); ok { + r0 = rf(ctx, projectID, location, addressName) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockGCPClienter_DeleteIP_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteIP' +type MockGCPClienter_DeleteIP_Call struct { + *mock.Call +} + +// DeleteIP is a helper method to define mock.On call +// - ctx context.Context +// - projectID string +// - location string +// - addressName string +func (_e *MockGCPClienter_Expecter) DeleteIP(ctx interface{}, projectID interface{}, location interface{}, addressName interface{}) *MockGCPClienter_DeleteIP_Call { + return &MockGCPClienter_DeleteIP_Call{Call: _e.mock.On("DeleteIP", ctx, projectID, location, addressName)} +} + +func (_c *MockGCPClienter_DeleteIP_Call) Run(run func(ctx context.Context, projectID string, location string, addressName string)) *MockGCPClienter_DeleteIP_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(string)) + }) + return _c +} + +func (_c *MockGCPClienter_DeleteIP_Call) Return(_a0 error) *MockGCPClienter_DeleteIP_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockGCPClienter_DeleteIP_Call) RunAndReturn(run func(context.Context, string, string, string) error) *MockGCPClienter_DeleteIP_Call { + _c.Call.Return(run) + return _c +} + +// DestroyProject provides a mock function with given fields: ctx, projectID +func (_m *MockGCPClienter) DestroyProject(ctx context.Context, projectID string) error { + ret := _m.Called(ctx, projectID) + + if len(ret) == 0 { + panic("no return value specified for DestroyProject") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = rf(ctx, projectID) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockGCPClienter_DestroyProject_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DestroyProject' +type MockGCPClienter_DestroyProject_Call struct { + *mock.Call +} + +// DestroyProject is a helper method to define mock.On call +// - ctx context.Context +// - projectID string +func (_e *MockGCPClienter_Expecter) DestroyProject(ctx interface{}, projectID interface{}) *MockGCPClienter_DestroyProject_Call { + return &MockGCPClienter_DestroyProject_Call{Call: _e.mock.On("DestroyProject", ctx, projectID)} +} + +func (_c *MockGCPClienter_DestroyProject_Call) Run(run func(ctx context.Context, projectID string)) *MockGCPClienter_DestroyProject_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockGCPClienter_DestroyProject_Call) Return(_a0 error) *MockGCPClienter_DestroyProject_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockGCPClienter_DestroyProject_Call) RunAndReturn(run func(context.Context, string) error) *MockGCPClienter_DestroyProject_Call { + _c.Call.Return(run) + return _c +} + +// EnableAPI provides a mock function with given fields: ctx, projectID, apiName +func (_m *MockGCPClienter) EnableAPI(ctx context.Context, projectID string, apiName string) error { + ret := _m.Called(ctx, projectID, apiName) + + if len(ret) == 0 { + panic("no return value specified for EnableAPI") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok { + r0 = rf(ctx, projectID, apiName) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockGCPClienter_EnableAPI_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EnableAPI' +type MockGCPClienter_EnableAPI_Call struct { + *mock.Call +} + +// EnableAPI is a helper method to define mock.On call +// - ctx context.Context +// - projectID string +// - apiName string +func (_e *MockGCPClienter_Expecter) EnableAPI(ctx interface{}, projectID interface{}, apiName interface{}) *MockGCPClienter_EnableAPI_Call { + return &MockGCPClienter_EnableAPI_Call{Call: _e.mock.On("EnableAPI", ctx, projectID, apiName)} +} + +func (_c *MockGCPClienter_EnableAPI_Call) Run(run func(ctx context.Context, projectID string, apiName string)) *MockGCPClienter_EnableAPI_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *MockGCPClienter_EnableAPI_Call) Return(_a0 error) *MockGCPClienter_EnableAPI_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockGCPClienter_EnableAPI_Call) RunAndReturn(run func(context.Context, string, string) error) *MockGCPClienter_EnableAPI_Call { + _c.Call.Return(run) + return _c +} + +// EnsureFirewallRules provides a mock function with given fields: ctx, projectID, networkName, allowedPorts +func (_m *MockGCPClienter) EnsureFirewallRules(ctx context.Context, projectID string, networkName string, allowedPorts []int) error { + ret := _m.Called(ctx, projectID, networkName, allowedPorts) + + if len(ret) == 0 { + panic("no return value specified for EnsureFirewallRules") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, []int) error); ok { + r0 = rf(ctx, projectID, networkName, allowedPorts) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockGCPClienter_EnsureFirewallRules_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EnsureFirewallRules' +type MockGCPClienter_EnsureFirewallRules_Call struct { + *mock.Call +} + +// EnsureFirewallRules is a helper method to define mock.On call +// - ctx context.Context +// - projectID string +// - networkName string +// - allowedPorts []int +func (_e *MockGCPClienter_Expecter) EnsureFirewallRules(ctx interface{}, projectID interface{}, networkName interface{}, allowedPorts interface{}) *MockGCPClienter_EnsureFirewallRules_Call { + return &MockGCPClienter_EnsureFirewallRules_Call{Call: _e.mock.On("EnsureFirewallRules", ctx, projectID, networkName, allowedPorts)} +} + +func (_c *MockGCPClienter_EnsureFirewallRules_Call) Run(run func(ctx context.Context, projectID string, networkName string, allowedPorts []int)) *MockGCPClienter_EnsureFirewallRules_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].([]int)) + }) + return _c +} + +func (_c *MockGCPClienter_EnsureFirewallRules_Call) Return(_a0 error) *MockGCPClienter_EnsureFirewallRules_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockGCPClienter_EnsureFirewallRules_Call) RunAndReturn(run func(context.Context, string, string, []int) error) *MockGCPClienter_EnsureFirewallRules_Call { + _c.Call.Return(run) + return _c +} + +// EnsureProject provides a mock function with given fields: ctx, organizationID, projectID, billingAccountID +func (_m *MockGCPClienter) EnsureProject(ctx context.Context, organizationID string, projectID string, billingAccountID string) (string, error) { + ret := _m.Called(ctx, organizationID, projectID, billingAccountID) + + if len(ret) == 0 { + panic("no return value specified for EnsureProject") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string) (string, error)); ok { + return rf(ctx, organizationID, projectID, billingAccountID) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string, string) string); ok { + r0 = rf(ctx, organizationID, projectID, billingAccountID) + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string, string) error); ok { + r1 = rf(ctx, organizationID, projectID, billingAccountID) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockGCPClienter_EnsureProject_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EnsureProject' +type MockGCPClienter_EnsureProject_Call struct { + *mock.Call +} + +// EnsureProject is a helper method to define mock.On call +// - ctx context.Context +// - organizationID string +// - projectID string +// - billingAccountID string +func (_e *MockGCPClienter_Expecter) EnsureProject(ctx interface{}, organizationID interface{}, projectID interface{}, billingAccountID interface{}) *MockGCPClienter_EnsureProject_Call { + return &MockGCPClienter_EnsureProject_Call{Call: _e.mock.On("EnsureProject", ctx, organizationID, projectID, billingAccountID)} +} + +func (_c *MockGCPClienter_EnsureProject_Call) Run(run func(ctx context.Context, organizationID string, projectID string, billingAccountID string)) *MockGCPClienter_EnsureProject_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(string)) + }) + return _c +} + +func (_c *MockGCPClienter_EnsureProject_Call) Return(_a0 string, _a1 error) *MockGCPClienter_EnsureProject_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockGCPClienter_EnsureProject_Call) RunAndReturn(run func(context.Context, string, string, string) (string, error)) *MockGCPClienter_EnsureProject_Call { + _c.Call.Return(run) + return _c +} + +// EnsureVPCNetwork provides a mock function with given fields: ctx, projectID, networkName +func (_m *MockGCPClienter) EnsureVPCNetwork(ctx context.Context, projectID string, networkName string) error { + ret := _m.Called(ctx, projectID, networkName) + + if len(ret) == 0 { + panic("no return value specified for EnsureVPCNetwork") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok { + r0 = rf(ctx, projectID, networkName) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockGCPClienter_EnsureVPCNetwork_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EnsureVPCNetwork' +type MockGCPClienter_EnsureVPCNetwork_Call struct { + *mock.Call +} + +// EnsureVPCNetwork is a helper method to define mock.On call +// - ctx context.Context +// - projectID string +// - networkName string +func (_e *MockGCPClienter_Expecter) EnsureVPCNetwork(ctx interface{}, projectID interface{}, networkName interface{}) *MockGCPClienter_EnsureVPCNetwork_Call { + return &MockGCPClienter_EnsureVPCNetwork_Call{Call: _e.mock.On("EnsureVPCNetwork", ctx, projectID, networkName)} +} + +func (_c *MockGCPClienter_EnsureVPCNetwork_Call) Run(run func(ctx context.Context, projectID string, networkName string)) *MockGCPClienter_EnsureVPCNetwork_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *MockGCPClienter_EnsureVPCNetwork_Call) Return(_a0 error) *MockGCPClienter_EnsureVPCNetwork_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockGCPClienter_EnsureVPCNetwork_Call) RunAndReturn(run func(context.Context, string, string) error) *MockGCPClienter_EnsureVPCNetwork_Call { + _c.Call.Return(run) + return _c +} + +// GetParentString provides a mock function with given fields: +func (_m *MockGCPClienter) GetParentString() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetParentString") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// MockGCPClienter_GetParentString_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetParentString' +type MockGCPClienter_GetParentString_Call struct { + *mock.Call +} + +// GetParentString is a helper method to define mock.On call +func (_e *MockGCPClienter_Expecter) GetParentString() *MockGCPClienter_GetParentString_Call { + return &MockGCPClienter_GetParentString_Call{Call: _e.mock.On("GetParentString")} +} + +func (_c *MockGCPClienter_GetParentString_Call) Run(run func()) *MockGCPClienter_GetParentString_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockGCPClienter_GetParentString_Call) Return(_a0 string) *MockGCPClienter_GetParentString_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockGCPClienter_GetParentString_Call) RunAndReturn(run func() string) *MockGCPClienter_GetParentString_Call { + _c.Call.Return(run) + return _c +} + +// GetVMExternalIP provides a mock function with given fields: ctx, vmName, locationData +func (_m *MockGCPClienter) GetVMExternalIP(ctx context.Context, vmName string, locationData map[string]string) (string, error) { + ret := _m.Called(ctx, vmName, locationData) + + if len(ret) == 0 { + panic("no return value specified for GetVMExternalIP") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, map[string]string) (string, error)); ok { + return rf(ctx, vmName, locationData) + } + if rf, ok := ret.Get(0).(func(context.Context, string, map[string]string) string); ok { + r0 = rf(ctx, vmName, locationData) + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func(context.Context, string, map[string]string) error); ok { + r1 = rf(ctx, vmName, locationData) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockGCPClienter_GetVMExternalIP_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetVMExternalIP' +type MockGCPClienter_GetVMExternalIP_Call struct { + *mock.Call +} + +// GetVMExternalIP is a helper method to define mock.On call +// - ctx context.Context +// - vmName string +// - locationData map[string]string +func (_e *MockGCPClienter_Expecter) GetVMExternalIP(ctx interface{}, vmName interface{}, locationData interface{}) *MockGCPClienter_GetVMExternalIP_Call { + return &MockGCPClienter_GetVMExternalIP_Call{Call: _e.mock.On("GetVMExternalIP", ctx, vmName, locationData)} +} + +func (_c *MockGCPClienter_GetVMExternalIP_Call) Run(run func(ctx context.Context, vmName string, locationData map[string]string)) *MockGCPClienter_GetVMExternalIP_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(map[string]string)) + }) + return _c +} + +func (_c *MockGCPClienter_GetVMExternalIP_Call) Return(_a0 string, _a1 error) *MockGCPClienter_GetVMExternalIP_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockGCPClienter_GetVMExternalIP_Call) RunAndReturn(run func(context.Context, string, map[string]string) (string, error)) *MockGCPClienter_GetVMExternalIP_Call { + _c.Call.Return(run) + return _c +} + +// GetVMZone provides a mock function with given fields: ctx, projectID, vmName +func (_m *MockGCPClienter) GetVMZone(ctx context.Context, projectID string, vmName string) (string, error) { + ret := _m.Called(ctx, projectID, vmName) + + if len(ret) == 0 { + panic("no return value specified for GetVMZone") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) (string, error)); ok { + return rf(ctx, projectID, vmName) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string) string); ok { + r0 = rf(ctx, projectID, vmName) + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { + r1 = rf(ctx, projectID, vmName) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockGCPClienter_GetVMZone_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetVMZone' +type MockGCPClienter_GetVMZone_Call struct { + *mock.Call +} + +// GetVMZone is a helper method to define mock.On call +// - ctx context.Context +// - projectID string +// - vmName string +func (_e *MockGCPClienter_Expecter) GetVMZone(ctx interface{}, projectID interface{}, vmName interface{}) *MockGCPClienter_GetVMZone_Call { + return &MockGCPClienter_GetVMZone_Call{Call: _e.mock.On("GetVMZone", ctx, projectID, vmName)} +} + +func (_c *MockGCPClienter_GetVMZone_Call) Run(run func(ctx context.Context, projectID string, vmName string)) *MockGCPClienter_GetVMZone_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *MockGCPClienter_GetVMZone_Call) Return(_a0 string, _a1 error) *MockGCPClienter_GetVMZone_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockGCPClienter_GetVMZone_Call) RunAndReturn(run func(context.Context, string, string) (string, error)) *MockGCPClienter_GetVMZone_Call { + _c.Call.Return(run) + return _c +} + +// IsAPIEnabled provides a mock function with given fields: ctx, projectID, apiName +func (_m *MockGCPClienter) IsAPIEnabled(ctx context.Context, projectID string, apiName string) (bool, error) { + ret := _m.Called(ctx, projectID, apiName) + + if len(ret) == 0 { + panic("no return value specified for IsAPIEnabled") + } + + var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) (bool, error)); ok { + return rf(ctx, projectID, apiName) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string) bool); ok { + r0 = rf(ctx, projectID, apiName) + } else { + r0 = ret.Get(0).(bool) + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { + r1 = rf(ctx, projectID, apiName) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockGCPClienter_IsAPIEnabled_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsAPIEnabled' +type MockGCPClienter_IsAPIEnabled_Call struct { + *mock.Call +} + +// IsAPIEnabled is a helper method to define mock.On call +// - ctx context.Context +// - projectID string +// - apiName string +func (_e *MockGCPClienter_Expecter) IsAPIEnabled(ctx interface{}, projectID interface{}, apiName interface{}) *MockGCPClienter_IsAPIEnabled_Call { + return &MockGCPClienter_IsAPIEnabled_Call{Call: _e.mock.On("IsAPIEnabled", ctx, projectID, apiName)} +} + +func (_c *MockGCPClienter_IsAPIEnabled_Call) Run(run func(ctx context.Context, projectID string, apiName string)) *MockGCPClienter_IsAPIEnabled_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *MockGCPClienter_IsAPIEnabled_Call) Return(_a0 bool, _a1 error) *MockGCPClienter_IsAPIEnabled_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockGCPClienter_IsAPIEnabled_Call) RunAndReturn(run func(context.Context, string, string) (bool, error)) *MockGCPClienter_IsAPIEnabled_Call { + _c.Call.Return(run) + return _c +} + +// ListAddresses provides a mock function with given fields: ctx, projectID, region +func (_m *MockGCPClienter) ListAddresses(ctx context.Context, projectID string, region string) ([]*computepb.Address, error) { + ret := _m.Called(ctx, projectID, region) + + if len(ret) == 0 { + panic("no return value specified for ListAddresses") + } + + var r0 []*computepb.Address + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) ([]*computepb.Address, error)); ok { + return rf(ctx, projectID, region) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string) []*computepb.Address); ok { + r0 = rf(ctx, projectID, region) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*computepb.Address) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { + r1 = rf(ctx, projectID, region) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockGCPClienter_ListAddresses_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListAddresses' +type MockGCPClienter_ListAddresses_Call struct { + *mock.Call +} + +// ListAddresses is a helper method to define mock.On call +// - ctx context.Context +// - projectID string +// - region string +func (_e *MockGCPClienter_Expecter) ListAddresses(ctx interface{}, projectID interface{}, region interface{}) *MockGCPClienter_ListAddresses_Call { + return &MockGCPClienter_ListAddresses_Call{Call: _e.mock.On("ListAddresses", ctx, projectID, region)} +} + +func (_c *MockGCPClienter_ListAddresses_Call) Run(run func(ctx context.Context, projectID string, region string)) *MockGCPClienter_ListAddresses_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *MockGCPClienter_ListAddresses_Call) Return(_a0 []*computepb.Address, _a1 error) *MockGCPClienter_ListAddresses_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockGCPClienter_ListAddresses_Call) RunAndReturn(run func(context.Context, string, string) ([]*computepb.Address, error)) *MockGCPClienter_ListAddresses_Call { + _c.Call.Return(run) + return _c +} + +// ListAllAssetsInProject provides a mock function with given fields: ctx, projectID +func (_m *MockGCPClienter) ListAllAssetsInProject(ctx context.Context, projectID string) ([]*assetpb.Asset, error) { + ret := _m.Called(ctx, projectID) + + if len(ret) == 0 { + panic("no return value specified for ListAllAssetsInProject") + } + + var r0 []*assetpb.Asset + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) ([]*assetpb.Asset, error)); ok { + return rf(ctx, projectID) + } + if rf, ok := ret.Get(0).(func(context.Context, string) []*assetpb.Asset); ok { + r0 = rf(ctx, projectID) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*assetpb.Asset) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, projectID) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockGCPClienter_ListAllAssetsInProject_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListAllAssetsInProject' +type MockGCPClienter_ListAllAssetsInProject_Call struct { + *mock.Call +} + +// ListAllAssetsInProject is a helper method to define mock.On call +// - ctx context.Context +// - projectID string +func (_e *MockGCPClienter_Expecter) ListAllAssetsInProject(ctx interface{}, projectID interface{}) *MockGCPClienter_ListAllAssetsInProject_Call { + return &MockGCPClienter_ListAllAssetsInProject_Call{Call: _e.mock.On("ListAllAssetsInProject", ctx, projectID)} +} + +func (_c *MockGCPClienter_ListAllAssetsInProject_Call) Run(run func(ctx context.Context, projectID string)) *MockGCPClienter_ListAllAssetsInProject_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockGCPClienter_ListAllAssetsInProject_Call) Return(_a0 []*assetpb.Asset, _a1 error) *MockGCPClienter_ListAllAssetsInProject_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockGCPClienter_ListAllAssetsInProject_Call) RunAndReturn(run func(context.Context, string) ([]*assetpb.Asset, error)) *MockGCPClienter_ListAllAssetsInProject_Call { + _c.Call.Return(run) + return _c +} + +// ListBillingAccounts provides a mock function with given fields: ctx +func (_m *MockGCPClienter) ListBillingAccounts(ctx context.Context) ([]string, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for ListBillingAccounts") + } + + var r0 []string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) ([]string, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) []string); ok { + r0 = rf(ctx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]string) + } + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockGCPClienter_ListBillingAccounts_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListBillingAccounts' +type MockGCPClienter_ListBillingAccounts_Call struct { + *mock.Call +} + +// ListBillingAccounts is a helper method to define mock.On call +// - ctx context.Context +func (_e *MockGCPClienter_Expecter) ListBillingAccounts(ctx interface{}) *MockGCPClienter_ListBillingAccounts_Call { + return &MockGCPClienter_ListBillingAccounts_Call{Call: _e.mock.On("ListBillingAccounts", ctx)} +} + +func (_c *MockGCPClienter_ListBillingAccounts_Call) Run(run func(ctx context.Context)) *MockGCPClienter_ListBillingAccounts_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *MockGCPClienter_ListBillingAccounts_Call) Return(_a0 []string, _a1 error) *MockGCPClienter_ListBillingAccounts_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockGCPClienter_ListBillingAccounts_Call) RunAndReturn(run func(context.Context) ([]string, error)) *MockGCPClienter_ListBillingAccounts_Call { + _c.Call.Return(run) + return _c +} + +// ListProjects provides a mock function with given fields: ctx, req +func (_m *MockGCPClienter) ListProjects(ctx context.Context, req *resourcemanagerpb.ListProjectsRequest) ([]*resourcemanagerpb.Project, error) { + ret := _m.Called(ctx, req) + + if len(ret) == 0 { + panic("no return value specified for ListProjects") + } + + var r0 []*resourcemanagerpb.Project + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *resourcemanagerpb.ListProjectsRequest) ([]*resourcemanagerpb.Project, error)); ok { + return rf(ctx, req) + } + if rf, ok := ret.Get(0).(func(context.Context, *resourcemanagerpb.ListProjectsRequest) []*resourcemanagerpb.Project); ok { + r0 = rf(ctx, req) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*resourcemanagerpb.Project) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *resourcemanagerpb.ListProjectsRequest) error); ok { + r1 = rf(ctx, req) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockGCPClienter_ListProjects_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListProjects' +type MockGCPClienter_ListProjects_Call struct { + *mock.Call +} + +// ListProjects is a helper method to define mock.On call +// - ctx context.Context +// - req *resourcemanagerpb.ListProjectsRequest +func (_e *MockGCPClienter_Expecter) ListProjects(ctx interface{}, req interface{}) *MockGCPClienter_ListProjects_Call { + return &MockGCPClienter_ListProjects_Call{Call: _e.mock.On("ListProjects", ctx, req)} +} + +func (_c *MockGCPClienter_ListProjects_Call) Run(run func(ctx context.Context, req *resourcemanagerpb.ListProjectsRequest)) *MockGCPClienter_ListProjects_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*resourcemanagerpb.ListProjectsRequest)) + }) + return _c +} + +func (_c *MockGCPClienter_ListProjects_Call) Return(_a0 []*resourcemanagerpb.Project, _a1 error) *MockGCPClienter_ListProjects_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockGCPClienter_ListProjects_Call) RunAndReturn(run func(context.Context, *resourcemanagerpb.ListProjectsRequest) ([]*resourcemanagerpb.Project, error)) *MockGCPClienter_ListProjects_Call { + _c.Call.Return(run) + return _c +} + +// ProjectExists provides a mock function with given fields: ctx, projectID +func (_m *MockGCPClienter) ProjectExists(ctx context.Context, projectID string) (bool, error) { + ret := _m.Called(ctx, projectID) + + if len(ret) == 0 { + panic("no return value specified for ProjectExists") + } + + var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (bool, error)); ok { + return rf(ctx, projectID) + } + if rf, ok := ret.Get(0).(func(context.Context, string) bool); ok { + r0 = rf(ctx, projectID) + } else { + r0 = ret.Get(0).(bool) + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, projectID) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockGCPClienter_ProjectExists_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ProjectExists' +type MockGCPClienter_ProjectExists_Call struct { + *mock.Call +} + +// ProjectExists is a helper method to define mock.On call +// - ctx context.Context +// - projectID string +func (_e *MockGCPClienter_Expecter) ProjectExists(ctx interface{}, projectID interface{}) *MockGCPClienter_ProjectExists_Call { + return &MockGCPClienter_ProjectExists_Call{Call: _e.mock.On("ProjectExists", ctx, projectID)} +} + +func (_c *MockGCPClienter_ProjectExists_Call) Run(run func(ctx context.Context, projectID string)) *MockGCPClienter_ProjectExists_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockGCPClienter_ProjectExists_Call) Return(_a0 bool, _a1 error) *MockGCPClienter_ProjectExists_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockGCPClienter_ProjectExists_Call) RunAndReturn(run func(context.Context, string) (bool, error)) *MockGCPClienter_ProjectExists_Call { + _c.Call.Return(run) + return _c +} + +// SetBillingAccount provides a mock function with given fields: ctx, projectID, billingAccountID +func (_m *MockGCPClienter) SetBillingAccount(ctx context.Context, projectID string, billingAccountID string) error { + ret := _m.Called(ctx, projectID, billingAccountID) + + if len(ret) == 0 { + panic("no return value specified for SetBillingAccount") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok { + r0 = rf(ctx, projectID, billingAccountID) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockGCPClienter_SetBillingAccount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetBillingAccount' +type MockGCPClienter_SetBillingAccount_Call struct { + *mock.Call +} + +// SetBillingAccount is a helper method to define mock.On call +// - ctx context.Context +// - projectID string +// - billingAccountID string +func (_e *MockGCPClienter_Expecter) SetBillingAccount(ctx interface{}, projectID interface{}, billingAccountID interface{}) *MockGCPClienter_SetBillingAccount_Call { + return &MockGCPClienter_SetBillingAccount_Call{Call: _e.mock.On("SetBillingAccount", ctx, projectID, billingAccountID)} +} + +func (_c *MockGCPClienter_SetBillingAccount_Call) Run(run func(ctx context.Context, projectID string, billingAccountID string)) *MockGCPClienter_SetBillingAccount_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *MockGCPClienter_SetBillingAccount_Call) Return(_a0 error) *MockGCPClienter_SetBillingAccount_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockGCPClienter_SetBillingAccount_Call) RunAndReturn(run func(context.Context, string, string) error) *MockGCPClienter_SetBillingAccount_Call { + _c.Call.Return(run) + return _c +} + +// SetParentString provides a mock function with given fields: organizationID +func (_m *MockGCPClienter) SetParentString(organizationID string) { + _m.Called(organizationID) +} + +// MockGCPClienter_SetParentString_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetParentString' +type MockGCPClienter_SetParentString_Call struct { + *mock.Call +} + +// SetParentString is a helper method to define mock.On call +// - organizationID string +func (_e *MockGCPClienter_Expecter) SetParentString(organizationID interface{}) *MockGCPClienter_SetParentString_Call { + return &MockGCPClienter_SetParentString_Call{Call: _e.mock.On("SetParentString", organizationID)} +} + +func (_c *MockGCPClienter_SetParentString_Call) Run(run func(organizationID string)) *MockGCPClienter_SetParentString_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *MockGCPClienter_SetParentString_Call) Return() *MockGCPClienter_SetParentString_Call { + _c.Call.Return() + return _c +} + +func (_c *MockGCPClienter_SetParentString_Call) RunAndReturn(run func(string)) *MockGCPClienter_SetParentString_Call { + _c.Call.Return(run) + return _c +} + +// StartResourcePolling provides a mock function with given fields: ctx +func (_m *MockGCPClienter) StartResourcePolling(ctx context.Context) error { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for StartResourcePolling") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context) error); ok { + r0 = rf(ctx) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockGCPClienter_StartResourcePolling_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StartResourcePolling' +type MockGCPClienter_StartResourcePolling_Call struct { + *mock.Call +} + +// StartResourcePolling is a helper method to define mock.On call +// - ctx context.Context +func (_e *MockGCPClienter_Expecter) StartResourcePolling(ctx interface{}) *MockGCPClienter_StartResourcePolling_Call { + return &MockGCPClienter_StartResourcePolling_Call{Call: _e.mock.On("StartResourcePolling", ctx)} +} + +func (_c *MockGCPClienter_StartResourcePolling_Call) Run(run func(ctx context.Context)) *MockGCPClienter_StartResourcePolling_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *MockGCPClienter_StartResourcePolling_Call) Return(_a0 error) *MockGCPClienter_StartResourcePolling_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockGCPClienter_StartResourcePolling_Call) RunAndReturn(run func(context.Context) error) *MockGCPClienter_StartResourcePolling_Call { + _c.Call.Return(run) + return _c +} + +// ValidateMachineType provides a mock function with given fields: ctx, projectID, machineType, location +func (_m *MockGCPClienter) ValidateMachineType(ctx context.Context, projectID string, machineType string, location string) (bool, error) { + ret := _m.Called(ctx, projectID, machineType, location) + + if len(ret) == 0 { + panic("no return value specified for ValidateMachineType") + } + + var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string) (bool, error)); ok { + return rf(ctx, projectID, machineType, location) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string, string) bool); ok { + r0 = rf(ctx, projectID, machineType, location) + } else { + r0 = ret.Get(0).(bool) + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string, string) error); ok { + r1 = rf(ctx, projectID, machineType, location) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockGCPClienter_ValidateMachineType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ValidateMachineType' +type MockGCPClienter_ValidateMachineType_Call struct { + *mock.Call +} + +// ValidateMachineType is a helper method to define mock.On call +// - ctx context.Context +// - projectID string +// - machineType string +// - location string +func (_e *MockGCPClienter_Expecter) ValidateMachineType(ctx interface{}, projectID interface{}, machineType interface{}, location interface{}) *MockGCPClienter_ValidateMachineType_Call { + return &MockGCPClienter_ValidateMachineType_Call{Call: _e.mock.On("ValidateMachineType", ctx, projectID, machineType, location)} +} + +func (_c *MockGCPClienter_ValidateMachineType_Call) Run(run func(ctx context.Context, projectID string, machineType string, location string)) *MockGCPClienter_ValidateMachineType_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(string)) + }) + return _c +} + +func (_c *MockGCPClienter_ValidateMachineType_Call) Return(_a0 bool, _a1 error) *MockGCPClienter_ValidateMachineType_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockGCPClienter_ValidateMachineType_Call) RunAndReturn(run func(context.Context, string, string, string) (bool, error)) *MockGCPClienter_ValidateMachineType_Call { + _c.Call.Return(run) + return _c +} + +// NewMockGCPClienter creates a new instance of MockGCPClienter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockGCPClienter(t interface { + mock.TestingT + Cleanup(func()) +}) *MockGCPClienter { + mock := &MockGCPClienter{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/pkg/models/interfaces/sshutils/mocks/sshutils/mock_SFTPClientCreator.go b/pkg/models/interfaces/sshutils/mocks/sshutils/mock_SFTPClientCreator.go new file mode 100644 index 00000000..5fde916e --- /dev/null +++ b/pkg/models/interfaces/sshutils/mocks/sshutils/mock_SFTPClientCreator.go @@ -0,0 +1,95 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package sshutils + +import ( + sftp "github.com/pkg/sftp" + mock "github.com/stretchr/testify/mock" + + sshutils "github.com/bacalhau-project/andaime/pkg/models/interfaces/sshutils" +) + +// MockSFTPClientCreator is an autogenerated mock type for the SFTPClientCreator type +type MockSFTPClientCreator struct { + mock.Mock +} + +type MockSFTPClientCreator_Expecter struct { + mock *mock.Mock +} + +func (_m *MockSFTPClientCreator) EXPECT() *MockSFTPClientCreator_Expecter { + return &MockSFTPClientCreator_Expecter{mock: &_m.Mock} +} + +// NewSFTPClient provides a mock function with given fields: client +func (_m *MockSFTPClientCreator) NewSFTPClient(client sshutils.SSHClienter) (*sftp.Client, error) { + ret := _m.Called(client) + + if len(ret) == 0 { + panic("no return value specified for NewSFTPClient") + } + + var r0 *sftp.Client + var r1 error + if rf, ok := ret.Get(0).(func(sshutils.SSHClienter) (*sftp.Client, error)); ok { + return rf(client) + } + if rf, ok := ret.Get(0).(func(sshutils.SSHClienter) *sftp.Client); ok { + r0 = rf(client) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*sftp.Client) + } + } + + if rf, ok := ret.Get(1).(func(sshutils.SSHClienter) error); ok { + r1 = rf(client) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockSFTPClientCreator_NewSFTPClient_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewSFTPClient' +type MockSFTPClientCreator_NewSFTPClient_Call struct { + *mock.Call +} + +// NewSFTPClient is a helper method to define mock.On call +// - client sshutils.SSHClienter +func (_e *MockSFTPClientCreator_Expecter) NewSFTPClient(client interface{}) *MockSFTPClientCreator_NewSFTPClient_Call { + return &MockSFTPClientCreator_NewSFTPClient_Call{Call: _e.mock.On("NewSFTPClient", client)} +} + +func (_c *MockSFTPClientCreator_NewSFTPClient_Call) Run(run func(client sshutils.SSHClienter)) *MockSFTPClientCreator_NewSFTPClient_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(sshutils.SSHClienter)) + }) + return _c +} + +func (_c *MockSFTPClientCreator_NewSFTPClient_Call) Return(_a0 *sftp.Client, _a1 error) *MockSFTPClientCreator_NewSFTPClient_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockSFTPClientCreator_NewSFTPClient_Call) RunAndReturn(run func(sshutils.SSHClienter) (*sftp.Client, error)) *MockSFTPClientCreator_NewSFTPClient_Call { + _c.Call.Return(run) + return _c +} + +// NewMockSFTPClientCreator creates a new instance of MockSFTPClientCreator. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockSFTPClientCreator(t interface { + mock.TestingT + Cleanup(func()) +}) *MockSFTPClientCreator { + mock := &MockSFTPClientCreator{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/pkg/models/interfaces/sshutils/mocks/sshutils/mock_SFTPClienter.go b/pkg/models/interfaces/sshutils/mocks/sshutils/mock_SFTPClienter.go new file mode 100644 index 00000000..5356c02c --- /dev/null +++ b/pkg/models/interfaces/sshutils/mocks/sshutils/mock_SFTPClienter.go @@ -0,0 +1,291 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package sshutils + +import ( + io "io" + fs "io/fs" + + mock "github.com/stretchr/testify/mock" +) + +// MockSFTPClienter is an autogenerated mock type for the SFTPClienter type +type MockSFTPClienter struct { + mock.Mock +} + +type MockSFTPClienter_Expecter struct { + mock *mock.Mock +} + +func (_m *MockSFTPClienter) EXPECT() *MockSFTPClienter_Expecter { + return &MockSFTPClienter_Expecter{mock: &_m.Mock} +} + +// Chmod provides a mock function with given fields: _a0, _a1 +func (_m *MockSFTPClienter) Chmod(_a0 string, _a1 fs.FileMode) error { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for Chmod") + } + + var r0 error + if rf, ok := ret.Get(0).(func(string, fs.FileMode) error); ok { + r0 = rf(_a0, _a1) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockSFTPClienter_Chmod_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Chmod' +type MockSFTPClienter_Chmod_Call struct { + *mock.Call +} + +// Chmod is a helper method to define mock.On call +// - _a0 string +// - _a1 fs.FileMode +func (_e *MockSFTPClienter_Expecter) Chmod(_a0 interface{}, _a1 interface{}) *MockSFTPClienter_Chmod_Call { + return &MockSFTPClienter_Chmod_Call{Call: _e.mock.On("Chmod", _a0, _a1)} +} + +func (_c *MockSFTPClienter_Chmod_Call) Run(run func(_a0 string, _a1 fs.FileMode)) *MockSFTPClienter_Chmod_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(fs.FileMode)) + }) + return _c +} + +func (_c *MockSFTPClienter_Chmod_Call) Return(_a0 error) *MockSFTPClienter_Chmod_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSFTPClienter_Chmod_Call) RunAndReturn(run func(string, fs.FileMode) error) *MockSFTPClienter_Chmod_Call { + _c.Call.Return(run) + return _c +} + +// Close provides a mock function with given fields: +func (_m *MockSFTPClienter) Close() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Close") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockSFTPClienter_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type MockSFTPClienter_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *MockSFTPClienter_Expecter) Close() *MockSFTPClienter_Close_Call { + return &MockSFTPClienter_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *MockSFTPClienter_Close_Call) Run(run func()) *MockSFTPClienter_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSFTPClienter_Close_Call) Return(_a0 error) *MockSFTPClienter_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSFTPClienter_Close_Call) RunAndReturn(run func() error) *MockSFTPClienter_Close_Call { + _c.Call.Return(run) + return _c +} + +// Create provides a mock function with given fields: _a0 +func (_m *MockSFTPClienter) Create(_a0 string) (io.WriteCloser, error) { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for Create") + } + + var r0 io.WriteCloser + var r1 error + if rf, ok := ret.Get(0).(func(string) (io.WriteCloser, error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(string) io.WriteCloser); ok { + r0 = rf(_a0) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(io.WriteCloser) + } + } + + if rf, ok := ret.Get(1).(func(string) error); ok { + r1 = rf(_a0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockSFTPClienter_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' +type MockSFTPClienter_Create_Call struct { + *mock.Call +} + +// Create is a helper method to define mock.On call +// - _a0 string +func (_e *MockSFTPClienter_Expecter) Create(_a0 interface{}) *MockSFTPClienter_Create_Call { + return &MockSFTPClienter_Create_Call{Call: _e.mock.On("Create", _a0)} +} + +func (_c *MockSFTPClienter_Create_Call) Run(run func(_a0 string)) *MockSFTPClienter_Create_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *MockSFTPClienter_Create_Call) Return(_a0 io.WriteCloser, _a1 error) *MockSFTPClienter_Create_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockSFTPClienter_Create_Call) RunAndReturn(run func(string) (io.WriteCloser, error)) *MockSFTPClienter_Create_Call { + _c.Call.Return(run) + return _c +} + +// MkdirAll provides a mock function with given fields: _a0 +func (_m *MockSFTPClienter) MkdirAll(_a0 string) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for MkdirAll") + } + + var r0 error + if rf, ok := ret.Get(0).(func(string) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockSFTPClienter_MkdirAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MkdirAll' +type MockSFTPClienter_MkdirAll_Call struct { + *mock.Call +} + +// MkdirAll is a helper method to define mock.On call +// - _a0 string +func (_e *MockSFTPClienter_Expecter) MkdirAll(_a0 interface{}) *MockSFTPClienter_MkdirAll_Call { + return &MockSFTPClienter_MkdirAll_Call{Call: _e.mock.On("MkdirAll", _a0)} +} + +func (_c *MockSFTPClienter_MkdirAll_Call) Run(run func(_a0 string)) *MockSFTPClienter_MkdirAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *MockSFTPClienter_MkdirAll_Call) Return(_a0 error) *MockSFTPClienter_MkdirAll_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSFTPClienter_MkdirAll_Call) RunAndReturn(run func(string) error) *MockSFTPClienter_MkdirAll_Call { + _c.Call.Return(run) + return _c +} + +// Open provides a mock function with given fields: _a0 +func (_m *MockSFTPClienter) Open(_a0 string) (io.ReadCloser, error) { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for Open") + } + + var r0 io.ReadCloser + var r1 error + if rf, ok := ret.Get(0).(func(string) (io.ReadCloser, error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(string) io.ReadCloser); ok { + r0 = rf(_a0) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(io.ReadCloser) + } + } + + if rf, ok := ret.Get(1).(func(string) error); ok { + r1 = rf(_a0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockSFTPClienter_Open_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Open' +type MockSFTPClienter_Open_Call struct { + *mock.Call +} + +// Open is a helper method to define mock.On call +// - _a0 string +func (_e *MockSFTPClienter_Expecter) Open(_a0 interface{}) *MockSFTPClienter_Open_Call { + return &MockSFTPClienter_Open_Call{Call: _e.mock.On("Open", _a0)} +} + +func (_c *MockSFTPClienter_Open_Call) Run(run func(_a0 string)) *MockSFTPClienter_Open_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *MockSFTPClienter_Open_Call) Return(_a0 io.ReadCloser, _a1 error) *MockSFTPClienter_Open_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockSFTPClienter_Open_Call) RunAndReturn(run func(string) (io.ReadCloser, error)) *MockSFTPClienter_Open_Call { + _c.Call.Return(run) + return _c +} + +// NewMockSFTPClienter creates a new instance of MockSFTPClienter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockSFTPClienter(t interface { + mock.TestingT + Cleanup(func()) +}) *MockSFTPClienter { + mock := &MockSFTPClienter{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/pkg/models/interfaces/sshutils/mocks/sshutils/mock_SFTPFile.go b/pkg/models/interfaces/sshutils/mocks/sshutils/mock_SFTPFile.go new file mode 100644 index 00000000..50435c57 --- /dev/null +++ b/pkg/models/interfaces/sshutils/mocks/sshutils/mock_SFTPFile.go @@ -0,0 +1,133 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package sshutils + +import mock "github.com/stretchr/testify/mock" + +// MockSFTPFile is an autogenerated mock type for the SFTPFile type +type MockSFTPFile struct { + mock.Mock +} + +type MockSFTPFile_Expecter struct { + mock *mock.Mock +} + +func (_m *MockSFTPFile) EXPECT() *MockSFTPFile_Expecter { + return &MockSFTPFile_Expecter{mock: &_m.Mock} +} + +// Close provides a mock function with given fields: +func (_m *MockSFTPFile) Close() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Close") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockSFTPFile_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type MockSFTPFile_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *MockSFTPFile_Expecter) Close() *MockSFTPFile_Close_Call { + return &MockSFTPFile_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *MockSFTPFile_Close_Call) Run(run func()) *MockSFTPFile_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSFTPFile_Close_Call) Return(_a0 error) *MockSFTPFile_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSFTPFile_Close_Call) RunAndReturn(run func() error) *MockSFTPFile_Close_Call { + _c.Call.Return(run) + return _c +} + +// Write provides a mock function with given fields: p +func (_m *MockSFTPFile) Write(p []byte) (int, error) { + ret := _m.Called(p) + + if len(ret) == 0 { + panic("no return value specified for Write") + } + + var r0 int + var r1 error + if rf, ok := ret.Get(0).(func([]byte) (int, error)); ok { + return rf(p) + } + if rf, ok := ret.Get(0).(func([]byte) int); ok { + r0 = rf(p) + } else { + r0 = ret.Get(0).(int) + } + + if rf, ok := ret.Get(1).(func([]byte) error); ok { + r1 = rf(p) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockSFTPFile_Write_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Write' +type MockSFTPFile_Write_Call struct { + *mock.Call +} + +// Write is a helper method to define mock.On call +// - p []byte +func (_e *MockSFTPFile_Expecter) Write(p interface{}) *MockSFTPFile_Write_Call { + return &MockSFTPFile_Write_Call{Call: _e.mock.On("Write", p)} +} + +func (_c *MockSFTPFile_Write_Call) Run(run func(p []byte)) *MockSFTPFile_Write_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]byte)) + }) + return _c +} + +func (_c *MockSFTPFile_Write_Call) Return(n int, err error) *MockSFTPFile_Write_Call { + _c.Call.Return(n, err) + return _c +} + +func (_c *MockSFTPFile_Write_Call) RunAndReturn(run func([]byte) (int, error)) *MockSFTPFile_Write_Call { + _c.Call.Return(run) + return _c +} + +// NewMockSFTPFile creates a new instance of MockSFTPFile. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockSFTPFile(t interface { + mock.TestingT + Cleanup(func()) +}) *MockSFTPFile { + mock := &MockSFTPFile{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/pkg/models/interfaces/sshutils/mocks/sshutils/mock_SSHClientCreator.go b/pkg/models/interfaces/sshutils/mocks/sshutils/mock_SSHClientCreator.go new file mode 100644 index 00000000..e965f233 --- /dev/null +++ b/pkg/models/interfaces/sshutils/mocks/sshutils/mock_SSHClientCreator.go @@ -0,0 +1,99 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package sshutils + +import ( + mock "github.com/stretchr/testify/mock" + ssh "golang.org/x/crypto/ssh" + + sshutils "github.com/bacalhau-project/andaime/pkg/models/interfaces/sshutils" +) + +// MockSSHClientCreator is an autogenerated mock type for the SSHClientCreator type +type MockSSHClientCreator struct { + mock.Mock +} + +type MockSSHClientCreator_Expecter struct { + mock *mock.Mock +} + +func (_m *MockSSHClientCreator) EXPECT() *MockSSHClientCreator_Expecter { + return &MockSSHClientCreator_Expecter{mock: &_m.Mock} +} + +// NewClient provides a mock function with given fields: host, port, user, privateKeyPath, config +func (_m *MockSSHClientCreator) NewClient(host string, port int, user string, privateKeyPath string, config *ssh.ClientConfig) (sshutils.SSHClienter, error) { + ret := _m.Called(host, port, user, privateKeyPath, config) + + if len(ret) == 0 { + panic("no return value specified for NewClient") + } + + var r0 sshutils.SSHClienter + var r1 error + if rf, ok := ret.Get(0).(func(string, int, string, string, *ssh.ClientConfig) (sshutils.SSHClienter, error)); ok { + return rf(host, port, user, privateKeyPath, config) + } + if rf, ok := ret.Get(0).(func(string, int, string, string, *ssh.ClientConfig) sshutils.SSHClienter); ok { + r0 = rf(host, port, user, privateKeyPath, config) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(sshutils.SSHClienter) + } + } + + if rf, ok := ret.Get(1).(func(string, int, string, string, *ssh.ClientConfig) error); ok { + r1 = rf(host, port, user, privateKeyPath, config) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockSSHClientCreator_NewClient_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewClient' +type MockSSHClientCreator_NewClient_Call struct { + *mock.Call +} + +// NewClient is a helper method to define mock.On call +// - host string +// - port int +// - user string +// - privateKeyPath string +// - config *ssh.ClientConfig +func (_e *MockSSHClientCreator_Expecter) NewClient(host interface{}, port interface{}, user interface{}, privateKeyPath interface{}, config interface{}) *MockSSHClientCreator_NewClient_Call { + return &MockSSHClientCreator_NewClient_Call{Call: _e.mock.On("NewClient", host, port, user, privateKeyPath, config)} +} + +func (_c *MockSSHClientCreator_NewClient_Call) Run(run func(host string, port int, user string, privateKeyPath string, config *ssh.ClientConfig)) *MockSSHClientCreator_NewClient_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(int), args[2].(string), args[3].(string), args[4].(*ssh.ClientConfig)) + }) + return _c +} + +func (_c *MockSSHClientCreator_NewClient_Call) Return(_a0 sshutils.SSHClienter, _a1 error) *MockSSHClientCreator_NewClient_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockSSHClientCreator_NewClient_Call) RunAndReturn(run func(string, int, string, string, *ssh.ClientConfig) (sshutils.SSHClienter, error)) *MockSSHClientCreator_NewClient_Call { + _c.Call.Return(run) + return _c +} + +// NewMockSSHClientCreator creates a new instance of MockSSHClientCreator. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockSSHClientCreator(t interface { + mock.TestingT + Cleanup(func()) +}) *MockSSHClientCreator { + mock := &MockSSHClientCreator{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/pkg/models/interfaces/sshutils/mocks/sshutils/mock_SSHClienter.go b/pkg/models/interfaces/sshutils/mocks/sshutils/mock_SSHClienter.go new file mode 100644 index 00000000..552a006f --- /dev/null +++ b/pkg/models/interfaces/sshutils/mocks/sshutils/mock_SSHClienter.go @@ -0,0 +1,288 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package sshutils + +import ( + mock "github.com/stretchr/testify/mock" + ssh "golang.org/x/crypto/ssh" + + sshutils "github.com/bacalhau-project/andaime/pkg/models/interfaces/sshutils" +) + +// MockSSHClienter is an autogenerated mock type for the SSHClienter type +type MockSSHClienter struct { + mock.Mock +} + +type MockSSHClienter_Expecter struct { + mock *mock.Mock +} + +func (_m *MockSSHClienter) EXPECT() *MockSSHClienter_Expecter { + return &MockSSHClienter_Expecter{mock: &_m.Mock} +} + +// Close provides a mock function with given fields: +func (_m *MockSSHClienter) Close() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Close") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockSSHClienter_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type MockSSHClienter_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *MockSSHClienter_Expecter) Close() *MockSSHClienter_Close_Call { + return &MockSSHClienter_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *MockSSHClienter_Close_Call) Run(run func()) *MockSSHClienter_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSSHClienter_Close_Call) Return(_a0 error) *MockSSHClienter_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHClienter_Close_Call) RunAndReturn(run func() error) *MockSSHClienter_Close_Call { + _c.Call.Return(run) + return _c +} + +// Connect provides a mock function with given fields: +func (_m *MockSSHClienter) Connect() (sshutils.SSHClienter, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Connect") + } + + var r0 sshutils.SSHClienter + var r1 error + if rf, ok := ret.Get(0).(func() (sshutils.SSHClienter, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() sshutils.SSHClienter); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(sshutils.SSHClienter) + } + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockSSHClienter_Connect_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Connect' +type MockSSHClienter_Connect_Call struct { + *mock.Call +} + +// Connect is a helper method to define mock.On call +func (_e *MockSSHClienter_Expecter) Connect() *MockSSHClienter_Connect_Call { + return &MockSSHClienter_Connect_Call{Call: _e.mock.On("Connect")} +} + +func (_c *MockSSHClienter_Connect_Call) Run(run func()) *MockSSHClienter_Connect_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSSHClienter_Connect_Call) Return(_a0 sshutils.SSHClienter, _a1 error) *MockSSHClienter_Connect_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockSSHClienter_Connect_Call) RunAndReturn(run func() (sshutils.SSHClienter, error)) *MockSSHClienter_Connect_Call { + _c.Call.Return(run) + return _c +} + +// GetClient provides a mock function with given fields: +func (_m *MockSSHClienter) GetClient() *ssh.Client { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetClient") + } + + var r0 *ssh.Client + if rf, ok := ret.Get(0).(func() *ssh.Client); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ssh.Client) + } + } + + return r0 +} + +// MockSSHClienter_GetClient_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetClient' +type MockSSHClienter_GetClient_Call struct { + *mock.Call +} + +// GetClient is a helper method to define mock.On call +func (_e *MockSSHClienter_Expecter) GetClient() *MockSSHClienter_GetClient_Call { + return &MockSSHClienter_GetClient_Call{Call: _e.mock.On("GetClient")} +} + +func (_c *MockSSHClienter_GetClient_Call) Run(run func()) *MockSSHClienter_GetClient_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSSHClienter_GetClient_Call) Return(_a0 *ssh.Client) *MockSSHClienter_GetClient_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHClienter_GetClient_Call) RunAndReturn(run func() *ssh.Client) *MockSSHClienter_GetClient_Call { + _c.Call.Return(run) + return _c +} + +// IsConnected provides a mock function with given fields: +func (_m *MockSSHClienter) IsConnected() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for IsConnected") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// MockSSHClienter_IsConnected_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsConnected' +type MockSSHClienter_IsConnected_Call struct { + *mock.Call +} + +// IsConnected is a helper method to define mock.On call +func (_e *MockSSHClienter_Expecter) IsConnected() *MockSSHClienter_IsConnected_Call { + return &MockSSHClienter_IsConnected_Call{Call: _e.mock.On("IsConnected")} +} + +func (_c *MockSSHClienter_IsConnected_Call) Run(run func()) *MockSSHClienter_IsConnected_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSSHClienter_IsConnected_Call) Return(_a0 bool) *MockSSHClienter_IsConnected_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHClienter_IsConnected_Call) RunAndReturn(run func() bool) *MockSSHClienter_IsConnected_Call { + _c.Call.Return(run) + return _c +} + +// NewSession provides a mock function with given fields: +func (_m *MockSSHClienter) NewSession() (sshutils.SSHSessioner, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for NewSession") + } + + var r0 sshutils.SSHSessioner + var r1 error + if rf, ok := ret.Get(0).(func() (sshutils.SSHSessioner, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() sshutils.SSHSessioner); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(sshutils.SSHSessioner) + } + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockSSHClienter_NewSession_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewSession' +type MockSSHClienter_NewSession_Call struct { + *mock.Call +} + +// NewSession is a helper method to define mock.On call +func (_e *MockSSHClienter_Expecter) NewSession() *MockSSHClienter_NewSession_Call { + return &MockSSHClienter_NewSession_Call{Call: _e.mock.On("NewSession")} +} + +func (_c *MockSSHClienter_NewSession_Call) Run(run func()) *MockSSHClienter_NewSession_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSSHClienter_NewSession_Call) Return(_a0 sshutils.SSHSessioner, _a1 error) *MockSSHClienter_NewSession_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockSSHClienter_NewSession_Call) RunAndReturn(run func() (sshutils.SSHSessioner, error)) *MockSSHClienter_NewSession_Call { + _c.Call.Return(run) + return _c +} + +// NewMockSSHClienter creates a new instance of MockSSHClienter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockSSHClienter(t interface { + mock.TestingT + Cleanup(func()) +}) *MockSSHClienter { + mock := &MockSSHClienter{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/pkg/models/interfaces/sshutils/mocks/sshutils/mock_SSHConfiger.go b/pkg/models/interfaces/sshutils/mocks/sshutils/mock_SSHConfiger.go new file mode 100644 index 00000000..4a57c1ab --- /dev/null +++ b/pkg/models/interfaces/sshutils/mocks/sshutils/mock_SSHConfiger.go @@ -0,0 +1,1067 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package sshutils + +import ( + context "context" + + mock "github.com/stretchr/testify/mock" + ssh "golang.org/x/crypto/ssh" + + sshutils "github.com/bacalhau-project/andaime/pkg/models/interfaces/sshutils" + + time "time" +) + +// MockSSHConfiger is an autogenerated mock type for the SSHConfiger type +type MockSSHConfiger struct { + mock.Mock +} + +type MockSSHConfiger_Expecter struct { + mock *mock.Mock +} + +func (_m *MockSSHConfiger) EXPECT() *MockSSHConfiger_Expecter { + return &MockSSHConfiger_Expecter{mock: &_m.Mock} +} + +// Close provides a mock function with given fields: +func (_m *MockSSHConfiger) Close() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Close") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockSSHConfiger_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type MockSSHConfiger_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *MockSSHConfiger_Expecter) Close() *MockSSHConfiger_Close_Call { + return &MockSSHConfiger_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *MockSSHConfiger_Close_Call) Run(run func()) *MockSSHConfiger_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSSHConfiger_Close_Call) Return(_a0 error) *MockSSHConfiger_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHConfiger_Close_Call) RunAndReturn(run func() error) *MockSSHConfiger_Close_Call { + _c.Call.Return(run) + return _c +} + +// Connect provides a mock function with given fields: +func (_m *MockSSHConfiger) Connect() (sshutils.SSHClienter, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Connect") + } + + var r0 sshutils.SSHClienter + var r1 error + if rf, ok := ret.Get(0).(func() (sshutils.SSHClienter, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() sshutils.SSHClienter); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(sshutils.SSHClienter) + } + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockSSHConfiger_Connect_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Connect' +type MockSSHConfiger_Connect_Call struct { + *mock.Call +} + +// Connect is a helper method to define mock.On call +func (_e *MockSSHConfiger_Expecter) Connect() *MockSSHConfiger_Connect_Call { + return &MockSSHConfiger_Connect_Call{Call: _e.mock.On("Connect")} +} + +func (_c *MockSSHConfiger_Connect_Call) Run(run func()) *MockSSHConfiger_Connect_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSSHConfiger_Connect_Call) Return(_a0 sshutils.SSHClienter, _a1 error) *MockSSHConfiger_Connect_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockSSHConfiger_Connect_Call) RunAndReturn(run func() (sshutils.SSHClienter, error)) *MockSSHConfiger_Connect_Call { + _c.Call.Return(run) + return _c +} + +// ExecuteCommand provides a mock function with given fields: ctx, command +func (_m *MockSSHConfiger) ExecuteCommand(ctx context.Context, command string) (string, error) { + ret := _m.Called(ctx, command) + + if len(ret) == 0 { + panic("no return value specified for ExecuteCommand") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (string, error)); ok { + return rf(ctx, command) + } + if rf, ok := ret.Get(0).(func(context.Context, string) string); ok { + r0 = rf(ctx, command) + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, command) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockSSHConfiger_ExecuteCommand_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExecuteCommand' +type MockSSHConfiger_ExecuteCommand_Call struct { + *mock.Call +} + +// ExecuteCommand is a helper method to define mock.On call +// - ctx context.Context +// - command string +func (_e *MockSSHConfiger_Expecter) ExecuteCommand(ctx interface{}, command interface{}) *MockSSHConfiger_ExecuteCommand_Call { + return &MockSSHConfiger_ExecuteCommand_Call{Call: _e.mock.On("ExecuteCommand", ctx, command)} +} + +func (_c *MockSSHConfiger_ExecuteCommand_Call) Run(run func(ctx context.Context, command string)) *MockSSHConfiger_ExecuteCommand_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockSSHConfiger_ExecuteCommand_Call) Return(_a0 string, _a1 error) *MockSSHConfiger_ExecuteCommand_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockSSHConfiger_ExecuteCommand_Call) RunAndReturn(run func(context.Context, string) (string, error)) *MockSSHConfiger_ExecuteCommand_Call { + _c.Call.Return(run) + return _c +} + +// ExecuteCommandWithCallback provides a mock function with given fields: ctx, command, callback +func (_m *MockSSHConfiger) ExecuteCommandWithCallback(ctx context.Context, command string, callback func(string)) (string, error) { + ret := _m.Called(ctx, command, callback) + + if len(ret) == 0 { + panic("no return value specified for ExecuteCommandWithCallback") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, func(string)) (string, error)); ok { + return rf(ctx, command, callback) + } + if rf, ok := ret.Get(0).(func(context.Context, string, func(string)) string); ok { + r0 = rf(ctx, command, callback) + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func(context.Context, string, func(string)) error); ok { + r1 = rf(ctx, command, callback) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockSSHConfiger_ExecuteCommandWithCallback_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExecuteCommandWithCallback' +type MockSSHConfiger_ExecuteCommandWithCallback_Call struct { + *mock.Call +} + +// ExecuteCommandWithCallback is a helper method to define mock.On call +// - ctx context.Context +// - command string +// - callback func(string) +func (_e *MockSSHConfiger_Expecter) ExecuteCommandWithCallback(ctx interface{}, command interface{}, callback interface{}) *MockSSHConfiger_ExecuteCommandWithCallback_Call { + return &MockSSHConfiger_ExecuteCommandWithCallback_Call{Call: _e.mock.On("ExecuteCommandWithCallback", ctx, command, callback)} +} + +func (_c *MockSSHConfiger_ExecuteCommandWithCallback_Call) Run(run func(ctx context.Context, command string, callback func(string))) *MockSSHConfiger_ExecuteCommandWithCallback_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(func(string))) + }) + return _c +} + +func (_c *MockSSHConfiger_ExecuteCommandWithCallback_Call) Return(_a0 string, _a1 error) *MockSSHConfiger_ExecuteCommandWithCallback_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockSSHConfiger_ExecuteCommandWithCallback_Call) RunAndReturn(run func(context.Context, string, func(string)) (string, error)) *MockSSHConfiger_ExecuteCommandWithCallback_Call { + _c.Call.Return(run) + return _c +} + +// GetHost provides a mock function with given fields: +func (_m *MockSSHConfiger) GetHost() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetHost") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// MockSSHConfiger_GetHost_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetHost' +type MockSSHConfiger_GetHost_Call struct { + *mock.Call +} + +// GetHost is a helper method to define mock.On call +func (_e *MockSSHConfiger_Expecter) GetHost() *MockSSHConfiger_GetHost_Call { + return &MockSSHConfiger_GetHost_Call{Call: _e.mock.On("GetHost")} +} + +func (_c *MockSSHConfiger_GetHost_Call) Run(run func()) *MockSSHConfiger_GetHost_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSSHConfiger_GetHost_Call) Return(_a0 string) *MockSSHConfiger_GetHost_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHConfiger_GetHost_Call) RunAndReturn(run func() string) *MockSSHConfiger_GetHost_Call { + _c.Call.Return(run) + return _c +} + +// GetPort provides a mock function with given fields: +func (_m *MockSSHConfiger) GetPort() int { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetPort") + } + + var r0 int + if rf, ok := ret.Get(0).(func() int); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(int) + } + + return r0 +} + +// MockSSHConfiger_GetPort_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPort' +type MockSSHConfiger_GetPort_Call struct { + *mock.Call +} + +// GetPort is a helper method to define mock.On call +func (_e *MockSSHConfiger_Expecter) GetPort() *MockSSHConfiger_GetPort_Call { + return &MockSSHConfiger_GetPort_Call{Call: _e.mock.On("GetPort")} +} + +func (_c *MockSSHConfiger_GetPort_Call) Run(run func()) *MockSSHConfiger_GetPort_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSSHConfiger_GetPort_Call) Return(_a0 int) *MockSSHConfiger_GetPort_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHConfiger_GetPort_Call) RunAndReturn(run func() int) *MockSSHConfiger_GetPort_Call { + _c.Call.Return(run) + return _c +} + +// GetPrivateKeyMaterial provides a mock function with given fields: +func (_m *MockSSHConfiger) GetPrivateKeyMaterial() []byte { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetPrivateKeyMaterial") + } + + var r0 []byte + if rf, ok := ret.Get(0).(func() []byte); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]byte) + } + } + + return r0 +} + +// MockSSHConfiger_GetPrivateKeyMaterial_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPrivateKeyMaterial' +type MockSSHConfiger_GetPrivateKeyMaterial_Call struct { + *mock.Call +} + +// GetPrivateKeyMaterial is a helper method to define mock.On call +func (_e *MockSSHConfiger_Expecter) GetPrivateKeyMaterial() *MockSSHConfiger_GetPrivateKeyMaterial_Call { + return &MockSSHConfiger_GetPrivateKeyMaterial_Call{Call: _e.mock.On("GetPrivateKeyMaterial")} +} + +func (_c *MockSSHConfiger_GetPrivateKeyMaterial_Call) Run(run func()) *MockSSHConfiger_GetPrivateKeyMaterial_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSSHConfiger_GetPrivateKeyMaterial_Call) Return(_a0 []byte) *MockSSHConfiger_GetPrivateKeyMaterial_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHConfiger_GetPrivateKeyMaterial_Call) RunAndReturn(run func() []byte) *MockSSHConfiger_GetPrivateKeyMaterial_Call { + _c.Call.Return(run) + return _c +} + +// GetSFTPClientCreator provides a mock function with given fields: +func (_m *MockSSHConfiger) GetSFTPClientCreator() sshutils.SFTPClientCreator { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetSFTPClientCreator") + } + + var r0 sshutils.SFTPClientCreator + if rf, ok := ret.Get(0).(func() sshutils.SFTPClientCreator); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(sshutils.SFTPClientCreator) + } + } + + return r0 +} + +// MockSSHConfiger_GetSFTPClientCreator_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSFTPClientCreator' +type MockSSHConfiger_GetSFTPClientCreator_Call struct { + *mock.Call +} + +// GetSFTPClientCreator is a helper method to define mock.On call +func (_e *MockSSHConfiger_Expecter) GetSFTPClientCreator() *MockSSHConfiger_GetSFTPClientCreator_Call { + return &MockSSHConfiger_GetSFTPClientCreator_Call{Call: _e.mock.On("GetSFTPClientCreator")} +} + +func (_c *MockSSHConfiger_GetSFTPClientCreator_Call) Run(run func()) *MockSSHConfiger_GetSFTPClientCreator_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSSHConfiger_GetSFTPClientCreator_Call) Return(_a0 sshutils.SFTPClientCreator) *MockSSHConfiger_GetSFTPClientCreator_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHConfiger_GetSFTPClientCreator_Call) RunAndReturn(run func() sshutils.SFTPClientCreator) *MockSSHConfiger_GetSFTPClientCreator_Call { + _c.Call.Return(run) + return _c +} + +// GetSSHClient provides a mock function with given fields: +func (_m *MockSSHConfiger) GetSSHClient() *ssh.Client { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetSSHClient") + } + + var r0 *ssh.Client + if rf, ok := ret.Get(0).(func() *ssh.Client); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ssh.Client) + } + } + + return r0 +} + +// MockSSHConfiger_GetSSHClient_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSSHClient' +type MockSSHConfiger_GetSSHClient_Call struct { + *mock.Call +} + +// GetSSHClient is a helper method to define mock.On call +func (_e *MockSSHConfiger_Expecter) GetSSHClient() *MockSSHConfiger_GetSSHClient_Call { + return &MockSSHConfiger_GetSSHClient_Call{Call: _e.mock.On("GetSSHClient")} +} + +func (_c *MockSSHConfiger_GetSSHClient_Call) Run(run func()) *MockSSHConfiger_GetSSHClient_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSSHConfiger_GetSSHClient_Call) Return(_a0 *ssh.Client) *MockSSHConfiger_GetSSHClient_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHConfiger_GetSSHClient_Call) RunAndReturn(run func() *ssh.Client) *MockSSHConfiger_GetSSHClient_Call { + _c.Call.Return(run) + return _c +} + +// GetSSHClientCreator provides a mock function with given fields: +func (_m *MockSSHConfiger) GetSSHClientCreator() sshutils.SSHClientCreator { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetSSHClientCreator") + } + + var r0 sshutils.SSHClientCreator + if rf, ok := ret.Get(0).(func() sshutils.SSHClientCreator); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(sshutils.SSHClientCreator) + } + } + + return r0 +} + +// MockSSHConfiger_GetSSHClientCreator_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSSHClientCreator' +type MockSSHConfiger_GetSSHClientCreator_Call struct { + *mock.Call +} + +// GetSSHClientCreator is a helper method to define mock.On call +func (_e *MockSSHConfiger_Expecter) GetSSHClientCreator() *MockSSHConfiger_GetSSHClientCreator_Call { + return &MockSSHConfiger_GetSSHClientCreator_Call{Call: _e.mock.On("GetSSHClientCreator")} +} + +func (_c *MockSSHConfiger_GetSSHClientCreator_Call) Run(run func()) *MockSSHConfiger_GetSSHClientCreator_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSSHConfiger_GetSSHClientCreator_Call) Return(_a0 sshutils.SSHClientCreator) *MockSSHConfiger_GetSSHClientCreator_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHConfiger_GetSSHClientCreator_Call) RunAndReturn(run func() sshutils.SSHClientCreator) *MockSSHConfiger_GetSSHClientCreator_Call { + _c.Call.Return(run) + return _c +} + +// GetUser provides a mock function with given fields: +func (_m *MockSSHConfiger) GetUser() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetUser") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// MockSSHConfiger_GetUser_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUser' +type MockSSHConfiger_GetUser_Call struct { + *mock.Call +} + +// GetUser is a helper method to define mock.On call +func (_e *MockSSHConfiger_Expecter) GetUser() *MockSSHConfiger_GetUser_Call { + return &MockSSHConfiger_GetUser_Call{Call: _e.mock.On("GetUser")} +} + +func (_c *MockSSHConfiger_GetUser_Call) Run(run func()) *MockSSHConfiger_GetUser_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSSHConfiger_GetUser_Call) Return(_a0 string) *MockSSHConfiger_GetUser_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHConfiger_GetUser_Call) RunAndReturn(run func() string) *MockSSHConfiger_GetUser_Call { + _c.Call.Return(run) + return _c +} + +// InstallSystemdService provides a mock function with given fields: ctx, serviceName, serviceContent +func (_m *MockSSHConfiger) InstallSystemdService(ctx context.Context, serviceName string, serviceContent string) error { + ret := _m.Called(ctx, serviceName, serviceContent) + + if len(ret) == 0 { + panic("no return value specified for InstallSystemdService") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok { + r0 = rf(ctx, serviceName, serviceContent) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockSSHConfiger_InstallSystemdService_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'InstallSystemdService' +type MockSSHConfiger_InstallSystemdService_Call struct { + *mock.Call +} + +// InstallSystemdService is a helper method to define mock.On call +// - ctx context.Context +// - serviceName string +// - serviceContent string +func (_e *MockSSHConfiger_Expecter) InstallSystemdService(ctx interface{}, serviceName interface{}, serviceContent interface{}) *MockSSHConfiger_InstallSystemdService_Call { + return &MockSSHConfiger_InstallSystemdService_Call{Call: _e.mock.On("InstallSystemdService", ctx, serviceName, serviceContent)} +} + +func (_c *MockSSHConfiger_InstallSystemdService_Call) Run(run func(ctx context.Context, serviceName string, serviceContent string)) *MockSSHConfiger_InstallSystemdService_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *MockSSHConfiger_InstallSystemdService_Call) Return(_a0 error) *MockSSHConfiger_InstallSystemdService_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHConfiger_InstallSystemdService_Call) RunAndReturn(run func(context.Context, string, string) error) *MockSSHConfiger_InstallSystemdService_Call { + _c.Call.Return(run) + return _c +} + +// IsConnected provides a mock function with given fields: +func (_m *MockSSHConfiger) IsConnected() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for IsConnected") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// MockSSHConfiger_IsConnected_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsConnected' +type MockSSHConfiger_IsConnected_Call struct { + *mock.Call +} + +// IsConnected is a helper method to define mock.On call +func (_e *MockSSHConfiger_Expecter) IsConnected() *MockSSHConfiger_IsConnected_Call { + return &MockSSHConfiger_IsConnected_Call{Call: _e.mock.On("IsConnected")} +} + +func (_c *MockSSHConfiger_IsConnected_Call) Run(run func()) *MockSSHConfiger_IsConnected_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSSHConfiger_IsConnected_Call) Return(_a0 bool) *MockSSHConfiger_IsConnected_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHConfiger_IsConnected_Call) RunAndReturn(run func() bool) *MockSSHConfiger_IsConnected_Call { + _c.Call.Return(run) + return _c +} + +// PushFile provides a mock function with given fields: ctx, remotePath, content, executable +func (_m *MockSSHConfiger) PushFile(ctx context.Context, remotePath string, content []byte, executable bool) error { + ret := _m.Called(ctx, remotePath, content, executable) + + if len(ret) == 0 { + panic("no return value specified for PushFile") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, []byte, bool) error); ok { + r0 = rf(ctx, remotePath, content, executable) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockSSHConfiger_PushFile_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PushFile' +type MockSSHConfiger_PushFile_Call struct { + *mock.Call +} + +// PushFile is a helper method to define mock.On call +// - ctx context.Context +// - remotePath string +// - content []byte +// - executable bool +func (_e *MockSSHConfiger_Expecter) PushFile(ctx interface{}, remotePath interface{}, content interface{}, executable interface{}) *MockSSHConfiger_PushFile_Call { + return &MockSSHConfiger_PushFile_Call{Call: _e.mock.On("PushFile", ctx, remotePath, content, executable)} +} + +func (_c *MockSSHConfiger_PushFile_Call) Run(run func(ctx context.Context, remotePath string, content []byte, executable bool)) *MockSSHConfiger_PushFile_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].([]byte), args[3].(bool)) + }) + return _c +} + +func (_c *MockSSHConfiger_PushFile_Call) Return(_a0 error) *MockSSHConfiger_PushFile_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHConfiger_PushFile_Call) RunAndReturn(run func(context.Context, string, []byte, bool) error) *MockSSHConfiger_PushFile_Call { + _c.Call.Return(run) + return _c +} + +// PushFileWithCallback provides a mock function with given fields: ctx, remotePath, content, executable, callback +func (_m *MockSSHConfiger) PushFileWithCallback(ctx context.Context, remotePath string, content []byte, executable bool, callback func(int64, int64)) error { + ret := _m.Called(ctx, remotePath, content, executable, callback) + + if len(ret) == 0 { + panic("no return value specified for PushFileWithCallback") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, []byte, bool, func(int64, int64)) error); ok { + r0 = rf(ctx, remotePath, content, executable, callback) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockSSHConfiger_PushFileWithCallback_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PushFileWithCallback' +type MockSSHConfiger_PushFileWithCallback_Call struct { + *mock.Call +} + +// PushFileWithCallback is a helper method to define mock.On call +// - ctx context.Context +// - remotePath string +// - content []byte +// - executable bool +// - callback func(int64 , int64) +func (_e *MockSSHConfiger_Expecter) PushFileWithCallback(ctx interface{}, remotePath interface{}, content interface{}, executable interface{}, callback interface{}) *MockSSHConfiger_PushFileWithCallback_Call { + return &MockSSHConfiger_PushFileWithCallback_Call{Call: _e.mock.On("PushFileWithCallback", ctx, remotePath, content, executable, callback)} +} + +func (_c *MockSSHConfiger_PushFileWithCallback_Call) Run(run func(ctx context.Context, remotePath string, content []byte, executable bool, callback func(int64, int64))) *MockSSHConfiger_PushFileWithCallback_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].([]byte), args[3].(bool), args[4].(func(int64, int64))) + }) + return _c +} + +func (_c *MockSSHConfiger_PushFileWithCallback_Call) Return(_a0 error) *MockSSHConfiger_PushFileWithCallback_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHConfiger_PushFileWithCallback_Call) RunAndReturn(run func(context.Context, string, []byte, bool, func(int64, int64)) error) *MockSSHConfiger_PushFileWithCallback_Call { + _c.Call.Return(run) + return _c +} + +// RestartService provides a mock function with given fields: ctx, serviceName +func (_m *MockSSHConfiger) RestartService(ctx context.Context, serviceName string) (string, error) { + ret := _m.Called(ctx, serviceName) + + if len(ret) == 0 { + panic("no return value specified for RestartService") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (string, error)); ok { + return rf(ctx, serviceName) + } + if rf, ok := ret.Get(0).(func(context.Context, string) string); ok { + r0 = rf(ctx, serviceName) + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, serviceName) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockSSHConfiger_RestartService_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RestartService' +type MockSSHConfiger_RestartService_Call struct { + *mock.Call +} + +// RestartService is a helper method to define mock.On call +// - ctx context.Context +// - serviceName string +func (_e *MockSSHConfiger_Expecter) RestartService(ctx interface{}, serviceName interface{}) *MockSSHConfiger_RestartService_Call { + return &MockSSHConfiger_RestartService_Call{Call: _e.mock.On("RestartService", ctx, serviceName)} +} + +func (_c *MockSSHConfiger_RestartService_Call) Run(run func(ctx context.Context, serviceName string)) *MockSSHConfiger_RestartService_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockSSHConfiger_RestartService_Call) Return(_a0 string, _a1 error) *MockSSHConfiger_RestartService_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockSSHConfiger_RestartService_Call) RunAndReturn(run func(context.Context, string) (string, error)) *MockSSHConfiger_RestartService_Call { + _c.Call.Return(run) + return _c +} + +// SetSFTPClientCreator provides a mock function with given fields: clientCreator +func (_m *MockSSHConfiger) SetSFTPClientCreator(clientCreator sshutils.SFTPClientCreator) { + _m.Called(clientCreator) +} + +// MockSSHConfiger_SetSFTPClientCreator_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetSFTPClientCreator' +type MockSSHConfiger_SetSFTPClientCreator_Call struct { + *mock.Call +} + +// SetSFTPClientCreator is a helper method to define mock.On call +// - clientCreator sshutils.SFTPClientCreator +func (_e *MockSSHConfiger_Expecter) SetSFTPClientCreator(clientCreator interface{}) *MockSSHConfiger_SetSFTPClientCreator_Call { + return &MockSSHConfiger_SetSFTPClientCreator_Call{Call: _e.mock.On("SetSFTPClientCreator", clientCreator)} +} + +func (_c *MockSSHConfiger_SetSFTPClientCreator_Call) Run(run func(clientCreator sshutils.SFTPClientCreator)) *MockSSHConfiger_SetSFTPClientCreator_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(sshutils.SFTPClientCreator)) + }) + return _c +} + +func (_c *MockSSHConfiger_SetSFTPClientCreator_Call) Return() *MockSSHConfiger_SetSFTPClientCreator_Call { + _c.Call.Return() + return _c +} + +func (_c *MockSSHConfiger_SetSFTPClientCreator_Call) RunAndReturn(run func(sshutils.SFTPClientCreator)) *MockSSHConfiger_SetSFTPClientCreator_Call { + _c.Call.Return(run) + return _c +} + +// SetSSHClient provides a mock function with given fields: client +func (_m *MockSSHConfiger) SetSSHClient(client *ssh.Client) { + _m.Called(client) +} + +// MockSSHConfiger_SetSSHClient_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetSSHClient' +type MockSSHConfiger_SetSSHClient_Call struct { + *mock.Call +} + +// SetSSHClient is a helper method to define mock.On call +// - client *ssh.Client +func (_e *MockSSHConfiger_Expecter) SetSSHClient(client interface{}) *MockSSHConfiger_SetSSHClient_Call { + return &MockSSHConfiger_SetSSHClient_Call{Call: _e.mock.On("SetSSHClient", client)} +} + +func (_c *MockSSHConfiger_SetSSHClient_Call) Run(run func(client *ssh.Client)) *MockSSHConfiger_SetSSHClient_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*ssh.Client)) + }) + return _c +} + +func (_c *MockSSHConfiger_SetSSHClient_Call) Return() *MockSSHConfiger_SetSSHClient_Call { + _c.Call.Return() + return _c +} + +func (_c *MockSSHConfiger_SetSSHClient_Call) RunAndReturn(run func(*ssh.Client)) *MockSSHConfiger_SetSSHClient_Call { + _c.Call.Return(run) + return _c +} + +// SetSSHClientCreator provides a mock function with given fields: clientCreator +func (_m *MockSSHConfiger) SetSSHClientCreator(clientCreator sshutils.SSHClientCreator) { + _m.Called(clientCreator) +} + +// MockSSHConfiger_SetSSHClientCreator_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetSSHClientCreator' +type MockSSHConfiger_SetSSHClientCreator_Call struct { + *mock.Call +} + +// SetSSHClientCreator is a helper method to define mock.On call +// - clientCreator sshutils.SSHClientCreator +func (_e *MockSSHConfiger_Expecter) SetSSHClientCreator(clientCreator interface{}) *MockSSHConfiger_SetSSHClientCreator_Call { + return &MockSSHConfiger_SetSSHClientCreator_Call{Call: _e.mock.On("SetSSHClientCreator", clientCreator)} +} + +func (_c *MockSSHConfiger_SetSSHClientCreator_Call) Run(run func(clientCreator sshutils.SSHClientCreator)) *MockSSHConfiger_SetSSHClientCreator_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(sshutils.SSHClientCreator)) + }) + return _c +} + +func (_c *MockSSHConfiger_SetSSHClientCreator_Call) Return() *MockSSHConfiger_SetSSHClientCreator_Call { + _c.Call.Return() + return _c +} + +func (_c *MockSSHConfiger_SetSSHClientCreator_Call) RunAndReturn(run func(sshutils.SSHClientCreator)) *MockSSHConfiger_SetSSHClientCreator_Call { + _c.Call.Return(run) + return _c +} + +// SetValidateSSHConnection provides a mock function with given fields: fn +func (_m *MockSSHConfiger) SetValidateSSHConnection(fn func() error) { + _m.Called(fn) +} + +// MockSSHConfiger_SetValidateSSHConnection_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetValidateSSHConnection' +type MockSSHConfiger_SetValidateSSHConnection_Call struct { + *mock.Call +} + +// SetValidateSSHConnection is a helper method to define mock.On call +// - fn func() error +func (_e *MockSSHConfiger_Expecter) SetValidateSSHConnection(fn interface{}) *MockSSHConfiger_SetValidateSSHConnection_Call { + return &MockSSHConfiger_SetValidateSSHConnection_Call{Call: _e.mock.On("SetValidateSSHConnection", fn)} +} + +func (_c *MockSSHConfiger_SetValidateSSHConnection_Call) Run(run func(fn func() error)) *MockSSHConfiger_SetValidateSSHConnection_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(func() error)) + }) + return _c +} + +func (_c *MockSSHConfiger_SetValidateSSHConnection_Call) Return() *MockSSHConfiger_SetValidateSSHConnection_Call { + _c.Call.Return() + return _c +} + +func (_c *MockSSHConfiger_SetValidateSSHConnection_Call) RunAndReturn(run func(func() error)) *MockSSHConfiger_SetValidateSSHConnection_Call { + _c.Call.Return(run) + return _c +} + +// StartService provides a mock function with given fields: ctx, serviceName +func (_m *MockSSHConfiger) StartService(ctx context.Context, serviceName string) (string, error) { + ret := _m.Called(ctx, serviceName) + + if len(ret) == 0 { + panic("no return value specified for StartService") + } + + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (string, error)); ok { + return rf(ctx, serviceName) + } + if rf, ok := ret.Get(0).(func(context.Context, string) string); ok { + r0 = rf(ctx, serviceName) + } else { + r0 = ret.Get(0).(string) + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, serviceName) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockSSHConfiger_StartService_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StartService' +type MockSSHConfiger_StartService_Call struct { + *mock.Call +} + +// StartService is a helper method to define mock.On call +// - ctx context.Context +// - serviceName string +func (_e *MockSSHConfiger_Expecter) StartService(ctx interface{}, serviceName interface{}) *MockSSHConfiger_StartService_Call { + return &MockSSHConfiger_StartService_Call{Call: _e.mock.On("StartService", ctx, serviceName)} +} + +func (_c *MockSSHConfiger_StartService_Call) Run(run func(ctx context.Context, serviceName string)) *MockSSHConfiger_StartService_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockSSHConfiger_StartService_Call) Return(_a0 string, _a1 error) *MockSSHConfiger_StartService_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockSSHConfiger_StartService_Call) RunAndReturn(run func(context.Context, string) (string, error)) *MockSSHConfiger_StartService_Call { + _c.Call.Return(run) + return _c +} + +// WaitForSSH provides a mock function with given fields: ctx, retry, timeout +func (_m *MockSSHConfiger) WaitForSSH(ctx context.Context, retry int, timeout time.Duration) error { + ret := _m.Called(ctx, retry, timeout) + + if len(ret) == 0 { + panic("no return value specified for WaitForSSH") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, int, time.Duration) error); ok { + r0 = rf(ctx, retry, timeout) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockSSHConfiger_WaitForSSH_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WaitForSSH' +type MockSSHConfiger_WaitForSSH_Call struct { + *mock.Call +} + +// WaitForSSH is a helper method to define mock.On call +// - ctx context.Context +// - retry int +// - timeout time.Duration +func (_e *MockSSHConfiger_Expecter) WaitForSSH(ctx interface{}, retry interface{}, timeout interface{}) *MockSSHConfiger_WaitForSSH_Call { + return &MockSSHConfiger_WaitForSSH_Call{Call: _e.mock.On("WaitForSSH", ctx, retry, timeout)} +} + +func (_c *MockSSHConfiger_WaitForSSH_Call) Run(run func(ctx context.Context, retry int, timeout time.Duration)) *MockSSHConfiger_WaitForSSH_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int), args[2].(time.Duration)) + }) + return _c +} + +func (_c *MockSSHConfiger_WaitForSSH_Call) Return(_a0 error) *MockSSHConfiger_WaitForSSH_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHConfiger_WaitForSSH_Call) RunAndReturn(run func(context.Context, int, time.Duration) error) *MockSSHConfiger_WaitForSSH_Call { + _c.Call.Return(run) + return _c +} + +// NewMockSSHConfiger creates a new instance of MockSSHConfiger. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockSSHConfiger(t interface { + mock.TestingT + Cleanup(func()) +}) *MockSSHConfiger { + mock := &MockSSHConfiger{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/pkg/models/interfaces/sshutils/mocks/sshutils/mock_SSHSessioner.go b/pkg/models/interfaces/sshutils/mocks/sshutils/mock_SSHSessioner.go new file mode 100644 index 00000000..f8d1a556 --- /dev/null +++ b/pkg/models/interfaces/sshutils/mocks/sshutils/mock_SSHSessioner.go @@ -0,0 +1,446 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package sshutils + +import ( + io "io" + + mock "github.com/stretchr/testify/mock" + ssh "golang.org/x/crypto/ssh" +) + +// MockSSHSessioner is an autogenerated mock type for the SSHSessioner type +type MockSSHSessioner struct { + mock.Mock +} + +type MockSSHSessioner_Expecter struct { + mock *mock.Mock +} + +func (_m *MockSSHSessioner) EXPECT() *MockSSHSessioner_Expecter { + return &MockSSHSessioner_Expecter{mock: &_m.Mock} +} + +// Close provides a mock function with given fields: +func (_m *MockSSHSessioner) Close() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Close") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockSSHSessioner_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type MockSSHSessioner_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *MockSSHSessioner_Expecter) Close() *MockSSHSessioner_Close_Call { + return &MockSSHSessioner_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *MockSSHSessioner_Close_Call) Run(run func()) *MockSSHSessioner_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSSHSessioner_Close_Call) Return(_a0 error) *MockSSHSessioner_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHSessioner_Close_Call) RunAndReturn(run func() error) *MockSSHSessioner_Close_Call { + _c.Call.Return(run) + return _c +} + +// CombinedOutput provides a mock function with given fields: cmd +func (_m *MockSSHSessioner) CombinedOutput(cmd string) ([]byte, error) { + ret := _m.Called(cmd) + + if len(ret) == 0 { + panic("no return value specified for CombinedOutput") + } + + var r0 []byte + var r1 error + if rf, ok := ret.Get(0).(func(string) ([]byte, error)); ok { + return rf(cmd) + } + if rf, ok := ret.Get(0).(func(string) []byte); ok { + r0 = rf(cmd) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]byte) + } + } + + if rf, ok := ret.Get(1).(func(string) error); ok { + r1 = rf(cmd) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockSSHSessioner_CombinedOutput_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CombinedOutput' +type MockSSHSessioner_CombinedOutput_Call struct { + *mock.Call +} + +// CombinedOutput is a helper method to define mock.On call +// - cmd string +func (_e *MockSSHSessioner_Expecter) CombinedOutput(cmd interface{}) *MockSSHSessioner_CombinedOutput_Call { + return &MockSSHSessioner_CombinedOutput_Call{Call: _e.mock.On("CombinedOutput", cmd)} +} + +func (_c *MockSSHSessioner_CombinedOutput_Call) Run(run func(cmd string)) *MockSSHSessioner_CombinedOutput_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *MockSSHSessioner_CombinedOutput_Call) Return(_a0 []byte, _a1 error) *MockSSHSessioner_CombinedOutput_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockSSHSessioner_CombinedOutput_Call) RunAndReturn(run func(string) ([]byte, error)) *MockSSHSessioner_CombinedOutput_Call { + _c.Call.Return(run) + return _c +} + +// Run provides a mock function with given fields: cmd +func (_m *MockSSHSessioner) Run(cmd string) error { + ret := _m.Called(cmd) + + if len(ret) == 0 { + panic("no return value specified for Run") + } + + var r0 error + if rf, ok := ret.Get(0).(func(string) error); ok { + r0 = rf(cmd) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockSSHSessioner_Run_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Run' +type MockSSHSessioner_Run_Call struct { + *mock.Call +} + +// Run is a helper method to define mock.On call +// - cmd string +func (_e *MockSSHSessioner_Expecter) Run(cmd interface{}) *MockSSHSessioner_Run_Call { + return &MockSSHSessioner_Run_Call{Call: _e.mock.On("Run", cmd)} +} + +func (_c *MockSSHSessioner_Run_Call) Run(run func(cmd string)) *MockSSHSessioner_Run_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *MockSSHSessioner_Run_Call) Return(_a0 error) *MockSSHSessioner_Run_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHSessioner_Run_Call) RunAndReturn(run func(string) error) *MockSSHSessioner_Run_Call { + _c.Call.Return(run) + return _c +} + +// SetStderr provides a mock function with given fields: _a0 +func (_m *MockSSHSessioner) SetStderr(_a0 io.Writer) { + _m.Called(_a0) +} + +// MockSSHSessioner_SetStderr_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetStderr' +type MockSSHSessioner_SetStderr_Call struct { + *mock.Call +} + +// SetStderr is a helper method to define mock.On call +// - _a0 io.Writer +func (_e *MockSSHSessioner_Expecter) SetStderr(_a0 interface{}) *MockSSHSessioner_SetStderr_Call { + return &MockSSHSessioner_SetStderr_Call{Call: _e.mock.On("SetStderr", _a0)} +} + +func (_c *MockSSHSessioner_SetStderr_Call) Run(run func(_a0 io.Writer)) *MockSSHSessioner_SetStderr_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(io.Writer)) + }) + return _c +} + +func (_c *MockSSHSessioner_SetStderr_Call) Return() *MockSSHSessioner_SetStderr_Call { + _c.Call.Return() + return _c +} + +func (_c *MockSSHSessioner_SetStderr_Call) RunAndReturn(run func(io.Writer)) *MockSSHSessioner_SetStderr_Call { + _c.Call.Return(run) + return _c +} + +// SetStdout provides a mock function with given fields: _a0 +func (_m *MockSSHSessioner) SetStdout(_a0 io.Writer) { + _m.Called(_a0) +} + +// MockSSHSessioner_SetStdout_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetStdout' +type MockSSHSessioner_SetStdout_Call struct { + *mock.Call +} + +// SetStdout is a helper method to define mock.On call +// - _a0 io.Writer +func (_e *MockSSHSessioner_Expecter) SetStdout(_a0 interface{}) *MockSSHSessioner_SetStdout_Call { + return &MockSSHSessioner_SetStdout_Call{Call: _e.mock.On("SetStdout", _a0)} +} + +func (_c *MockSSHSessioner_SetStdout_Call) Run(run func(_a0 io.Writer)) *MockSSHSessioner_SetStdout_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(io.Writer)) + }) + return _c +} + +func (_c *MockSSHSessioner_SetStdout_Call) Return() *MockSSHSessioner_SetStdout_Call { + _c.Call.Return() + return _c +} + +func (_c *MockSSHSessioner_SetStdout_Call) RunAndReturn(run func(io.Writer)) *MockSSHSessioner_SetStdout_Call { + _c.Call.Return(run) + return _c +} + +// Signal provides a mock function with given fields: sig +func (_m *MockSSHSessioner) Signal(sig ssh.Signal) error { + ret := _m.Called(sig) + + if len(ret) == 0 { + panic("no return value specified for Signal") + } + + var r0 error + if rf, ok := ret.Get(0).(func(ssh.Signal) error); ok { + r0 = rf(sig) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockSSHSessioner_Signal_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Signal' +type MockSSHSessioner_Signal_Call struct { + *mock.Call +} + +// Signal is a helper method to define mock.On call +// - sig ssh.Signal +func (_e *MockSSHSessioner_Expecter) Signal(sig interface{}) *MockSSHSessioner_Signal_Call { + return &MockSSHSessioner_Signal_Call{Call: _e.mock.On("Signal", sig)} +} + +func (_c *MockSSHSessioner_Signal_Call) Run(run func(sig ssh.Signal)) *MockSSHSessioner_Signal_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(ssh.Signal)) + }) + return _c +} + +func (_c *MockSSHSessioner_Signal_Call) Return(_a0 error) *MockSSHSessioner_Signal_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHSessioner_Signal_Call) RunAndReturn(run func(ssh.Signal) error) *MockSSHSessioner_Signal_Call { + _c.Call.Return(run) + return _c +} + +// Start provides a mock function with given fields: cmd +func (_m *MockSSHSessioner) Start(cmd string) error { + ret := _m.Called(cmd) + + if len(ret) == 0 { + panic("no return value specified for Start") + } + + var r0 error + if rf, ok := ret.Get(0).(func(string) error); ok { + r0 = rf(cmd) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockSSHSessioner_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' +type MockSSHSessioner_Start_Call struct { + *mock.Call +} + +// Start is a helper method to define mock.On call +// - cmd string +func (_e *MockSSHSessioner_Expecter) Start(cmd interface{}) *MockSSHSessioner_Start_Call { + return &MockSSHSessioner_Start_Call{Call: _e.mock.On("Start", cmd)} +} + +func (_c *MockSSHSessioner_Start_Call) Run(run func(cmd string)) *MockSSHSessioner_Start_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *MockSSHSessioner_Start_Call) Return(_a0 error) *MockSSHSessioner_Start_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHSessioner_Start_Call) RunAndReturn(run func(string) error) *MockSSHSessioner_Start_Call { + _c.Call.Return(run) + return _c +} + +// StdinPipe provides a mock function with given fields: +func (_m *MockSSHSessioner) StdinPipe() (io.WriteCloser, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for StdinPipe") + } + + var r0 io.WriteCloser + var r1 error + if rf, ok := ret.Get(0).(func() (io.WriteCloser, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() io.WriteCloser); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(io.WriteCloser) + } + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockSSHSessioner_StdinPipe_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StdinPipe' +type MockSSHSessioner_StdinPipe_Call struct { + *mock.Call +} + +// StdinPipe is a helper method to define mock.On call +func (_e *MockSSHSessioner_Expecter) StdinPipe() *MockSSHSessioner_StdinPipe_Call { + return &MockSSHSessioner_StdinPipe_Call{Call: _e.mock.On("StdinPipe")} +} + +func (_c *MockSSHSessioner_StdinPipe_Call) Run(run func()) *MockSSHSessioner_StdinPipe_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSSHSessioner_StdinPipe_Call) Return(_a0 io.WriteCloser, _a1 error) *MockSSHSessioner_StdinPipe_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockSSHSessioner_StdinPipe_Call) RunAndReturn(run func() (io.WriteCloser, error)) *MockSSHSessioner_StdinPipe_Call { + _c.Call.Return(run) + return _c +} + +// Wait provides a mock function with given fields: +func (_m *MockSSHSessioner) Wait() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Wait") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockSSHSessioner_Wait_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Wait' +type MockSSHSessioner_Wait_Call struct { + *mock.Call +} + +// Wait is a helper method to define mock.On call +func (_e *MockSSHSessioner_Expecter) Wait() *MockSSHSessioner_Wait_Call { + return &MockSSHSessioner_Wait_Call{Call: _e.mock.On("Wait")} +} + +func (_c *MockSSHSessioner_Wait_Call) Run(run func()) *MockSSHSessioner_Wait_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockSSHSessioner_Wait_Call) Return(_a0 error) *MockSSHSessioner_Wait_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockSSHSessioner_Wait_Call) RunAndReturn(run func() error) *MockSSHSessioner_Wait_Call { + _c.Call.Return(run) + return _c +} + +// NewMockSSHSessioner creates a new instance of MockSSHSessioner. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockSSHSessioner(t interface { + mock.TestingT + Cleanup(func()) +}) *MockSSHSessioner { + mock := &MockSSHSessioner{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/pkg/models/interfaces/sshutils/session.go b/pkg/models/interfaces/sshutils/session.go new file mode 100644 index 00000000..a761e261 --- /dev/null +++ b/pkg/models/interfaces/sshutils/session.go @@ -0,0 +1,20 @@ +package sshutils + +import ( + "io" + + "golang.org/x/crypto/ssh" +) + +// SSHSessioner defines the interface for SSH session operations +type SSHSessioner interface { + Run(cmd string) error + CombinedOutput(cmd string) ([]byte, error) + Close() error + StdinPipe() (io.WriteCloser, error) + Start(cmd string) error + Wait() error + SetStdout(io.Writer) + SetStderr(io.Writer) + Signal(sig ssh.Signal) error +} diff --git a/pkg/models/interfaces/sshutils/sftp.go b/pkg/models/interfaces/sshutils/sftp.go new file mode 100644 index 00000000..ec6830c8 --- /dev/null +++ b/pkg/models/interfaces/sshutils/sftp.go @@ -0,0 +1,21 @@ +package sshutils + +import ( + "io" + "os" +) + +//go:generate mockery --name SFTPFile +type SFTPFile interface { + Write(p []byte) (n int, err error) + Close() error +} + +// SFTPClienter defines the interface for SFTP clients +type SFTPClienter interface { + Create(string) (io.WriteCloser, error) + Open(string) (io.ReadCloser, error) + MkdirAll(string) error + Chmod(string, os.FileMode) error + Close() error +} diff --git a/pkg/models/interfaces/sshutils/ssh_client.go b/pkg/models/interfaces/sshutils/ssh_client.go new file mode 100644 index 00000000..56b1c330 --- /dev/null +++ b/pkg/models/interfaces/sshutils/ssh_client.go @@ -0,0 +1,23 @@ +package sshutils + +import "golang.org/x/crypto/ssh" + +// SSHClienter defines the interface for SSH client operations +type SSHClienter interface { + NewSession() (SSHSessioner, error) + Close() error + GetClient() *ssh.Client + IsConnected() bool + Connect() (SSHClienter, error) +} + +// SSHClientCreator defines the interface for creating SSH clients +type SSHClientCreator interface { + NewClient( + host string, + port int, + user string, + privateKeyPath string, + config *ssh.ClientConfig, + ) (SSHClienter, error) +} diff --git a/pkg/models/interfaces/sshutils/ssh_interfaces.go b/pkg/models/interfaces/sshutils/ssh_interfaces.go new file mode 100644 index 00000000..db852509 --- /dev/null +++ b/pkg/models/interfaces/sshutils/ssh_interfaces.go @@ -0,0 +1,62 @@ +package sshutils + +import ( + "context" + "time" + + "github.com/pkg/sftp" + "golang.org/x/crypto/ssh" +) + +// SSHConfiger defines the interface for SSH configuration and operations +type SSHConfiger interface { + // Connection methods + Connect() (SSHClienter, error) + WaitForSSH(ctx context.Context, retry int, timeout time.Duration) error + Close() error + IsConnected() bool + + // Configuration getters + GetHost() string + GetPort() int + GetUser() string + GetPrivateKeyMaterial() []byte + + // SSH client management + GetSSHClient() *ssh.Client + SetSSHClient(client *ssh.Client) + SetValidateSSHConnection(fn func() error) + + // Remote operations + ExecuteCommand(ctx context.Context, command string) (string, error) + ExecuteCommandWithCallback( + ctx context.Context, + command string, + callback func(string), + ) (string, error) + PushFile(ctx context.Context, remotePath string, content []byte, executable bool) error + PushFileWithCallback( + ctx context.Context, + remotePath string, + content []byte, + executable bool, + callback func(int64, int64), + ) error + + // Service management + InstallSystemdService(ctx context.Context, serviceName, serviceContent string) error + StartService(ctx context.Context, serviceName string) (string, error) + RestartService(ctx context.Context, serviceName string) (string, error) + + // Client creator management + GetSSHClientCreator() SSHClientCreator + SetSSHClientCreator(clientCreator SSHClientCreator) + + GetSFTPClientCreator() SFTPClientCreator + SetSFTPClientCreator(clientCreator SFTPClientCreator) +} + +// SFTPClientCreator defines the interface for creating SFTP clients +type SFTPClientCreator interface { + NewSFTPClient(client SSHClienter) (*sftp.Client, error) +} diff --git a/pkg/models/machine.go b/pkg/models/machine.go index be50e65c..fd6eba4a 100644 --- a/pkg/models/machine.go +++ b/pkg/models/machine.go @@ -18,6 +18,8 @@ import ( "github.com/bacalhau-project/andaime/pkg/utils" ) +var ExpectedDockerOutput = "Hello from Docker!" + type Machiner interface { // Basic information GetID() string @@ -605,8 +607,12 @@ func (mach *Machine) verifyDocker(ctx context.Context) error { return err } - if !strings.Contains(output, "Hello from Docker!") { - return fmt.Errorf("failed to verify Docker on machine %s: output: %s", mach.Name, output) + if !strings.Contains(output, ExpectedDockerOutput) { + return fmt.Errorf( + "docker verify ran, but did not get expected output on machine %s: output: %s", + mach.Name, + output, + ) } return nil @@ -640,6 +646,13 @@ func (mach *Machine) installService( return err } + // Connect to the remote host + if _, err := sshConfig.Connect(); err != nil { + l.Errorf("Error connecting to remote host: %v", err) + return err + } + defer sshConfig.Close() + scriptBytes, err := scriptGetter() if err != nil { return err diff --git a/pkg/providers/aws/aws_compute_operations.go b/pkg/providers/aws/aws_compute_operations.go new file mode 100644 index 00000000..70eaa4bf --- /dev/null +++ b/pkg/providers/aws/aws_compute_operations.go @@ -0,0 +1,421 @@ +package aws + +import ( + "context" + "fmt" + "time" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/config" + "github.com/aws/aws-sdk-go-v2/service/ec2" + ec2_types "github.com/aws/aws-sdk-go-v2/service/ec2/types" + "github.com/bacalhau-project/andaime/pkg/display" + "github.com/bacalhau-project/andaime/pkg/models" + aws_interface "github.com/bacalhau-project/andaime/pkg/models/interfaces/aws" + "golang.org/x/sync/errgroup" +) + +// LiveEC2Client implements the EC2Clienter interface +type LiveEC2Client struct { + client *ec2.Client +} + +// NewEC2Client creates a new EC2 client +func NewEC2Client(ctx context.Context) (aws_interface.EC2Clienter, error) { + cfg, err := config.LoadDefaultConfig(ctx) + if err != nil { + return nil, err + } + return &LiveEC2Client{client: ec2.NewFromConfig(cfg)}, nil +} + +func (c *LiveEC2Client) RunInstances( + ctx context.Context, + params *ec2.RunInstancesInput, + optFns ...func(*ec2.Options), +) (*ec2.RunInstancesOutput, error) { + return c.client.RunInstances(ctx, params, optFns...) +} + +func (c *LiveEC2Client) DescribeInstances( + ctx context.Context, + params *ec2.DescribeInstancesInput, + optFns ...func(*ec2.Options), +) (*ec2.DescribeInstancesOutput, error) { + return c.client.DescribeInstances(ctx, params, optFns...) +} + +func (c *LiveEC2Client) TerminateInstances( + ctx context.Context, + params *ec2.TerminateInstancesInput, + optFns ...func(*ec2.Options), +) (*ec2.TerminateInstancesOutput, error) { + return c.client.TerminateInstances(ctx, params, optFns...) +} + +func (c *LiveEC2Client) DescribeImages( + ctx context.Context, + params *ec2.DescribeImagesInput, + optFns ...func(*ec2.Options), +) (*ec2.DescribeImagesOutput, error) { + return c.client.DescribeImages(ctx, params, optFns...) +} + +func (c *LiveEC2Client) CreateVpc( + ctx context.Context, + params *ec2.CreateVpcInput, + optFns ...func(*ec2.Options), +) (*ec2.CreateVpcOutput, error) { + return c.client.CreateVpc(ctx, params, optFns...) +} + +func (c *LiveEC2Client) CreateSubnet( + ctx context.Context, + params *ec2.CreateSubnetInput, + optFns ...func(*ec2.Options), +) (*ec2.CreateSubnetOutput, error) { + return c.client.CreateSubnet(ctx, params, optFns...) +} + +func (c *LiveEC2Client) DescribeAvailabilityZones( + ctx context.Context, + params *ec2.DescribeAvailabilityZonesInput, + optFns ...func(*ec2.Options), +) (*ec2.DescribeAvailabilityZonesOutput, error) { + return c.client.DescribeAvailabilityZones(ctx, params, optFns...) +} + +func (c *LiveEC2Client) DeleteSecurityGroup( + ctx context.Context, + params *ec2.DeleteSecurityGroupInput, + optFns ...func(*ec2.Options), +) (*ec2.DeleteSecurityGroupOutput, error) { + return c.client.DeleteSecurityGroup(ctx, params, optFns...) +} + +func (c *LiveEC2Client) CreateSecurityGroup( + ctx context.Context, + params *ec2.CreateSecurityGroupInput, + optFns ...func(*ec2.Options), +) (*ec2.CreateSecurityGroupOutput, error) { + return c.client.CreateSecurityGroup(ctx, params, optFns...) +} + +func (c *LiveEC2Client) DescribeSecurityGroups( + ctx context.Context, + params *ec2.DescribeSecurityGroupsInput, + optFns ...func(*ec2.Options), +) (*ec2.DescribeSecurityGroupsOutput, error) { + return c.client.DescribeSecurityGroups(ctx, params, optFns...) +} + +func (c *LiveEC2Client) AuthorizeSecurityGroupIngress( + ctx context.Context, + params *ec2.AuthorizeSecurityGroupIngressInput, + optFns ...func(*ec2.Options), +) (*ec2.AuthorizeSecurityGroupIngressOutput, error) { + return c.client.AuthorizeSecurityGroupIngress(ctx, params, optFns...) +} + +func (c *LiveEC2Client) DescribeSubnets( + ctx context.Context, + params *ec2.DescribeSubnetsInput, + optFns ...func(*ec2.Options), +) (*ec2.DescribeSubnetsOutput, error) { + return c.client.DescribeSubnets(ctx, params, optFns...) +} + +func (c *LiveEC2Client) DeleteVpc( + ctx context.Context, + params *ec2.DeleteVpcInput, + optFns ...func(*ec2.Options), +) (*ec2.DeleteVpcOutput, error) { + return c.client.DeleteVpc(ctx, params, optFns...) +} + +func (c *LiveEC2Client) CreateInternetGateway( + ctx context.Context, + params *ec2.CreateInternetGatewayInput, + optFns ...func(*ec2.Options), +) (*ec2.CreateInternetGatewayOutput, error) { + return c.client.CreateInternetGateway(ctx, params, optFns...) +} + +func (c *LiveEC2Client) AttachInternetGateway( + ctx context.Context, + params *ec2.AttachInternetGatewayInput, + optFns ...func(*ec2.Options), +) (*ec2.AttachInternetGatewayOutput, error) { + return c.client.AttachInternetGateway(ctx, params, optFns...) +} + +func (c *LiveEC2Client) CreateRouteTable( + ctx context.Context, + params *ec2.CreateRouteTableInput, + optFns ...func(*ec2.Options), +) (*ec2.CreateRouteTableOutput, error) { + return c.client.CreateRouteTable(ctx, params, optFns...) +} + +func (c *LiveEC2Client) CreateRoute( + ctx context.Context, + params *ec2.CreateRouteInput, + optFns ...func(*ec2.Options), +) (*ec2.CreateRouteOutput, error) { + return c.client.CreateRoute(ctx, params, optFns...) +} + +func (c *LiveEC2Client) AssociateRouteTable( + ctx context.Context, + params *ec2.AssociateRouteTableInput, + optFns ...func(*ec2.Options), +) (*ec2.AssociateRouteTableOutput, error) { + return c.client.AssociateRouteTable(ctx, params, optFns...) +} + +func (c *LiveEC2Client) DescribeRouteTables( + ctx context.Context, + params *ec2.DescribeRouteTablesInput, + optFns ...func(*ec2.Options), +) (*ec2.DescribeRouteTablesOutput, error) { + return c.client.DescribeRouteTables(ctx, params, optFns...) +} + +func (c *LiveEC2Client) DeleteSubnet( + ctx context.Context, + params *ec2.DeleteSubnetInput, + optFns ...func(*ec2.Options), +) (*ec2.DeleteSubnetOutput, error) { + return c.client.DeleteSubnet(ctx, params, optFns...) +} + +func (c *LiveEC2Client) DescribeVpcs( + ctx context.Context, + params *ec2.DescribeVpcsInput, + optFns ...func(*ec2.Options), +) (*ec2.DescribeVpcsOutput, error) { + return c.client.DescribeVpcs(ctx, params, optFns...) +} + +func (c *LiveEC2Client) DescribeRegions( + ctx context.Context, + params *ec2.DescribeRegionsInput, + optFns ...func(*ec2.Options), +) (*ec2.DescribeRegionsOutput, error) { + return c.client.DescribeRegions(ctx, params, optFns...) +} + +func (c *LiveEC2Client) ModifyVpcAttribute( + ctx context.Context, + params *ec2.ModifyVpcAttributeInput, + optFns ...func(*ec2.Options), +) (*ec2.ModifyVpcAttributeOutput, error) { + return c.client.ModifyVpcAttribute(ctx, params, optFns...) +} + +func (c *LiveEC2Client) DisassociateRouteTable( + ctx context.Context, + params *ec2.DisassociateRouteTableInput, + optFns ...func(*ec2.Options), +) (*ec2.DisassociateRouteTableOutput, error) { + return c.client.DisassociateRouteTable(ctx, params, optFns...) +} + +func (c *LiveEC2Client) DeleteRouteTable( + ctx context.Context, + params *ec2.DeleteRouteTableInput, + optFns ...func(*ec2.Options), +) (*ec2.DeleteRouteTableOutput, error) { + return c.client.DeleteRouteTable(ctx, params, optFns...) +} + +func (c *LiveEC2Client) DescribeInternetGateways( + ctx context.Context, + params *ec2.DescribeInternetGatewaysInput, + optFns ...func(*ec2.Options), +) (*ec2.DescribeInternetGatewaysOutput, error) { + return c.client.DescribeInternetGateways(ctx, params, optFns...) +} + +func (c *LiveEC2Client) DetachInternetGateway( + ctx context.Context, + params *ec2.DetachInternetGatewayInput, + optFns ...func(*ec2.Options), +) (*ec2.DetachInternetGatewayOutput, error) { + return c.client.DetachInternetGateway(ctx, params, optFns...) +} + +func (c *LiveEC2Client) DeleteInternetGateway( + ctx context.Context, + params *ec2.DeleteInternetGatewayInput, + optFns ...func(*ec2.Options), +) (*ec2.DeleteInternetGatewayOutput, error) { + return c.client.DeleteInternetGateway(ctx, params, optFns...) +} + +const ( + SSHRetryInterval = 10 * time.Second + MaxRetries = 30 +) + +func (p *AWSProvider) DeployVMsInParallel( + ctx context.Context, +) error { + m := display.GetGlobalModelFunc() + if m == nil || m.Deployment == nil { + return fmt.Errorf("global model or deployment is nil") + } + deployment := m.Deployment + + eg := errgroup.Group{} + + // Group machines by region + machinesByRegion := make(map[string][]models.Machiner) + for _, machine := range deployment.Machines { + region := machine.GetLocation() + if region == "" { + continue + } + // Convert zone to region if necessary + if len(region) > 0 && region[len(region)-1] >= 'a' && region[len(region)-1] <= 'z' { + region = region[:len(region)-1] + } + machinesByRegion[region] = append(machinesByRegion[region], machine) + } + + // Deploy machines in each region + for region, machines := range machinesByRegion { + vpc, exists := deployment.AWS.RegionalResources.VPCs[region] + if !exists { + return fmt.Errorf("VPC not found for region %s", region) + } + + // Create EC2 client for the region + ec2Client, err := p.getOrCreateEC2Client(ctx, region) + if err != nil { + return fmt.Errorf("failed to create EC2 client for region %s: %w", region, err) + } + + // Deploy machines in parallel within each region + for _, machine := range machines { + eg.Go(func() error { + if err := p.deployVM(ctx, ec2Client, machine, vpc); err != nil { + return fmt.Errorf( + "failed to deploy VM %s in region %s: %w", + machine.GetName(), + region, + err, + ) + } + return nil + }) + } + } + + if err := eg.Wait(); err != nil { + return err + } + + return nil +} + +func (p *AWSProvider) deployVM( + ctx context.Context, + ec2Client aws_interface.EC2Clienter, + machine models.Machiner, + vpc *models.AWSVPC, +) error { + // Get AMI ID for the region + amiID, err := p.getLatestAMI(ctx, ec2Client) + if err != nil { + return fmt.Errorf("failed to get latest AMI: %w", err) + } + + // Create instance + runResult, err := ec2Client.RunInstances(ctx, &ec2.RunInstancesInput{ + ImageId: aws.String(amiID), + InstanceType: ec2_types.InstanceTypeT2Micro, + MinCount: aws.Int32(1), + MaxCount: aws.Int32(1), + NetworkInterfaces: []ec2_types.InstanceNetworkInterfaceSpecification{ + { + DeviceIndex: aws.Int32(0), + SubnetId: aws.String(vpc.SubnetID), + Groups: []string{vpc.SecurityGroupID}, + AssociatePublicIpAddress: aws.Bool(true), + }, + }, + TagSpecifications: []ec2_types.TagSpecification{ + { + ResourceType: ec2_types.ResourceTypeInstance, + Tags: []ec2_types.Tag{ + { + Key: aws.String("Name"), + Value: aws.String(machine.GetName()), + }, + }, + }, + }, + }) + if err != nil { + return fmt.Errorf("failed to run instance: %w", err) + } + + // Wait for instance to be running + waiter := ec2.NewInstanceRunningWaiter(ec2Client) + if err := waiter.Wait(ctx, &ec2.DescribeInstancesInput{ + InstanceIds: []string{*runResult.Instances[0].InstanceId}, + }, 5*time.Minute); err != nil { + return fmt.Errorf("failed waiting for instance to be running: %w", err) + } + + // Get instance details + describeResult, err := ec2Client.DescribeInstances(ctx, &ec2.DescribeInstancesInput{ + InstanceIds: []string{*runResult.Instances[0].InstanceId}, + }) + if err != nil { + return fmt.Errorf("failed to describe instance: %w", err) + } + + instance := describeResult.Reservations[0].Instances[0] + machine.SetPublicIP(*instance.PublicIpAddress) + machine.SetPrivateIP(*instance.PrivateIpAddress) + + return nil +} + +func (p *AWSProvider) getLatestAMI( + ctx context.Context, + ec2Client aws_interface.EC2Clienter, +) (string, error) { + result, err := ec2Client.DescribeImages(ctx, &ec2.DescribeImagesInput{ + Filters: []ec2_types.Filter{ + { + Name: aws.String("name"), + Values: []string{"amzn2-ami-hvm-*-x86_64-gp2"}, + }, + { + Name: aws.String("state"), + Values: []string{"available"}, + }, + }, + Owners: []string{"amazon"}, + }) + if err != nil { + return "", fmt.Errorf("failed to describe images: %w", err) + } + + // Find the latest AMI + var latestImage *ec2_types.Image + for i := range result.Images { + if latestImage == nil || *result.Images[i].CreationDate > *latestImage.CreationDate { + latestImage = &result.Images[i] + } + } + + if latestImage == nil { + return "", fmt.Errorf("no AMI found") + } + + return *latestImage.ImageId, nil +} diff --git a/pkg/providers/aws/cdk_bootstrapper.go b/pkg/providers/aws/cdk_bootstrapper.go deleted file mode 100644 index 1a14acaa..00000000 --- a/pkg/providers/aws/cdk_bootstrapper.go +++ /dev/null @@ -1,144 +0,0 @@ -package awsprovider - -import ( - "context" - "fmt" - - "github.com/aws/aws-cdk-go/awscdk/v2" - "github.com/aws/aws-cdk-go/awscdk/v2/awsiam" - "github.com/aws/aws-cdk-go/awscdk/v2/awskms" - "github.com/aws/aws-cdk-go/awscdk/v2/awss3" - "github.com/aws/aws-cdk-go/awscdk/v2/awsssm" - "github.com/aws/aws-sdk-go-v2/config" - "github.com/aws/aws-sdk-go-v2/service/ssm" - "github.com/aws/constructs-go/constructs/v10" - "github.com/aws/jsii-runtime-go" -) - -// BootstrapEnvironment represents the environment to bootstrap -type BootstrapEnvironment struct { - region string - accountID string - qualifier string -} - -// BootstrapStack defines the bootstrap stack -type BootstrapStack struct { - awscdk.Stack - qualifier string -} - -func NewBootstrapStack( - scope constructs.Construct, - id string, - qualifier string, - props *awscdk.StackProps, -) *BootstrapStack { - stack := &BootstrapStack{qualifier: qualifier} - stackID := fmt.Sprintf("%s-%s", id, qualifier) - awscdk.NewStack_Override(stack, scope, &stackID, props) - - // Create bucket with qualified name - bucketName := fmt.Sprintf("cdk-%s-assets-%s-%s", - qualifier, - *props.Env.Account, - *props.Env.Region, - ) - - // Create KMS key - key := awskms.NewKey(stack, jsii.String("FileAssetsBucketEncryptionKey"), &awskms.KeyProps{ - Alias: jsii.String(fmt.Sprintf("alias/cdk-%s-key", qualifier)), - EnableKeyRotation: jsii.Bool(true), - RemovalPolicy: awscdk.RemovalPolicy_RETAIN, - }) - - // Create S3 bucket with encryption - bucket := awss3.NewBucket(stack, jsii.String("StagingBucket"), &awss3.BucketProps{ - BucketName: jsii.String(bucketName), - Encryption: awss3.BucketEncryption_KMS, - EncryptionKey: key, - BlockPublicAccess: awss3.BlockPublicAccess_BLOCK_ALL(), - Versioned: jsii.Bool(true), - RemovalPolicy: awscdk.RemovalPolicy_RETAIN, - }) - - // Create qualified SSM parameters - awsssm.NewStringParameter( - stack, - jsii.String("StagingBucketParameter"), - &awsssm.StringParameterProps{ - ParameterName: jsii.String(fmt.Sprintf("/cdk-bootstrap/%s/bucket-name", qualifier)), - StringValue: bucket.BucketName(), - }, - ) - - awsssm.NewStringParameter(stack, jsii.String("BootstrapVersion"), &awsssm.StringParameterProps{ - ParameterName: jsii.String(fmt.Sprintf("/cdk-bootstrap/%s/version", qualifier)), - StringValue: jsii.String("14"), - }) - - // Create bucket policy - bucket.AddToResourcePolicy(awsiam.NewPolicyStatement(&awsiam.PolicyStatementProps{ - Effect: awsiam.Effect_ALLOW, - Actions: &[]*string{ - jsii.String("s3:*"), - }, - Resources: &[]*string{ - bucket.BucketArn(), - jsii.String(*bucket.BucketArn() + "/*"), - }, - Principals: &[]awsiam.IPrincipal{ - awsiam.NewAccountPrincipal(jsii.String(*props.Env.Account)), - }, - })) - - return stack -} - -// isBootstrapped checks if the environment is already bootstrapped -func isBootstrapped(env BootstrapEnvironment) (bool, error) { - cfg, err := config.LoadDefaultConfig(context.TODO(), - config.WithRegion(env.region), - ) - if err != nil { - return false, fmt.Errorf("unable to load SDK config: %w", err) - } - - ssmClient := ssm.NewFromConfig(cfg) - - // Use qualified parameter name - paramName := fmt.Sprintf("/cdk-bootstrap/%s/version", env.qualifier) - _, err = ssmClient.GetParameter(context.TODO(), &ssm.GetParameterInput{ - Name: ¶mName, - }) - - if err != nil { - return false, nil - } - - return true, nil -} - -// EnsureBootstrapped ensures the environment is bootstrapped -func EnsureBootstrapped(env BootstrapEnvironment) error { - bootstrapped, err := isBootstrapped(env) - if err != nil { - return fmt.Errorf("failed to check bootstrap status: %w", err) - } - - if !bootstrapped { - app := awscdk.NewApp(nil) - - stackProps := &awscdk.StackProps{ - Env: &awscdk.Environment{ - Account: jsii.String(env.accountID), - Region: jsii.String(env.region), - }, - } - - NewBootstrapStack(app, "CDKToolkit", env.qualifier, stackProps) - app.Synth(nil) - } - - return nil -} diff --git a/pkg/providers/aws/deploy_spot.go b/pkg/providers/aws/deploy_spot.go index 1381204a..13b0c8de 100644 --- a/pkg/providers/aws/deploy_spot.go +++ b/pkg/providers/aws/deploy_spot.go @@ -1,4 +1,4 @@ -package awsprovider +package aws import ( "sync" diff --git a/pkg/providers/aws/destroy.go b/pkg/providers/aws/destroy.go index 328916b6..25fa49f9 100644 --- a/pkg/providers/aws/destroy.go +++ b/pkg/providers/aws/destroy.go @@ -1,23 +1,194 @@ -package awsprovider +package aws import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/service/ec2" + ec2_types "github.com/aws/aws-sdk-go-v2/service/ec2/types" "github.com/bacalhau-project/andaime/pkg/logger" + aws_interface "github.com/bacalhau-project/andaime/pkg/models/interfaces/aws" + "github.com/spf13/viper" ) -// DestroyResources deletes the specified AWS VPC and associated resources -func (p *AWSProvider) DestroyResources(ctx context.Context, vpcID string) error { +// Destroy updated to clean up resources across all regions +func (p *AWSProvider) Destroy(ctx context.Context, deploymentID string) error { l := logger.Get() - l.Infof("Starting destruction of AWS deployment (VPC ID: %s)", vpcID) + l.Info("Starting destruction of AWS resources across all regions") - // Call the Destroy method we implemented - err := p.Destroy(ctx) + deployments := viper.GetStringMap("deployments.aws") + if deployments == nil { + return nil + } + + for uniqueID, deploymentDetails := range deployments { + details, ok := deploymentDetails.(map[string]interface{}) + if !ok { + continue + } + + // Handle both legacy and new configurations + if regions, ok := details["regions"].(map[string]interface{}); ok { + // New configuration with regions + for region, regionDetails := range regions { + rd, ok := regionDetails.(map[string]interface{}) + if !ok { + continue + } + + vpcID, ok := rd["vpc_id"].(string) + if !ok { + continue + } + + if err := p.cleanupRegionalResources(ctx, region, vpcID); err != nil { + l.Warnf("Failed to clean up resources in region %s: %v", region, err) + } + } + } else { + // Legacy configuration with single region + region, ok := details["region"].(string) + if !ok { + continue + } + + vpcID, _ := details["vpc_id"].(string) + if err := p.cleanupRegionalResources(ctx, region, vpcID); err != nil { + l.Warnf("Failed to clean up resources in region %s: %v", region, err) + } + } + + // Remove deployment from config + delete(deployments, uniqueID) + } + + // Update config + viper.Set("deployments.aws", deployments) + if err := viper.WriteConfig(); err != nil { + return fmt.Errorf("failed to update config: %v", err) + } + + return nil +} + +func (p *AWSProvider) cleanupRegionalResources(ctx context.Context, region, vpcID string) error { + if vpcID == "" { + return nil + } + + client, err := p.getOrCreateEC2Client(ctx, region) + if err != nil { + return fmt.Errorf("failed to create client for region %s: %w", region, err) + } + + return p.destroyRegionalResources(ctx, region, vpcID, client) +} + +// destroyRegionalResources cleans up all resources in a specific region +func (p *AWSProvider) destroyRegionalResources( + ctx context.Context, + region string, + vpcID string, + client aws_interface.EC2Clienter, +) error { + l := logger.Get() + l.Infof("Destroying resources in region %s", region) + + // First, terminate all instances in the VPC + instances, err := client.DescribeInstances(ctx, &ec2.DescribeInstancesInput{ + Filters: []ec2_types.Filter{ + { + Name: aws.String("vpc-id"), + Values: []string{vpcID}, + }, + }, + }) + if err != nil { + return fmt.Errorf("failed to describe instances: %w", err) + } + + // Terminate instances + for _, reservation := range instances.Reservations { + for _, instance := range reservation.Instances { + if instance.State.Name != ec2_types.InstanceStateNameTerminated { + _, err := client.TerminateInstances(ctx, &ec2.TerminateInstancesInput{ + InstanceIds: []string{*instance.InstanceId}, + }) + if err != nil { + l.Warnf("Failed to terminate instance %s: %v", *instance.InstanceId, err) + } + } + } + } + + // Get VPC details + vpcDetails, err := client.DescribeVpcs(ctx, &ec2.DescribeVpcsInput{ + VpcIds: []string{vpcID}, + }) + if err != nil { + return fmt.Errorf("failed to describe VPC: %w", err) + } + + if len(vpcDetails.Vpcs) == 0 { + return fmt.Errorf("VPC %s not found", vpcID) + } + + // Clean up in reverse order of creation + // 1. Delete subnets + subnets, err := client.DescribeSubnets(ctx, &ec2.DescribeSubnetsInput{ + Filters: []ec2_types.Filter{ + { + Name: aws.String("vpc-id"), + Values: []string{vpcID}, + }, + }, + }) + if err != nil { + l.Warnf("Failed to describe subnets: %v", err) + } else { + for _, subnet := range subnets.Subnets { + _, err := client.DeleteSubnet(ctx, &ec2.DeleteSubnetInput{ + SubnetId: subnet.SubnetId, + }) + if err != nil { + l.Warnf("Failed to delete subnet %s: %v", *subnet.SubnetId, err) + } + } + } + + // 2. Delete security groups + sgs, err := client.DescribeSecurityGroups(ctx, &ec2.DescribeSecurityGroupsInput{ + Filters: []ec2_types.Filter{ + { + Name: aws.String("vpc-id"), + Values: []string{vpcID}, + }, + }, + }) + if err != nil { + l.Warnf("Failed to describe security groups: %v", err) + } else { + for _, sg := range sgs.SecurityGroups { + if aws.ToString(sg.GroupName) != DefaultName { + _, err := client.DeleteSecurityGroup(ctx, &ec2.DeleteSecurityGroupInput{ + GroupId: sg.GroupId, + }) + if err != nil { + l.Warnf("Failed to delete security group %s: %v", *sg.GroupId, err) + } + } + } + } + + // 3. Delete VPC + _, err = client.DeleteVpc(ctx, &ec2.DeleteVpcInput{ + VpcId: aws.String(vpcID), + }) if err != nil { - return fmt.Errorf("failed to destroy AWS resources: %w", err) + return fmt.Errorf("failed to delete VPC: %w", err) } - l.Info("AWS resources successfully destroyed") + l.Infof("Successfully destroyed resources in region %s", region) return nil } diff --git a/pkg/providers/aws/destroy_test.go b/pkg/providers/aws/destroy_test.go new file mode 100644 index 00000000..69fc2a2d --- /dev/null +++ b/pkg/providers/aws/destroy_test.go @@ -0,0 +1,50 @@ +package aws + +import ( + "context" + "os" + "path/filepath" + "testing" + + "github.com/spf13/viper" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestDestroyWithEmptyVPCID(t *testing.T) { + // Create a temporary config file + tempDir := t.TempDir() + configFile := filepath.Join(tempDir, "config.yaml") + + // Create test configuration + config := []byte(` +deployments: + aws: + test-deployment: + region: "us-west-2" + vpc_id: "" + instance_type: "t2.micro" +`) + + err := os.WriteFile(configFile, config, 0644) + require.NoError(t, err) + + // Initialize viper with the test config + viper.Reset() + viper.SetConfigFile(configFile) + err = viper.ReadInConfig() + require.NoError(t, err) + + // Create AWS provider + provider := &AWSProvider{} + + // Call destroy + err = provider.Destroy(context.Background(), "") + require.NoError(t, err) + + // Verify the deployment is removed from config + viper.ReadInConfig() // Reload config + deployments := viper.GetStringMap("deployments.aws") + _, exists := deployments["test-deployment"] + assert.False(t, exists, "test-deployment should be removed from config") +} diff --git a/pkg/providers/aws/diagnostics.go b/pkg/providers/aws/diagnostics.go index 2459a595..7dcb56c7 100644 --- a/pkg/providers/aws/diagnostics.go +++ b/pkg/providers/aws/diagnostics.go @@ -1,4 +1,4 @@ -package awsprovider +package aws import ( "context" @@ -6,7 +6,6 @@ import ( "strings" "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/aws-sdk-go-v2/service/cloudformation" "github.com/aws/aws-sdk-go-v2/service/s3" "github.com/aws/aws-sdk-go-v2/service/ssm" "github.com/aws/aws-sdk-go-v2/service/sts" @@ -49,7 +48,6 @@ func (p *AWSProvider) PrintDiagnostics(ctx context.Context) error { // Print Provider Configuration l.Info("\nProvider Configuration:") l.Infof(" Account ID: %s", p.AccountID) - l.Infof(" Region: %s", p.Region) // Print AWS Credentials l.Info("\nAWS Credentials:") @@ -90,13 +88,6 @@ func (p *AWSProvider) PrintDiagnostics(ctx context.Context) error { // Check if we can access necessary services l.Info("\nService Access Check:") - // Check CloudFormation - _, err = p.cloudFormationClient.ListStacks(ctx, &cloudformation.ListStacksInput{}) - l.Infof(" CloudFormation Access: %v", err == nil) - if err != nil { - l.Errorf(" Error: %v", err) - } - // Check S3 s3Client := s3.NewFromConfig(*p.Config) _, err = s3Client.ListBuckets(ctx, &s3.ListBucketsInput{}) @@ -128,8 +119,10 @@ func (p *AWSProvider) PrintDiagnostics(ctx context.Context) error { // Helper function to mask sensitive strings func maskString(s string) string { - if len(s) <= 4 { + visibleLength := 4 + + if len(s) <= visibleLength { //nolint:mnd return strings.Repeat("*", len(s)) } - return s[:4] + strings.Repeat("*", len(s)-4) + return s[:visibleLength] + strings.Repeat("*", len(s)-visibleLength) } diff --git a/pkg/providers/aws/ec2.go b/pkg/providers/aws/ec2.go deleted file mode 100644 index 8350460f..00000000 --- a/pkg/providers/aws/ec2.go +++ /dev/null @@ -1,140 +0,0 @@ -package awsprovider - -import ( - "context" - - "github.com/aws/aws-sdk-go-v2/config" - "github.com/aws/aws-sdk-go-v2/service/ec2" - awsinterfaces "github.com/bacalhau-project/andaime/pkg/models/interfaces/aws" -) - -type LiveEC2Client struct { - client *ec2.Client -} - -// NewEC2Client creates a new EC2 client -func NewEC2Client(ctx context.Context) (awsinterfaces.EC2Clienter, error) { - cfg, err := config.LoadDefaultConfig(ctx) - if err != nil { - return nil, err - } - return &LiveEC2Client{client: ec2.NewFromConfig(cfg)}, nil -} - -// CreateEC2Instance creates a new EC2 instance -func (c *LiveEC2Client) CreateEC2Instance( - ctx context.Context, - input *ec2.RunInstancesInput, - options ...func(*ec2.Options), -) (*ec2.RunInstancesOutput, error) { - return c.client.RunInstances(ctx, input, options...) -} - -func (c *LiveEC2Client) RunInstances( - ctx context.Context, - input *ec2.RunInstancesInput, - options ...func(*ec2.Options), -) (*ec2.RunInstancesOutput, error) { - return c.client.RunInstances(ctx, input, options...) -} - -// DescribeEC2Instances describes EC2 instances -func (c *LiveEC2Client) DescribeInstances( - ctx context.Context, - input *ec2.DescribeInstancesInput, - options ...func(*ec2.Options), -) (*ec2.DescribeInstancesOutput, error) { - return c.client.DescribeInstances(ctx, input, options...) -} - -// DescribeImages describes images -func (c *LiveEC2Client) DescribeImages( - ctx context.Context, - input *ec2.DescribeImagesInput, - options ...func(*ec2.Options), -) (*ec2.DescribeImagesOutput, error) { - return c.client.DescribeImages(ctx, input, options...) -} - -// TerminateInstances terminates EC2 instances -func (c *LiveEC2Client) TerminateInstances( - ctx context.Context, - input *ec2.TerminateInstancesInput, - options ...func(*ec2.Options), -) (*ec2.TerminateInstancesOutput, error) { - return c.client.TerminateInstances(ctx, input, options...) -} - -// CreateVPC creates a new VPC -func (c *LiveEC2Client) CreateVPC( - ctx context.Context, - input *ec2.CreateVpcInput, - options ...func(*ec2.Options), -) (*ec2.CreateVpcOutput, error) { - return c.client.CreateVpc(ctx, input, options...) -} - -// DescribeVPCs describes VPCs -func (c *LiveEC2Client) DescribeVPCs( - ctx context.Context, - input *ec2.DescribeVpcsInput, - options ...func(*ec2.Options), -) (*ec2.DescribeVpcsOutput, error) { - return c.client.DescribeVpcs(ctx, input, options...) -} - -// CreateSubnet creates a new subnet in a VPC -func (c *LiveEC2Client) CreateSubnet( - ctx context.Context, - input *ec2.CreateSubnetInput, - options ...func(*ec2.Options), -) (*ec2.CreateSubnetOutput, error) { - return c.client.CreateSubnet(ctx, input, options...) -} - -// CreateInternetGateway creates a new Internet Gateway -func (c *LiveEC2Client) CreateInternetGateway( - ctx context.Context, - input *ec2.CreateInternetGatewayInput, - options ...func(*ec2.Options), -) (*ec2.CreateInternetGatewayOutput, error) { - return c.client.CreateInternetGateway(ctx, input, options...) -} - -// AttachInternetGateway attaches an Internet Gateway to a VPC -func (c *LiveEC2Client) AttachInternetGateway( - ctx context.Context, - input *ec2.AttachInternetGatewayInput, - options ...func(*ec2.Options), -) (*ec2.AttachInternetGatewayOutput, error) { - return c.client.AttachInternetGateway(ctx, input, options...) -} - -// CreateRouteTable creates a new route table -func (c *LiveEC2Client) CreateRouteTable( - ctx context.Context, - input *ec2.CreateRouteTableInput, - options ...func(*ec2.Options), -) (*ec2.CreateRouteTableOutput, error) { - return c.client.CreateRouteTable(ctx, input, options...) -} - -// CreateRoute creates a new route in a route table -func (c *LiveEC2Client) CreateRoute( - ctx context.Context, - input *ec2.CreateRouteInput, - options ...func(*ec2.Options), -) (*ec2.CreateRouteOutput, error) { - return c.client.CreateRoute(ctx, input, options...) -} - -// AssociateRouteTable associates a subnet with a route table -func (c *LiveEC2Client) AssociateRouteTable( - ctx context.Context, - input *ec2.AssociateRouteTableInput, - options ...func(*ec2.Options), -) (*ec2.AssociateRouteTableOutput, error) { - return c.client.AssociateRouteTable(ctx, input, options...) -} - -var _ awsinterfaces.EC2Clienter = &LiveEC2Client{} diff --git a/pkg/providers/aws/ec2_test.go b/pkg/providers/aws/ec2_test.go index 10af60e5..c85cb293 100644 --- a/pkg/providers/aws/ec2_test.go +++ b/pkg/providers/aws/ec2_test.go @@ -1 +1 @@ -package awsprovider_test +package aws_test diff --git a/pkg/providers/aws/integration_test.go b/pkg/providers/aws/integration_test.go new file mode 100644 index 00000000..418972d8 --- /dev/null +++ b/pkg/providers/aws/integration_test.go @@ -0,0 +1,97 @@ +//go:build integration +// +build integration + +package awsprovider + +import ( + "context" + "testing" + "time" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/service/ec2/types" + "github.com/aws/aws-sdk-go/service/ec2" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestIntegrationCreateAndDestroyInfrastructure(t *testing.T) { + provider, err := NewAWSProvider(FAKE_ACCOUNT_ID, FAKE_REGION) + require.NoError(t, err) + + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute) + defer cancel() + + // Create infrastructure + err = provider.CreateInfrastructure(ctx) + assert.NoError(t, err) + assert.NotEmpty(t, provider.VPCID) + + // Verify VPC exists and is available + vpcExists, err := verifyVPCExists(ctx, provider) + assert.NoError(t, err) + assert.True(t, vpcExists) + + // Verify network connectivity + networkConnectivity, err := verifyNetworkConnectivity(ctx, provider) + assert.NoError(t, err) + assert.True(t, networkConnectivity) + + // Test cleanup + err = provider.Destroy(ctx) + assert.NoError(t, err) + + // Verify resources are cleaned up + vpcExists, err = verifyVPCExists(ctx, provider) + assert.NoError(t, err) + assert.False(t, vpcExists) +} + +func verifyVPCExists(ctx context.Context, provider *AWSProvider) (bool, error) { + if provider.EC2Client == nil { + return false, nil + } + + input := &ec2.DescribeVpcsInput{ + VpcIds: []string{provider.VPCID}, + } + + result, err := provider.EC2Client.DescribeVpcs(ctx, input) + if err != nil { + return false, err + } + + return len(result.Vpcs) > 0, nil +} + +func verifyNetworkConnectivity(ctx context.Context, provider *AWSProvider) (bool, error) { + if provider.EC2Client == nil { + return false, nil + } + + // Verify subnets can route to internet gateway + input := &ec2.DescribeRouteTablesInput{ + Filters: []types.Filter{ + { + Name: aws.String("vpc-id"), + Value: []string{provider.VPCID}, + }, + }, + } + + result, err := provider.EC2Client.DescribeRouteTables(ctx, input) + if err != nil { + return false, err + } + + // Check if route table has internet gateway route + for _, rt := range result.RouteTables { + for _, route := range rt.Routes { + if route.GatewayId != nil && *route.GatewayId != "" { + return true, nil + } + } + } + + return false, nil +} diff --git a/pkg/providers/aws/interfaces/ec2_clienter.go b/pkg/providers/aws/interfaces/ec2_clienter.go new file mode 100644 index 00000000..05b01e41 --- /dev/null +++ b/pkg/providers/aws/interfaces/ec2_clienter.go @@ -0,0 +1,46 @@ +package interfaces + +import ( + "context" + + "github.com/aws/aws-sdk-go-v2/service/ec2" +) + +// EC2Clienter defines the interface for EC2 client operations +type EC2Clienter interface { + CreateVpc( + ctx context.Context, + params *ec2.CreateVpcInput, + optFns ...func(*ec2.Options), + ) (*ec2.CreateVpcOutput, error) + CreateSecurityGroup( + ctx context.Context, + params *ec2.CreateSecurityGroupInput, + optFns ...func(*ec2.Options), + ) (*ec2.CreateSecurityGroupOutput, error) + AuthorizeSecurityGroupIngress( + ctx context.Context, + params *ec2.AuthorizeSecurityGroupIngressInput, + optFns ...func(*ec2.Options), + ) (*ec2.AuthorizeSecurityGroupIngressOutput, error) + RunInstances( + ctx context.Context, + params *ec2.RunInstancesInput, + optFns ...func(*ec2.Options), + ) (*ec2.RunInstancesOutput, error) + DescribeInstances( + ctx context.Context, + params *ec2.DescribeInstancesInput, + optFns ...func(*ec2.Options), + ) (*ec2.DescribeInstancesOutput, error) + DescribeImages( + ctx context.Context, + params *ec2.DescribeImagesInput, + optFns ...func(*ec2.Options), + ) (*ec2.DescribeImagesOutput, error) + ModifyVpcAttribute( + ctx context.Context, + params *ec2.ModifyVpcAttributeInput, + optFns ...func(*ec2.Options), + ) (*ec2.ModifyVpcAttributeOutput, error) +} diff --git a/pkg/providers/aws/performance_test.go b/pkg/providers/aws/performance_test.go new file mode 100644 index 00000000..8592a4be --- /dev/null +++ b/pkg/providers/aws/performance_test.go @@ -0,0 +1,70 @@ +//go:build integration +// +build integration + +package awsprovider + +import ( + "context" + "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestPerformanceCreateInfrastructure(t *testing.T) { + provider, err := NewAWSProvider(FAKE_ACCOUNT_ID, FAKE_REGION) + require.NoError(t, err) + + ctx, cancel := context.WithTimeout(context.Background(), 15*time.Minute) + defer cancel() + + // Measure VPC creation time + start := time.Now() + err = provider.CreateVpc(ctx) + duration := time.Since(start) + assert.NoError(t, err) + + // VPC creation should typically complete within 2 minutes + assert.Less(t, duration, 2*time.Minute) + + // Measure complete infrastructure creation time + start = time.Now() + err = provider.CreateInfrastructure(ctx) + duration = time.Since(start) + assert.NoError(t, err) + + // Full infrastructure creation should complete within 5 minutes + assert.Less(t, duration, 5*time.Minute) + + // Cleanup + err = provider.Destroy(ctx) + assert.NoError(t, err) +} + +func TestPerformanceResourcePolling(t *testing.T) { + provider, err := NewAWSProvider(FAKE_ACCOUNT_ID, FAKE_REGION) + require.NoError(t, err) + + ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute) + defer cancel() + + // Create infrastructure first + err = provider.CreateInfrastructure(ctx) + require.NoError(t, err) + + // Measure polling performance + start := time.Now() + err = provider.StartResourcePolling(ctx) + assert.NoError(t, err) + + // Let polling run for a minute + time.Sleep(1 * time.Minute) + + // Check memory usage and CPU stats + // TODO: Add metrics collection + + // Cleanup + err = provider.Destroy(ctx) + assert.NoError(t, err) +} diff --git a/pkg/providers/aws/provider.go b/pkg/providers/aws/provider.go index 7d91350b..d24d14ec 100644 --- a/pkg/providers/aws/provider.go +++ b/pkg/providers/aws/provider.go @@ -1,28 +1,20 @@ -package awsprovider +package aws import ( "context" - "encoding/json" "fmt" + "math/rand" "os" + "sort" "strings" + "sync" "time" - "github.com/aws/aws-cdk-go/awscdk/v2" - "github.com/aws/aws-cdk-go/awscdk/v2/awsec2" - "github.com/aws/aws-cdk-go/awscdk/v2/awsiam" - "github.com/aws/aws-cdk-go/awscdk/v2/awskms" - "github.com/aws/aws-cdk-go/awscdk/v2/awss3" - "github.com/aws/aws-cdk-go/awscdk/v2/awsssm" "github.com/aws/aws-sdk-go-v2/aws" awsconfig "github.com/aws/aws-sdk-go-v2/config" - "github.com/aws/aws-sdk-go-v2/service/cloudformation" - "github.com/aws/aws-sdk-go-v2/service/cloudformation/types" "github.com/aws/aws-sdk-go-v2/service/ec2" ec2_types "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/aws-sdk-go-v2/service/ssm" - "github.com/aws/constructs-go/constructs/v10" - "github.com/aws/jsii-runtime-go" + "github.com/aws/aws-sdk-go-v2/service/sts" internal_aws "github.com/bacalhau-project/andaime/internal/clouds/aws" "github.com/bacalhau-project/andaime/pkg/display" "github.com/bacalhau-project/andaime/pkg/logger" @@ -30,69 +22,301 @@ import ( aws_interface "github.com/bacalhau-project/andaime/pkg/models/interfaces/aws" common_interface "github.com/bacalhau-project/andaime/pkg/models/interfaces/common" "github.com/bacalhau-project/andaime/pkg/providers/common" + "github.com/cenkalti/backoff/v4" "github.com/spf13/viper" + "golang.org/x/sync/errgroup" ) const ( - ResourcePollingInterval = 10 * time.Second - UpdateQueueSize = 100 + ResourcePollingInterval = 30 * time.Second + UpdateQueueSize = 1000 // Increased from 100 to prevent dropping updates + UpdatePollingInterval = 100 * time.Millisecond DefaultStackTimeout = 30 * time.Minute TestStackTimeout = 30 * time.Second + UbuntuAMIOwner = "099720109477" // Canonical's AWS account ID ) -type AWSProvider struct { - AccountID string - Config *aws.Config - Region string - ClusterDeployer common_interface.ClusterDeployerer - UpdateQueue chan display.UpdateAction - App awscdk.App - Stack awscdk.Stack - VPC awsec2.IVpc - cloudFormationClient aws_interface.CloudFormationAPIer - EC2Client aws_interface.EC2Clienter +type VPCState struct { + mu sync.RWMutex + vpc *models.AWSVPC + status string + lastUpdated time.Time } -var NewCloudFormationClientFunc = func(cfg aws.Config) aws_interface.CloudFormationAPIer { - return cloudformation.NewFromConfig(cfg) +// RegionalVPCManager handles VPC operations across regions +type RegionalVPCManager struct { + states map[string]*VPCState // region -> state + mu sync.RWMutex + viper *viper.Viper + deployment *models.Deployment + ec2Client aws_interface.EC2Clienter } -func NewAWSProvider(accountID, region string) (*AWSProvider, error) { - if accountID == "" { - return nil, fmt.Errorf("account ID is required") +// NewRegionalVPCManager creates a new VPC manager +func NewRegionalVPCManager( + deployment *models.Deployment, + ec2Client aws_interface.EC2Clienter, +) *RegionalVPCManager { + return &RegionalVPCManager{ + states: make(map[string]*VPCState), + deployment: deployment, + ec2Client: ec2Client, } +} - if region == "" { - return nil, fmt.Errorf("region is required") +type DeploymentInfo struct { + ID string + Region string + VPCCount int + InstanceCount int + Tags map[string]string +} + +// String returns a formatted string representation of the deployment info +func (d DeploymentInfo) String() string { + var tags []string + for k, v := range d.Tags { + tags = append(tags, fmt.Sprintf("%s=%s", k, v)) } + sort.Strings(tags) // Sort tags for consistent output + tagStr := "" + if len(tags) > 0 { + tagStr = fmt.Sprintf(" [%s]", strings.Join(tags, ", ")) + } + return fmt.Sprintf("Deployment %s (Region: %s, VPCs: %d, Instances: %d)%s", + d.ID, d.Region, d.VPCCount, d.InstanceCount, tagStr) +} - awsConfig, err := awsconfig.LoadDefaultConfig( - context.Background(), - awsconfig.WithRegion(region), - ) +// AWSProvider updated structure +type AWSProvider struct { + AccountID string + Config *aws.Config + ClusterDeployer common_interface.ClusterDeployerer + UpdateQueue chan display.UpdateAction + EC2Client aws_interface.EC2Clienter + STSClient *sts.Client + ConfigMutex sync.RWMutex + vpcManager *RegionalVPCManager +} + +var NewAWSProviderFunc = NewAWSProvider + +// NewAWSProvider creates a new AWS provider instance +func NewAWSProvider(accountID string) (*AWSProvider, error) { + if accountID == "" { + return nil, fmt.Errorf("account ID is required") + } + + // Load default AWS config without region + awsConfig, err := awsconfig.LoadDefaultConfig(context.Background()) if err != nil { return nil, fmt.Errorf("failed to load AWS configuration: %w", err) } + // Initialize a default EC2 client + ec2Client := ec2.NewFromConfig(awsConfig) + ec2Clienter := &LiveEC2Client{client: ec2Client} + provider := &AWSProvider{ - AccountID: accountID, - Region: region, - Config: &awsConfig, - Stack: nil, - ClusterDeployer: common.NewClusterDeployer(models.DeploymentTypeAWS), - UpdateQueue: make(chan display.UpdateAction, UpdateQueueSize), - App: awscdk.NewApp(nil), - cloudFormationClient: NewCloudFormationClientFunc(awsConfig), + AccountID: accountID, + Config: &awsConfig, + ClusterDeployer: common.NewClusterDeployer(models.DeploymentTypeAWS), + UpdateQueue: make(chan display.UpdateAction, UpdateQueueSize), + STSClient: sts.NewFromConfig(awsConfig), + EC2Client: ec2Clienter, } return provider, nil } -func (p *AWSProvider) PrepareDeployment(ctx context.Context) (*models.Deployment, error) { - return common.PrepareDeployment(ctx, models.DeploymentTypeAWS) +// getOrCreateEC2Client gets or creates an EC2 client for a specific region +func (p *AWSProvider) getOrCreateEC2Client( + ctx context.Context, + region string, +) (aws_interface.EC2Clienter, error) { + // If no global model, create a temporary EC2 client + if display.GetGlobalModelFunc() == nil { + cfg, err := awsconfig.LoadDefaultConfig(ctx, awsconfig.WithRegion(region)) + if err != nil { + return nil, fmt.Errorf("failed to load AWS config for region %s: %w", region, err) + } + return &LiveEC2Client{client: ec2.NewFromConfig(cfg)}, nil + } + + m := display.GetGlobalModelFunc() + if m.Deployment == nil { + m.Deployment = &models.Deployment{} + } + + if m.Deployment.AWS == nil { + m.Deployment.AWS = &models.AWSDeployment{ + RegionalResources: &models.RegionalResources{ + Clients: make(map[string]aws_interface.EC2Clienter), + }, + } + } + + if m.Deployment.AWS.RegionalResources.Clients == nil { + m.Deployment.AWS.RegionalResources.Clients = make(map[string]aws_interface.EC2Clienter) + } + + if m.Deployment.AWS.RegionalResources.Clients[region] != nil { + return m.Deployment.AWS.RegionalResources.Clients[region], nil + } + + cfg, err := awsconfig.LoadDefaultConfig(ctx, awsconfig.WithRegion(region)) + if err != nil { + return nil, fmt.Errorf("failed to load AWS config for region %s: %w", region, err) + } + + var ec2Client aws_interface.EC2Clienter + if p.GetEC2Client() != nil { + // If we already have a global EC2 client, use it + ec2Client = p.GetEC2Client() + } else { + ec2Client = &LiveEC2Client{client: ec2.NewFromConfig(cfg)} + } + + // Store the client in the regional resources + m.Deployment.AWS.RegionalResources.Clients[region] = ec2Client + return ec2Client, nil +} + +func (p *AWSProvider) PrepareDeployment(ctx context.Context) error { + m := display.GetGlobalModelFunc() + if m == nil || m.Deployment == nil { + return fmt.Errorf("global model or deployment is nil") + } + + // Get deployment and ensure it has AWS config + deployment := m.Deployment + + if deployment.AWS == nil { + deployment.AWS = &models.AWSDeployment{ + RegionalResources: &models.RegionalResources{ + VPCs: make(map[string]*models.AWSVPC), + Clients: make(map[string]aws_interface.EC2Clienter), + }, + } + } + + // Get AWS account ID if not already set + if deployment.AWS.AccountID == "" { + identity, err := p.STSClient.GetCallerIdentity(ctx, &sts.GetCallerIdentityInput{}) + if err != nil { + return fmt.Errorf("failed to get AWS account ID: %w", err) + } + deployment.AWS.AccountID = *identity.Account + } + + // Initialize regional resources + regions := make(map[string]struct{}) + for _, machine := range deployment.Machines { + region := machine.GetLocation() + if region == "" { + continue + } + // Convert zone to region if necessary + if len(region) > 0 && region[len(region)-1] >= 'a' && region[len(region)-1] <= 'z' { + region = region[:len(region)-1] + } + regions[region] = struct{}{} + } + + // Create VPC and security group for each region + for region := range regions { + if vpc := deployment.AWS.RegionalResources.GetVPC(region); vpc != nil { + vpc, err := p.createVPCInfrastructure(ctx, region) + if err != nil { + return fmt.Errorf( + "failed to create VPC infrastructure in region %s: %w", + region, + err, + ) + } + deployment.AWS.RegionalResources.SetVPC(region, vpc) + } + } + + return nil +} + +func (p *AWSProvider) createVPCInfrastructure( + ctx context.Context, + region string, +) (*models.AWSVPC, error) { + // Create EC2 client for the region + ec2Client, err := p.getOrCreateEC2Client(ctx, region) + if err != nil { + return nil, fmt.Errorf("failed to create EC2 client for region %s: %w", region, err) + } + + // Create VPC with CIDR block + vpcOut, err := ec2Client.CreateVpc(ctx, &ec2.CreateVpcInput{ + CidrBlock: aws.String("10.0.0.0/16"), + TagSpecifications: []ec2_types.TagSpecification{ + { + ResourceType: ec2_types.ResourceTypeVpc, + Tags: []ec2_types.Tag{ + { + Key: aws.String("Name"), + Value: aws.String("andaime-vpc"), + }, + }, + }, + }, + }) + if err != nil { + return nil, fmt.Errorf("failed to create VPC: %w", err) + } + + // Create security group + sgOut, err := ec2Client.CreateSecurityGroup(ctx, &ec2.CreateSecurityGroupInput{ + GroupName: aws.String("andaime-sg"), + Description: aws.String("Security group for Andaime deployment"), + VpcId: vpcOut.Vpc.VpcId, + TagSpecifications: []ec2_types.TagSpecification{ + { + ResourceType: ec2_types.ResourceTypeSecurityGroup, + Tags: []ec2_types.Tag{ + { + Key: aws.String("Name"), + Value: aws.String("andaime-sg"), + }, + }, + }, + }, + }) + if err != nil { + return nil, fmt.Errorf("failed to create security group: %w", err) + } + + // Allow inbound traffic + _, err = ec2Client.AuthorizeSecurityGroupIngress(ctx, &ec2.AuthorizeSecurityGroupIngressInput{ + GroupId: sgOut.GroupId, + IpPermissions: []ec2_types.IpPermission{ + { + IpProtocol: aws.String("-1"), + FromPort: aws.Int32(-1), + ToPort: aws.Int32(-1), + IpRanges: []ec2_types.IpRange{ + { + CidrIp: aws.String("0.0.0.0/0"), + }, + }, + }, + }, + }) + if err != nil { + return nil, fmt.Errorf("failed to authorize security group ingress: %w", err) + } + + return &models.AWSVPC{ + VPCID: *vpcOut.Vpc.VpcId, + SecurityGroupID: *sgOut.GroupId, + }, nil } -// This updates m.Deployment with machines and returns an error if any func (p *AWSProvider) ProcessMachinesConfig( ctx context.Context, ) (map[string]models.Machiner, map[string]bool, error) { @@ -105,30 +329,52 @@ func (p *AWSProvider) ProcessMachinesConfig( func (p *AWSProvider) StartResourcePolling(ctx context.Context) error { go func() { - ticker := time.NewTicker(ResourcePollingInterval) - defer ticker.Stop() + resourceTicker := time.NewTicker(ResourcePollingInterval) + updateTicker := time.NewTicker(UpdatePollingInterval) + defer resourceTicker.Stop() + defer updateTicker.Stop() for { select { case <-ctx.Done(): return - case <-ticker.C: + case <-resourceTicker.C: if err := p.pollResources(ctx); err != nil { logger.Get().Error(fmt.Sprintf("Failed to poll resources: %v", err)) } + case <-updateTicker.C: + p.processUpdateQueue() } } }() return nil } +func (p *AWSProvider) processUpdateQueue() { + m := display.GetGlobalModelFunc() + if m == nil { + return + } + + // Process up to 100 updates per tick to prevent queue from filling + for i := 0; i < 100; i++ { + select { + case update := <-p.UpdateQueue: + m.QueueUpdate(update) + default: + return // No more updates in queue + } + } +} + func (p *AWSProvider) pollResources(ctx context.Context) error { - if p.Stack == nil { - return fmt.Errorf("stack is nil") + m := display.GetGlobalModelFunc() + if m == nil || m.Deployment == nil { + return fmt.Errorf("display model or deployment is nil") } // Create EC2 client - cfg, err := awsconfig.LoadDefaultConfig(ctx, awsconfig.WithRegion(p.Region)) + cfg, err := awsconfig.LoadDefaultConfig(ctx, awsconfig.WithRegion(p.Config.Region)) if err != nil { return fmt.Errorf("failed to load AWS config: %w", err) } @@ -139,7 +385,7 @@ func (p *AWSProvider) pollResources(ctx context.Context) error { Filters: []ec2_types.Filter{ { Name: aws.String("tag:AndaimeDeployment"), - Values: []string{*p.Stack.StackName()}, + Values: []string{"AndaimeDeployment"}, }, }, } @@ -151,11 +397,49 @@ func (p *AWSProvider) pollResources(ctx context.Context) error { for _, reservation := range result.Reservations { for _, instance := range reservation.Instances { - // Update instance status in the deployment model machineID := getMachineIDFromTags(instance.Tags) if machineID != "" { + machine := m.Deployment.GetMachine(machineID) + if machine == nil { + continue + } + + // Check and update instance state status := mapEC2StateToMachineState(instance.State.Name) p.updateMachineStatus(machineID, status) + + // Check and update network interface state + if len(instance.NetworkInterfaces) > 0 { + networkStatus := models.ResourceStateRunning + if instance.NetworkInterfaces[0].Status != "in-use" { + networkStatus = models.ResourceStatePending + } + m.QueueUpdate(display.UpdateAction{ + MachineName: machine.GetName(), + UpdateData: display.UpdateData{ + UpdateType: display.UpdateTypeResource, + ResourceType: "Network", + ResourceState: networkStatus, + }, + }) + } + + // Check and update volume state + if len(instance.BlockDeviceMappings) > 0 { + volumeStatus := models.ResourceStateRunning + if instance.BlockDeviceMappings[0].Ebs != nil && + instance.BlockDeviceMappings[0].Ebs.Status != "attached" { + volumeStatus = models.ResourceStatePending + } + m.QueueUpdate(display.UpdateAction{ + MachineName: machine.GetName(), + UpdateData: display.UpdateData{ + UpdateType: display.UpdateTypeResource, + ResourceType: "Volume", + ResourceState: volumeStatus, + }, + }) + } } } } @@ -217,437 +501,1004 @@ func (p *AWSProvider) updateMachineStatus(machineID string, status models.Machin } func (p *AWSProvider) BootstrapEnvironment(ctx context.Context) error { + // No bootstrapping needed anymore since we're not using CDK + return nil +} +func (p *AWSProvider) CreateVpc(ctx context.Context, region string) error { l := logger.Get() - l.Info("Ensuring AWS environment is bootstrapped") - - // Create a channel to signal completion - done := make(chan error) - defer close(done) + l.Debugf("Creating VPC in region %s", region) - // First, let's check if any bootstrap assets exist - ssmClient := ssm.NewFromConfig(*p.Config) - paramName := "/cdk-bootstrap/hnb659fds/version" + m := display.GetGlobalModelFunc() + if m == nil || m.Deployment == nil { + return fmt.Errorf("global model or deployment is nil") + } - // Try to get the version parameter - _, err := ssmClient.GetParameter(ctx, &ssm.GetParameterInput{ - Name: aws.String(paramName), - }) + // Initialize VPC manager if needed + if p.vpcManager == nil { + p.vpcManager = NewRegionalVPCManager(m.Deployment, p.EC2Client) + } + // Get or create EC2 client for this region + regionalClient, err := p.getOrCreateEC2Client(ctx, region) if err != nil { - l.Warn("Bootstrap parameter not found, creating new bootstrap stack") - } else { - l.Info("Bootstrap stack already exists") - done <- nil - return <-done + return fmt.Errorf("failed to get EC2 client: %w", err) } - // Initialize CloudFormation resources - bootstrapApp := awscdk.NewApp(nil) - - stackProps := &awscdk.StackProps{ - Env: &awscdk.Environment{ - Account: jsii.String(p.AccountID), - Region: jsii.String(p.Region), - }, - // Important: Disable the lookup of context values during synthesis - Synthesizer: awscdk.NewDefaultStackSynthesizer(&awscdk.DefaultStackSynthesizerProps{ - GenerateBootstrapVersionRule: jsii.Bool(false), - }), - } + // Create VPC + err = p.vpcManager.UpdateVPC(region, func(vpc *models.AWSVPC) error { + createVpcInput := &ec2.CreateVpcInput{ + CidrBlock: aws.String("10.0.0.0/16"), + TagSpecifications: []ec2_types.TagSpecification{ + { + ResourceType: ec2_types.ResourceTypeVpc, + Tags: []ec2_types.Tag{ + { + Key: aws.String("Name"), + Value: aws.String("andaime-vpc"), + }, + { + Key: aws.String("andaime"), + Value: aws.String("true"), + }, + }, + }, + }, + } - bootstrapStack := awscdk.NewStack(bootstrapApp, jsii.String("CDKToolkit"), stackProps) + l.Debugf("Sending CreateVpc request with cidr_block %s", "10.0.0.0/16") - // Create KMS key for bootstrap resources - key := awskms.NewKey(bootstrapStack, jsii.String("BootstrapKey"), &awskms.KeyProps{ - Alias: jsii.String("alias/cdk-hnb659fds-key"), - EnableKeyRotation: jsii.Bool(true), - RemovalPolicy: awscdk.RemovalPolicy_RETAIN, - }) + createVpcOutput, err := regionalClient.CreateVpc(ctx, createVpcInput) + if err != nil { + l.Debugf("VPC creation failed: %v", err) + return fmt.Errorf("failed to create VPC: %w", err) + } - // Create staging bucket - bucketName := fmt.Sprintf("cdk-%s-assets-%s-%s", "hnb659fds", p.AccountID, p.Region) - bucket := awss3.NewBucket(bootstrapStack, jsii.String("StagingBucket"), &awss3.BucketProps{ - BucketName: jsii.String(bucketName), - Encryption: awss3.BucketEncryption_KMS, - EncryptionKey: key, - BlockPublicAccess: awss3.BlockPublicAccess_BLOCK_ALL(), - Versioned: jsii.Bool(true), - RemovalPolicy: awscdk.RemovalPolicy_RETAIN, - AutoDeleteObjects: jsii.Bool(false), + vpc.VPCID = *createVpcOutput.Vpc.VpcId + l.Debugf("Created VPC with ID %s", vpc.VPCID) + return nil }) - // Add permissions - bucket.AddToResourcePolicy(awsiam.NewPolicyStatement(&awsiam.PolicyStatementProps{ - Effect: awsiam.Effect_ALLOW, - Actions: jsii.Strings( - "s3:GetObject", - "s3:PutObject", - "s3:ListBucket", - ), - Resources: jsii.Strings( - *bucket.BucketArn(), - *bucket.BucketArn()+"/*", - ), - Principals: &[]awsiam.IPrincipal{ - awsiam.NewAccountRootPrincipal(), - }, - })) - - // Create SSM parameters - awsssm.NewStringParameter( - bootstrapStack, - jsii.String("VersionParameter"), - &awsssm.StringParameterProps{ - ParameterName: jsii.String("/cdk-bootstrap/hnb659fds/version"), - StringValue: jsii.String("14"), - Description: jsii.String( - "The version of the CDK bootstrap resources in this environment", - ), - }, - ) - - // Synthesize the template - template := bootstrapApp.Synth(nil).GetStackArtifact(jsii.String("CDKToolkit")).Template() - templateJSON, err := json.Marshal(template) if err != nil { - return fmt.Errorf("failed to marshal bootstrap template: %w", err) + return err } - l.Info("Creating bootstrap stack...") + // Wait for VPC to become available + l.Info("Waiting for VPC to be available...") + state := p.vpcManager.GetOrCreateVPCState(region) + vpcID := state.vpc.VPCID - // Create the stack with detailed error handling - _, err = p.cloudFormationClient.CreateStack(ctx, &cloudformation.CreateStackInput{ - StackName: aws.String("CDKToolkit"), - TemplateBody: aws.String(string(templateJSON)), - Capabilities: []types.Capability{ - types.CapabilityCapabilityIam, - types.CapabilityCapabilityNamedIam, - }, - OnFailure: types.OnFailureRollback, - Tags: []types.Tag{ - { - Key: aws.String("aws-cdk:bootstrap-role"), - Value: aws.String("lookup"), - }, - }, - }) + b := backoff.NewExponentialBackOff() + b.MaxElapsedTime = 5 * time.Minute + b.InitialInterval = 2 * time.Second + b.MaxInterval = 30 * time.Second - if err != nil { - return fmt.Errorf("failed to create bootstrap stack: %w", err) - } + operation := func() error { + if err := ctx.Err(); err != nil { + return backoff.Permanent(err) + } - // Wait for creation to complete with detailed status updates - l.Info("Waiting for bootstrap stack creation to complete...") - waiter := cloudformation.NewStackCreateCompleteWaiter(p.cloudFormationClient) + input := &ec2.DescribeVpcsInput{ + VpcIds: []string{vpcID}, + } - // Add a ticker to log stack events during creation - ticker := time.NewTicker(10 * time.Second) - defer ticker.Stop() + result, err := regionalClient.DescribeVpcs(ctx, input) + if err != nil { + l.Debugf("Failed to describe VPC with ID %s: %v", vpcID, err) + return fmt.Errorf("failed to describe VPC: %w", err) + } - waitDone := make(chan error) - go func() { - waitDone <- waiter.Wait(ctx, &cloudformation.DescribeStacksInput{ - StackName: aws.String("CDKToolkit"), - }, 30*time.Minute) - }() + if len(result.Vpcs) > 0 { + l.Debugf("VPC status check with ID %s: %s", vpcID, string(result.Vpcs[0].State)) - for { - select { - case err := <-waitDone: - if err != nil { - // Get the stack events to understand what went wrong - events, descErr := p.cloudFormationClient.DescribeStackEvents( - ctx, - &cloudformation.DescribeStackEventsInput{ - StackName: aws.String("CDKToolkit"), - }, - ) - if descErr == nil && len(events.StackEvents) > 0 { - l.Error("Stack creation failed. Recent events:") - for i := 0; i < min(5, len(events.StackEvents)); i++ { - event := events.StackEvents[i] - l.Errorf( - " %s: %s - %s", - *event.LogicalResourceId, - event.ResourceStatus, - *event.ResourceStatusReason, - ) - } - } - return fmt.Errorf("bootstrap stack creation failed: %w", err) - } - l.Info("Bootstrap stack created successfully") - done <- nil - return <-done - case <-ticker.C: - // Log current stack status - status, err := p.cloudFormationClient.DescribeStacks( - ctx, - &cloudformation.DescribeStacksInput{ - StackName: aws.String("CDKToolkit"), - }, - ) - if err == nil && len(status.Stacks) > 0 { - l.Infof("Current stack status: %s", status.Stacks[0].StackStatus) + if result.Vpcs[0].State == ec2_types.VpcStateAvailable { + l.Debugf("VPC is now available with ID %s", vpcID) + return nil } } + + l.Debugf("VPC not yet available with ID %s", vpcID) + return fmt.Errorf("VPC not yet available") } -} -func min(a, b int) int { - if a < b { - return a + if err := backoff.Retry(operation, backoff.WithContext(b, ctx)); err != nil { + return fmt.Errorf("timeout waiting for VPC to become available: %w", err) } - return b -} -// Add these helper functions to check stack status -func isStackInRollback(status types.StackStatus) bool { - return status == types.StackStatusRollbackComplete || - status == types.StackStatusRollbackInProgress || - status == types.StackStatusUpdateRollbackComplete || - status == types.StackStatusUpdateRollbackInProgress -} + // Update display state to pending + p.updateVPCDisplayState(m, models.ResourceStatePending) -func isStackFailed(status types.StackStatus) bool { - return status == types.StackStatusCreateFailed || - status == types.StackStatusDeleteFailed || - status == types.StackStatusUpdateFailed || - isStackInRollback(status) -} -func (p *AWSProvider) CreateInfrastructure(ctx context.Context) error { - l := logger.Get() - cfnClient := NewCloudFormationClientFunc(*p.Config) + // Enable DNS hostnames + modifyVpcAttributeInput := &ec2.ModifyVpcAttributeInput{ + VpcId: aws.String(vpcID), + EnableDnsHostnames: &ec2_types.AttributeBooleanValue{Value: aws.Bool(true)}, + } - stackProps := &awscdk.StackProps{ - Env: &awscdk.Environment{ - Account: jsii.String(p.AccountID), - Region: jsii.String(p.Region), - }, + _, err = regionalClient.ModifyVpcAttribute(ctx, modifyVpcAttributeInput) + if err != nil { + return fmt.Errorf("failed to enable DNS hostnames: %w", err) + } + + // Update display state to running + p.updateVPCDisplayState(m, models.ResourceStateRunning) + + // Save VPC configuration + if err := p.vpcManager.SaveVPCConfig(region); err != nil { + l.Warnf("Failed to save VPC configuration: %v", err) } - p.Stack = NewVpcStack(p.App, "AndaimeStack", stackProps) - p.VPC = p.Stack.Node().FindChild(jsii.String("AndaimeVPC")).(awsec2.IVpc) + l.Debugf("Regional VPC (Region: %s) created successfully with ID %s", + region, vpcID) - // Get the template - template := p.App.Synth(nil).GetStackArtifact(jsii.String("AndaimeStack")).Template() + return nil +} + +// Core infrastructure creation function +func (p *AWSProvider) CreateInfrastructure(ctx context.Context) error { + l := logger.Get() + l.Info("Creating AWS infrastructure...") - // Marshal the template to JSON - templateJSON, err := json.Marshal(template) + allRegions, err := p.GetAllAWSRegions(ctx) if err != nil { - return fmt.Errorf("failed to marshal CloudFormation template: %w", err) + return fmt.Errorf("failed to get all AWS regions: %w", err) } - l.Info("Creating infrastructure stack...") + if err := p.initializeInfrastructureDisplay(); err != nil { + return err + } - // Create the stack using the CloudFormation client - _, err = cfnClient.CreateStack(ctx, &cloudformation.CreateStackInput{ - StackName: aws.String("AndaimeStack"), - TemplateBody: aws.String(string(templateJSON)), - Capabilities: []types.Capability{ - types.CapabilityCapabilityIam, - types.CapabilityCapabilityNamedIam, - }, - Tags: []types.Tag{ - { - Key: aws.String("AndaimeDeployment"), - Value: aws.String("true"), - }, - }, - }) - if err != nil { - return fmt.Errorf("failed to create stack: %w", err) + if err := p.createRegionalInfrastructure(ctx, allRegions); err != nil { + return fmt.Errorf("failed to create infrastructure: %w", err) } - // Wait for creation to complete with detailed status updates - l.Info("Waiting for infrastructure stack creation to complete...") - waiter := cloudformation.NewStackCreateCompleteWaiter(cfnClient) + l.Info("Infrastructure created successfully") + return nil +} - // Use shorter timeout for tests - timeout := DefaultStackTimeout - if strings.HasSuffix(os.Args[0], ".test") { - timeout = TestStackTimeout +// Initialize the display model for infrastructure creation +func (p *AWSProvider) initializeInfrastructureDisplay() error { + m := display.GetGlobalModelFunc() + if m == nil || m.Deployment == nil { + return fmt.Errorf("deployment model not initialized") } - // Add a ticker to log stack events during creation - ticker := time.NewTicker(10 * time.Second) - defer ticker.Stop() + for _, machine := range m.Deployment.GetMachines() { + m.QueueUpdate(display.UpdateAction{ + MachineName: machine.GetName(), + UpdateData: display.UpdateData{ + UpdateType: display.UpdateTypeResource, + ResourceType: "Infrastructure", + ResourceState: models.ResourceStatePending, + }, + }) + } + return nil +} - waitDone := make(chan error) - go func() { - waitDone <- waiter.Wait(ctx, &cloudformation.DescribeStacksInput{ - StackName: aws.String("AndaimeStack"), - }, timeout) - }() +// Create infrastructure in all regions concurrently +func (p *AWSProvider) createRegionalInfrastructure( + ctx context.Context, + regions []string, +) error { + var eg errgroup.Group - for { - select { - case <-ctx.Done(): - return ctx.Err() - case err := <-waitDone: - if err != nil { - // Get the stack events to understand what went wrong - events, descErr := cfnClient.DescribeStackEvents( - ctx, - &cloudformation.DescribeStackEventsInput{ - StackName: aws.String("AndaimeStack"), - }, - ) - if descErr == nil && len(events.StackEvents) > 0 { - l.Error("Stack creation failed. Recent events:") - for i := 0; i < min(5, len(events.StackEvents)); i++ { - event := events.StackEvents[i] - l.Errorf( - " %s: %s - %s", - *event.LogicalResourceId, - event.ResourceStatus, - *event.ResourceStatusReason, - ) - } - } - return fmt.Errorf("infrastructure stack creation failed: %w", err) - } - l.Info("Infrastructure stack created successfully") - return nil - case <-ticker.C: - // Log current stack status - status, err := cfnClient.DescribeStacks(ctx, &cloudformation.DescribeStacksInput{ - StackName: aws.String("AndaimeStack"), - }) - if err == nil && len(status.Stacks) > 0 { - l.Infof("Current stack status: %s", status.Stacks[0].StackStatus) - } - } + for _, region := range regions { + region := region // capture for goroutine + eg.Go(func() error { + return p.setupRegionalInfrastructure(ctx, region) + }) } + + return eg.Wait() } -// Destroy modification to clean up bootstrap resources -func (p *AWSProvider) Destroy(ctx context.Context) error { +// Setup infrastructure for a single region +func (p *AWSProvider) setupRegionalInfrastructure(ctx context.Context, region string) error { l := logger.Get() - l.Info("Starting destruction of AWS resources") + l.Debugf("Setting up infrastructure for region: %s", region) - cfg, err := awsconfig.LoadDefaultConfig(ctx, awsconfig.WithRegion(p.Region)) - if err != nil { - return fmt.Errorf("failed to load AWS config: %w", err) + m := display.GetGlobalModelFunc() + if m == nil || m.Deployment == nil { + return fmt.Errorf("global model or deployment is nil") } - cfnClient := cloudformation.NewFromConfig(cfg) - // Delete the main stack first - if p.Stack != nil { - stackName := *p.Stack.StackName() - if err := p.deleteStack(ctx, cfnClient, stackName); err != nil { - return err - } + // Debug current state + l.Debugf("Current deployment state: %+v", m.Deployment.AWS) + if m.Deployment.AWS.RegionalResources != nil { + l.Debugf("Current VPCs: %+v", m.Deployment.AWS.RegionalResources.VPCs) + } + + // Initialize VPC manager if needed + if p.vpcManager == nil { + l.Debug("Initializing VPC manager") + p.vpcManager = NewRegionalVPCManager(m.Deployment, p.EC2Client) } - // Delete the bootstrap stack - if err := p.deleteStack(ctx, cfnClient, "CDKToolkit"); err != nil { + // Step 1: Get availability zones + azs, err := p.getRegionAvailabilityZones(ctx, region) + if err != nil { + l.Debugf("Failed to get availability zones: %v", err) return err } + l.Debugf("Found %d availability zones", len(azs)) - // Clean up local state - p.Stack = nil - p.VPC = nil + // Step 2: Create VPC and security groups + l.Debug("Creating VPC...") + if err := p.createVPCWithRetry(ctx, region); err != nil { + l.Debugf("Failed to create VPC: %v", err) + return fmt.Errorf("failed to create VPC: %w", err) + } - return nil -} + // Get VPC state + state := p.vpcManager.GetOrCreateVPCState(region) + state.mu.RLock() + vpc := state.vpc + state.mu.RUnlock() -// Helper function to delete a stack and wait for completion -func (p *AWSProvider) deleteStack( - ctx context.Context, - cfnClient *cloudformation.Client, - stackName string, -) error { - l := logger.Get() + l.Debugf("VPC state after creation: %+v", vpc) - // Check if stack exists - _, err := cfnClient.DescribeStacks(ctx, &cloudformation.DescribeStacksInput{ - StackName: aws.String(stackName), - }) - if err != nil { - // If stack doesn't exist, just return - if strings.Contains(err.Error(), "does not exist") { - return nil - } - return fmt.Errorf("failed to describe stack %s: %w", stackName, err) + if vpc == nil { + l.Debug("VPC is nil after creation!") + return fmt.Errorf("VPC not found for region %s", region) } - // Delete the stack - _, err = cfnClient.DeleteStack(ctx, &cloudformation.DeleteStackInput{ - StackName: aws.String(stackName), - }) + sgID, err := p.createSecurityGroup(ctx, vpc.VPCID) if err != nil { - return fmt.Errorf("failed to delete stack %s: %w", stackName, err) + return fmt.Errorf("failed to create security groups: %w", err) } + m.Deployment.AWS.RegionalResources.SetSGID(region, *sgID) - l.Infof("Waiting for stack %s deletion to complete...", stackName) - waiter := cloudformation.NewStackDeleteCompleteWaiter(cfnClient) - maxWaitTime := 30 * time.Minute - if err := waiter.Wait(ctx, &cloudformation.DescribeStacksInput{ - StackName: aws.String(stackName), - }, maxWaitTime); err != nil { - return fmt.Errorf("failed waiting for stack %s deletion: %w", stackName, err) + // Step 3: Create subnets + if err := p.createRegionalSubnets(ctx, region, azs[:2]); err != nil { + return err } - l.Infof("Stack %s successfully destroyed", stackName) - return nil -} + // Step 4: Setup networking components + if err := p.setupNetworking(ctx, region); err != nil { + return err + } -func (p *AWSProvider) GetClusterDeployer() common_interface.ClusterDeployerer { - return p.ClusterDeployer -} + // Step 5: Save and update display + if err := p.saveInfrastructureToConfig(); err != nil { + return fmt.Errorf("failed to save infrastructure IDs to config: %w", err) + } -func (p *AWSProvider) SetClusterDeployer(deployer common_interface.ClusterDeployerer) { - p.ClusterDeployer = deployer -} + p.updateInfrastructureDisplay(models.ResourceStateSucceeded) -func NewVpcStack(scope constructs.Construct, id string, props *awscdk.StackProps) awscdk.Stack { - stack := awscdk.NewStack(scope, &id, props) + l.Info("AWS infrastructure created successfully for region: " + region) + return nil +} - vpc := awsec2.NewVpc(stack, jsii.String("AndaimeVPC"), &awsec2.VpcProps{ - MaxAzs: jsii.Number(2), - SubnetConfiguration: &[]*awsec2.SubnetConfiguration{ +// Get availability zones for a region +func (p *AWSProvider) getRegionAvailabilityZones( + ctx context.Context, + region string, +) ([]ec2_types.AvailabilityZone, error) { + azInput := &ec2.DescribeAvailabilityZonesInput{ + Filters: []ec2_types.Filter{ { - CidrMask: jsii.Number(24), - Name: jsii.String("Public"), - SubnetType: awsec2.SubnetType_PUBLIC, + Name: aws.String("region-name"), + Values: []string{region}, }, { - CidrMask: jsii.Number(24), - Name: jsii.String("Private"), - SubnetType: awsec2.SubnetType_PRIVATE_WITH_EGRESS, + Name: aws.String("state"), + Values: []string{"available"}, }, }, - }) + } - awscdk.NewCfnOutput(stack, jsii.String("VpcId"), &awscdk.CfnOutputProps{ - Value: vpc.VpcId(), - Description: jsii.String("VPC ID"), - }) + azOutput, err := p.EC2Client.DescribeAvailabilityZones(ctx, azInput) + if err != nil { + return nil, fmt.Errorf("failed to get availability zones for region %s: %w", region, err) + } + + if len(azOutput.AvailabilityZones) < 2 { + return nil, fmt.Errorf("region %s does not have at least 2 availability zones", region) + } + + return azOutput.AvailabilityZones, nil +} + +// Create subnets in a region +func (p *AWSProvider) createRegionalSubnets( + ctx context.Context, + region string, + azs []ec2_types.AvailabilityZone, +) error { + l := logger.Get() + l.Debugf("Creating regional subnets for region %s", region) + + m := display.GetGlobalModelFunc() + if m == nil || m.Deployment == nil || m.Deployment.AWS == nil { + return fmt.Errorf("deployment model not properly initialized") + } + + // Initialize VPC manager if needed + if p.vpcManager == nil { + p.vpcManager = NewRegionalVPCManager(m.Deployment, p.EC2Client) + } + + state := p.vpcManager.GetOrCreateVPCState(region) + if state == nil { + return fmt.Errorf("failed to get VPC state for region %s", region) + } + + state.mu.RLock() + vpc := state.vpc + state.mu.RUnlock() + + if vpc == nil { + return fmt.Errorf("VPC not found for region %s", region) + } + + l.Debugf("Creating subnets in VPC %s", vpc.VPCID) + + return p.vpcManager.UpdateVPC(region, func(vpc *models.AWSVPC) error { + for i, az := range azs { + // Create public subnet + l.Debugf("Creating public subnet in AZ %s", *az.ZoneName) + publicSubnet, err := p.createSubnet(ctx, vpc.VPCID, *az.ZoneName, i*2, "public") + if err != nil { + return fmt.Errorf("failed to create public subnet: %w", err) + } + vpc.PublicSubnetIDs = append(vpc.PublicSubnetIDs, *publicSubnet.Subnet.SubnetId) + + // Create private subnet + l.Debugf("Creating private subnet in AZ %s", *az.ZoneName) + privateSubnet, err := p.createSubnet(ctx, vpc.VPCID, *az.ZoneName, i*2+1, "private") + if err != nil { + return fmt.Errorf("failed to create private subnet: %w", err) + } + vpc.PrivateSubnetIDs = append(vpc.PrivateSubnetIDs, *privateSubnet.Subnet.SubnetId) + } + return nil + }) +} + +// Create a single subnet +func (p *AWSProvider) createSubnet( + ctx context.Context, + vpcID, azName string, + index int, + subnetType string, +) (*ec2.CreateSubnetOutput, error) { + input := &ec2.CreateSubnetInput{ + VpcId: aws.String(vpcID), + AvailabilityZone: aws.String(azName), + CidrBlock: aws.String(fmt.Sprintf("10.0.%d.0/24", index)), + TagSpecifications: []ec2_types.TagSpecification{ + { + ResourceType: ec2_types.ResourceTypeSubnet, + Tags: []ec2_types.Tag{ + { + Key: aws.String("Name"), + Value: aws.String(fmt.Sprintf("%s-subnet-%s", subnetType, azName)), + }, + {Key: aws.String("Type"), Value: aws.String(subnetType)}, + }, + }, + }, + } + + subnet, err := p.EC2Client.CreateSubnet(ctx, input) + if err != nil { + return nil, fmt.Errorf("failed to create %s subnet in %s: %w", subnetType, azName, err) + } + + return subnet, nil +} + +// Setup networking components (IGW, route tables, etc.) +func (p *AWSProvider) setupNetworking(ctx context.Context, region string) error { + l := logger.Get() + l.Debugf("Setting up networking for region %s", region) + + if p.vpcManager == nil { + return fmt.Errorf("VPC manager not initialized") + } + + state := p.vpcManager.GetOrCreateVPCState(region) + if state == nil { + return fmt.Errorf("failed to get VPC state for region %s", region) + } + + state.mu.RLock() + vpc := state.vpc + state.mu.RUnlock() + + if vpc == nil { + return fmt.Errorf("VPC not found for region %s", region) + } + + // Create and attach Internet Gateway + igw, err := p.createInternetGateway(ctx) + if err != nil { + return fmt.Errorf("failed to create internet gateway: %w", err) + } + + return p.vpcManager.UpdateVPC(region, func(vpc *models.AWSVPC) error { + vpc.InternetGatewayID = *igw.InternetGateway.InternetGatewayId + + if err := p.attachInternetGateway(ctx, vpc.InternetGatewayID, vpc.VPCID); err != nil { + return fmt.Errorf("failed to attach internet gateway: %w", err) + } + + // Setup routing + return p.setupRouting(ctx, vpc) + }) +} + +func (p *AWSProvider) attachInternetGateway(ctx context.Context, igwID, vpcID string) error { + l := logger.Get() + l.Debugf("Attaching internet gateway %s to VPC %s", igwID, vpcID) + + if p.EC2Client == nil { + return fmt.Errorf("EC2 client not initialized") + } + + _, err := p.EC2Client.AttachInternetGateway(ctx, &ec2.AttachInternetGatewayInput{ + InternetGatewayId: aws.String(igwID), + VpcId: aws.String(vpcID), + }) + return err +} + +// Update the infrastructure display state +func (p *AWSProvider) updateInfrastructureDisplay(state models.MachineResourceState) { + m := display.GetGlobalModelFunc() + if m != nil && m.Deployment != nil { + for _, machine := range m.Deployment.GetMachines() { + m.QueueUpdate(display.UpdateAction{ + MachineName: machine.GetName(), + UpdateData: display.UpdateData{ + UpdateType: display.UpdateTypeResource, + ResourceType: "Infrastructure", + ResourceState: state, + }, + }) + } + } +} + +// Helper functions for networking setup +func (p *AWSProvider) createInternetGateway( + ctx context.Context, +) (*ec2.CreateInternetGatewayOutput, error) { + return p.EC2Client.CreateInternetGateway(ctx, &ec2.CreateInternetGatewayInput{ + TagSpecifications: []ec2_types.TagSpecification{ + { + ResourceType: ec2_types.ResourceTypeInternetGateway, + Tags: []ec2_types.Tag{ + {Key: aws.String("Name"), Value: aws.String("andaime-igw")}, + }, + }, + }, + }) +} + +// createVPCWithRetry handles VPC creation with cleanup retry logic +func (p *AWSProvider) createVPCWithRetry(ctx context.Context, region string) error { + l := logger.Get() + m := display.GetGlobalModelFunc() + if m == nil || m.Deployment == nil { + return fmt.Errorf("global model or deployment is nil") + } + + // Initialize VPC manager if needed + if p.vpcManager == nil { + p.vpcManager = NewRegionalVPCManager(m.Deployment, p.EC2Client) + } + + err := p.CreateVpc(ctx, region) + if err != nil { + if strings.Contains(err.Error(), "VpcLimitExceeded") { + l.Info("VPC limit exceeded, attempting to clean up abandoned VPCs...") + + // Try to find and clean up any abandoned VPCs + if cleanupErr := p.cleanupAbandonedVPCs(ctx); cleanupErr != nil { + return fmt.Errorf("failed to cleanup VPCs: %w", cleanupErr) + } + + // Retry VPC creation after cleanup + l.Info("Retrying VPC creation after cleanup...") + if retryErr := p.CreateVpc(ctx, region); retryErr != nil { + return fmt.Errorf("failed to create VPC after cleanup: %w", retryErr) + } + + l.Info("Successfully created VPC after cleanup") + } else { + return fmt.Errorf("failed to create VPC: %w", err) + } + } + + return nil +} + +// cleanupVPCResources handles the cleanup of a single VPC's resources +func (p *AWSProvider) cleanupVPCResources(ctx context.Context, vpcID string) error { + l := logger.Get() + l.Infof("Cleaning up resources for VPC %s", vpcID) + + // 1. Delete subnets + if err := p.cleanupSubnets(ctx, vpcID); err != nil { + return fmt.Errorf("failed to cleanup subnets: %w", err) + } + + // 2. Delete security groups + if err := p.cleanupSecurityGroups(ctx, vpcID); err != nil { + return fmt.Errorf("failed to cleanup security groups: %w", err) + } + + // 3. Delete route tables + if err := p.cleanupRouteTables(ctx, vpcID); err != nil { + return fmt.Errorf("failed to cleanup route tables: %w", err) + } + + // 4. Detach and delete internet gateways + if err := p.cleanupInternetGateways(ctx, vpcID); err != nil { + return fmt.Errorf("failed to cleanup internet gateways: %w", err) + } + + // Finally, delete the VPC + _, err := p.EC2Client.DeleteVpc(ctx, &ec2.DeleteVpcInput{ + VpcId: aws.String(vpcID), + }) + if err != nil { + return fmt.Errorf("failed to delete VPC: %w", err) + } + + l.Infof("Successfully cleaned up VPC %s", vpcID) + return nil +} + +// Helper functions for VPC cleanup +func (p *AWSProvider) cleanupSubnets(ctx context.Context, vpcID string) error { + subnets, err := p.EC2Client.DescribeSubnets(ctx, &ec2.DescribeSubnetsInput{ + Filters: []ec2_types.Filter{ + { + Name: aws.String("vpc-id"), + Values: []string{vpcID}, + }, + }, + }) + if err != nil { + return fmt.Errorf("failed to describe subnets: %w", err) + } + + for _, subnet := range subnets.Subnets { + _, err := p.EC2Client.DeleteSubnet(ctx, &ec2.DeleteSubnetInput{ + SubnetId: subnet.SubnetId, + }) + if err != nil { + return fmt.Errorf("failed to delete subnet %s: %w", aws.ToString(subnet.SubnetId), err) + } + } + + return nil +} + +func (p *AWSProvider) cleanupSecurityGroups(ctx context.Context, vpcID string) error { + sgs, err := p.EC2Client.DescribeSecurityGroups(ctx, &ec2.DescribeSecurityGroupsInput{ + Filters: []ec2_types.Filter{ + { + Name: aws.String("vpc-id"), + Values: []string{vpcID}, + }, + }, + }) + if err != nil { + return fmt.Errorf("failed to describe security groups: %w", err) + } + + for _, sg := range sgs.SecurityGroups { + if aws.ToString(sg.GroupName) != DefaultName { + _, err := p.EC2Client.DeleteSecurityGroup(ctx, &ec2.DeleteSecurityGroupInput{ + GroupId: sg.GroupId, + }) + if err != nil { + return fmt.Errorf( + "failed to delete security group %s: %w", + aws.ToString(sg.GroupId), + err, + ) + } + } + } + + return nil +} +func (p *AWSProvider) createSecurityGroup(ctx context.Context, + vpcid string) (*string, error) { + l := logger.Get() + l.Info("Creating security groups...") + sgOutput, err := p.GetEC2Client().CreateSecurityGroup(ctx, &ec2.CreateSecurityGroupInput{ + GroupName: aws.String("andaime-sg"), + VpcId: aws.String(vpcid), + Description: aws.String("Security group for Andaime deployments"), + TagSpecifications: []ec2_types.TagSpecification{ + { + ResourceType: ec2_types.ResourceTypeSecurityGroup, + Tags: []ec2_types.Tag{ + {Key: aws.String("Name"), Value: aws.String("andaime-sg")}, + }, + }, + }, + }) + if err != nil { + return nil, fmt.Errorf("failed to create security group: %w", err) + } + + sgRules := []ec2_types.IpPermission{} + allowedPorts := []int{22, 1234, 1235, 4222} + for _, port := range allowedPorts { + sgRules = append(sgRules, ec2_types.IpPermission{ + IpProtocol: aws.String("tcp"), + FromPort: aws.Int32(int32(port)), + ToPort: aws.Int32(int32(port)), + IpRanges: []ec2_types.IpRange{ + { + CidrIp: aws.String("0.0.0.0/0"), + }, + }, + }) + } + + _, err = p.GetEC2Client(). + AuthorizeSecurityGroupIngress(ctx, &ec2.AuthorizeSecurityGroupIngressInput{ + GroupId: sgOutput.GroupId, + IpPermissions: sgRules, + }) + if err != nil { + return nil, fmt.Errorf("failed to authorize security group ingress: %w", err) + } + + return sgOutput.GroupId, nil +} + +func (p *AWSProvider) importSSHKeyPair( + _ context.Context, + sshPublicKeyPath string, +) (string, error) { + l := logger.Get() + l.Info("Reading SSH public key...") + + // Read the public key file + publicKeyBytes, err := os.ReadFile(sshPublicKeyPath) + if err != nil { + return "", fmt.Errorf("failed to read SSH public key: %w", err) + } + + l.Infof("Read SSH public key from %s", sshPublicKeyPath) + return string(publicKeyBytes), nil +} + +// generateRandomString creates a random string of specified length +func generateRandomString(length int) string { + const charset = "abcdefghijklmnopqrstuvwxyz0123456789" + b := make([]byte, length) + for i := range b { + b[i] = charset[rand.Intn(len(charset))] + } + return string(b) +} + +// saveInfrastructureToConfig saves all infrastructure IDs to the configuration +func (p *AWSProvider) saveInfrastructureToConfig() error { + // Create a local lock to ensure we only write to the config file once + p.ConfigMutex.Lock() + defer p.ConfigMutex.Unlock() + + m := display.GetGlobalModelFunc() + if m == nil || m.Deployment == nil { + return fmt.Errorf("global model or deployment is nil") + } + + basePath := m.Deployment.ViperPath + for region, vpc := range m.Deployment.AWS.RegionalResources.VPCs { + viper.Set(fmt.Sprintf("%s.regions.%s.vpc_id", basePath, region), vpc.VPCID) + } + + return viper.WriteConfig() +} + +func (p *AWSProvider) WaitForNetworkConnectivity(ctx context.Context) error { + m := display.GetGlobalModelFunc() + if m == nil || m.Deployment == nil { + return fmt.Errorf("global model or deployment is nil") + } + + var eg errgroup.Group + for region := range m.Deployment.AWS.RegionalResources.VPCs { + region := region + vpcID := m.Deployment.AWS.RegionalResources.VPCs[region].VPCID + + eg.Go(func() error { + l := logger.Get() + l.Debugf("Starting network connectivity check with VPC ID %s", vpcID) + + b := backoff.NewExponentialBackOff() + b.InitialInterval = 5 * time.Second + b.MaxInterval = 30 * time.Second + b.MaxElapsedTime = 5 * time.Minute + + l.Info("Starting network connectivity check...") + l.Infof("Using VPC ID: %s", vpcID) + + operation := func() error { + if err := ctx.Err(); err != nil { + l.Error(fmt.Sprintf("Context error: %v", err)) + return backoff.Permanent(err) + } + + // Check if we can describe route tables (tests network connectivity) + input := &ec2.DescribeRouteTablesInput{ + Filters: []ec2_types.Filter{ + { + Name: aws.String("vpc-id"), + Values: []string{vpcID}, + }, + }, + } + + l.Info("Attempting to describe route tables for VPC connectivity check...") + l.Debugf("Looking for route tables in VPC %s with internet gateway routes", vpcID) + result, err := p.EC2Client.DescribeRouteTables(ctx, input) + if err != nil { + l.Debugf("Failed to describe route tables: %v", err) + return fmt.Errorf("failed to describe route tables: %w", err) + } + + l.Debugf("Route tables found with VPC ID %s: %d", vpcID, len(result.RouteTables)) + + // Verify route table has internet gateway route + hasInternetRoute := false + for i, rt := range result.RouteTables { + l.Infof("Checking route table %d...", i+1) + l.Infof("Route table ID: %s", *rt.RouteTableId) + + for _, route := range rt.Routes { + if route.GatewayId != nil { + l.Debugf( + "Examining route: [RouteTable: %s] [GatewayID: %s] [Destination: %s] [State: %s]", + *rt.RouteTableId, + aws.ToString(route.GatewayId), + aws.ToString(route.DestinationCidrBlock), + string(route.State), + ) + if strings.HasPrefix(*route.GatewayId, "igw-") { + hasInternetRoute = true + l.Info("Found internet gateway route!") + break + } + } + } + } + + if !hasInternetRoute { + l.Warn("No internet gateway route found in any route table") + return fmt.Errorf("internet gateway route not found") + } + + l.Info("Network connectivity check passed") + return nil + } + + return backoff.Retry(operation, backoff.WithContext(b, ctx)) + }) + } + + if err := eg.Wait(); err != nil { + return fmt.Errorf("network connectivity check failed: %w", err) + } + + return nil +} + +// cleanupAbandonedVPCs attempts to find and remove any abandoned VPCs +func (p *AWSProvider) cleanupAbandonedVPCs(ctx context.Context) error { + l := logger.Get() + l.Info("Attempting to cleanup abandoned VPCs") + + // List all VPCs + result, err := p.EC2Client.DescribeVpcs(ctx, &ec2.DescribeVpcsInput{}) + if err != nil { + return fmt.Errorf("failed to list VPCs: %w", err) + } + + for _, vpc := range result.Vpcs { + // Skip the default VPC + if aws.ToBool(vpc.IsDefault) { + continue + } + + // Check if VPC has the andaime tag + isAndaimeVPC := false + for _, tag := range vpc.Tags { + if aws.ToString(tag.Key) == "andaime" { + isAndaimeVPC = true + break + } + } + + if isAndaimeVPC { + vpcID := aws.ToString(vpc.VpcId) + l.Infof("Found abandoned VPC %s, cleaning up dependencies...", vpcID) + + // 1. Delete subnets + subnets, err := p.EC2Client.DescribeSubnets(ctx, &ec2.DescribeSubnetsInput{ + Filters: []ec2_types.Filter{ + { + Name: aws.String("vpc-id"), + Values: []string{vpcID}, + }, + }, + }) + if err != nil { + l.Warnf("Failed to describe subnets for VPC %s: %v", vpcID, err) + continue + } + + for _, subnet := range subnets.Subnets { + _, err := p.EC2Client.DeleteSubnet(ctx, &ec2.DeleteSubnetInput{ + SubnetId: subnet.SubnetId, + }) + if err != nil { + l.Warnf("Failed to delete subnet %s: %v", aws.ToString(subnet.SubnetId), err) + } + } + + // 2. Delete security groups (except default) + sgs, err := p.EC2Client.DescribeSecurityGroups(ctx, &ec2.DescribeSecurityGroupsInput{ + Filters: []ec2_types.Filter{ + { + Name: aws.String("vpc-id"), + Values: []string{vpcID}, + }, + }, + }) + if err != nil { + l.Warnf("Failed to describe security groups for VPC %s: %v", vpcID, err) + continue + } + + for _, sg := range sgs.SecurityGroups { + if aws.ToString(sg.GroupName) != DefaultName { + _, err := p.EC2Client.DeleteSecurityGroup(ctx, &ec2.DeleteSecurityGroupInput{ + GroupId: sg.GroupId, + }) + if err != nil { + l.Warnf( + "Failed to delete security group %s: %v", + aws.ToString(sg.GroupId), + err, + ) + } + } + } + + // 3. Delete route tables (except main) + rts, err := p.EC2Client.DescribeRouteTables(ctx, &ec2.DescribeRouteTablesInput{ + Filters: []ec2_types.Filter{ + { + Name: aws.String("vpc-id"), + Values: []string{vpcID}, + }, + }, + }) + if err != nil { + l.Warnf("Failed to describe route tables for VPC %s: %v", vpcID, err) + continue + } + + for _, rt := range rts.RouteTables { + // Skip the main route table + isMain := false + for _, assoc := range rt.Associations { + if aws.ToBool(assoc.Main) { + isMain = true + break + } + } + if isMain { + continue + } + + // Delete route table associations first + for _, assoc := range rt.Associations { + if assoc.RouteTableAssociationId != nil { + _, err := p.EC2Client.DisassociateRouteTable( + ctx, + &ec2.DisassociateRouteTableInput{ + AssociationId: assoc.RouteTableAssociationId, + }, + ) + if err != nil { + l.Warnf( + "Failed to disassociate route table %s: %v", + aws.ToString(rt.RouteTableId), + err, + ) + } + } + } + + _, err := p.EC2Client.DeleteRouteTable(ctx, &ec2.DeleteRouteTableInput{ + RouteTableId: rt.RouteTableId, + }) + if err != nil { + l.Warnf( + "Failed to delete route table %s: %v", + aws.ToString(rt.RouteTableId), + err, + ) + } + } + + // 4. Detach and delete internet gateways + igws, err := p.EC2Client.DescribeInternetGateways( + ctx, + &ec2.DescribeInternetGatewaysInput{ + Filters: []ec2_types.Filter{ + { + Name: aws.String("attachment.vpc-id"), + Values: []string{vpcID}, + }, + }, + }, + ) + if err != nil { + l.Warnf("Failed to describe internet gateways for VPC %s: %v", vpcID, err) + continue + } + + for _, igw := range igws.InternetGateways { + // Detach first + _, err := p.EC2Client.DetachInternetGateway(ctx, &ec2.DetachInternetGatewayInput{ + InternetGatewayId: igw.InternetGatewayId, + VpcId: aws.String(vpcID), + }) + if err != nil { + l.Warnf( + "Failed to detach internet gateway %s: %v", + aws.ToString(igw.InternetGatewayId), + err, + ) + continue + } + + // Then delete + _, err = p.EC2Client.DeleteInternetGateway(ctx, &ec2.DeleteInternetGatewayInput{ + InternetGatewayId: igw.InternetGatewayId, + }) + if err != nil { + l.Warnf( + "Failed to delete internet gateway %s: %v", + aws.ToString(igw.InternetGatewayId), + err, + ) + } + } - for i, subnet := range *vpc.PublicSubnets() { - awscdk.NewCfnOutput( - stack, - jsii.String(fmt.Sprintf("PublicSubnet%d", i)), - &awscdk.CfnOutputProps{ - Value: subnet.SubnetId(), - Description: jsii.String(fmt.Sprintf("Public Subnet %d ID", i)), - }, - ) + // Finally, delete the VPC + _, err = p.EC2Client.DeleteVpc(ctx, &ec2.DeleteVpcInput{ + VpcId: aws.String(vpcID), + }) + if err != nil { + l.Warnf("Failed to delete VPC %s: %v", vpcID, err) + continue + } + l.Infof("Successfully deleted abandoned VPC %s and its dependencies", vpcID) + } } - for i, subnet := range *vpc.PrivateSubnets() { - awscdk.NewCfnOutput( - stack, - jsii.String(fmt.Sprintf("PrivateSubnet%d", i)), - &awscdk.CfnOutputProps{ - Value: subnet.SubnetId(), - Description: jsii.String(fmt.Sprintf("Private Subnet %d ID", i)), - }, - ) - } + return nil +} + +func (p *AWSProvider) GetClusterDeployer() common_interface.ClusterDeployerer { + return p.ClusterDeployer +} - return stack +func (p *AWSProvider) SetClusterDeployer(deployer common_interface.ClusterDeployerer) { + p.ClusterDeployer = deployer } func (p *AWSProvider) ValidateMachineType( @@ -698,175 +1549,562 @@ func (p *AWSProvider) GetVMExternalIP(ctx context.Context, instanceID string) (s return *instance.PublicIpAddress, nil } -func (p *AWSProvider) ListDeployments(ctx context.Context) ([]string, error) { - l := logger.Get() - l.Info("Listing AWS deployments") - - // Create CloudFormation client - cfg, err := awsconfig.LoadDefaultConfig(ctx, awsconfig.WithRegion(p.Region)) - if err != nil { - return nil, fmt.Errorf("failed to load AWS config: %w", err) +func (p *AWSProvider) removeDeploymentFromConfig(stackName string) error { + deployments := viper.GetStringMap("deployments") + for uniqueID, details := range deployments { + deploymentDetails, ok := details.(map[string]interface{}) + if !ok { + continue + } + awsDetails, ok := deploymentDetails["aws"].(map[string]interface{}) + if !ok { + continue + } + if _, exists := awsDetails[stackName]; exists { + delete(awsDetails, stackName) + if len(awsDetails) == 0 { + delete(deploymentDetails, "aws") + } + if len(deploymentDetails) == 0 { + delete(deployments, uniqueID) + } + viper.Set("deployments", deployments) + return viper.WriteConfig() + } } - cfnClient := cloudformation.NewFromConfig(cfg) + return nil +} - // List stacks with our deployment tag - input := &cloudformation.ListStacksInput{ - StackStatusFilter: []types.StackStatus{ - types.StackStatusCreateComplete, - types.StackStatusUpdateComplete, +func (p *AWSProvider) cleanupRouteTables(ctx context.Context, vpcID string) error { + l := logger.Get() + rts, err := p.EC2Client.DescribeRouteTables(ctx, &ec2.DescribeRouteTablesInput{ + Filters: []ec2_types.Filter{ + { + Name: aws.String("vpc-id"), + Values: []string{vpcID}, + }, }, + }) + if err != nil { + return fmt.Errorf("failed to describe route tables: %w", err) } - paginator := cloudformation.NewListStacksPaginator(cfnClient, input) - var deployments []string - - for paginator.HasMorePages() { - output, err := paginator.NextPage(ctx) - if err != nil { - return nil, fmt.Errorf("failed to list stacks: %w", err) - } - - for _, stack := range output.StackSummaries { - // Check if the stack has our deployment tag - describeInput := &cloudformation.DescribeStacksInput{ - StackName: stack.StackName, - } - describeOutput, err := cfnClient.DescribeStacks(ctx, describeInput) - if err != nil { - l.Warnf("Failed to describe stack %s: %v", *stack.StackName, err) - continue + for _, rt := range rts.RouteTables { + // Skip the main route table + isMain := false + for _, assoc := range rt.Associations { + if aws.ToBool(assoc.Main) { + isMain = true + break } + } + if isMain { + l.Debugf("Skipping main route table %s", *rt.RouteTableId) + continue + } - if len(describeOutput.Stacks) > 0 { - for _, tag := range describeOutput.Stacks[0].Tags { - if *tag.Key == "AndaimeDeployment" && *tag.Value == "true" { - deployments = append(deployments, *stack.StackName) - break - } + // Delete route table associations first + for _, assoc := range rt.Associations { + if assoc.RouteTableAssociationId != nil { + l.Debugf("Disassociating route table %s", *assoc.RouteTableAssociationId) + _, err := p.EC2Client.DisassociateRouteTable(ctx, &ec2.DisassociateRouteTableInput{ + AssociationId: assoc.RouteTableAssociationId, + }) + if err != nil { + return fmt.Errorf("failed to disassociate route table: %w", err) } } } + + l.Debugf("Deleting route table %s", *rt.RouteTableId) + _, err := p.EC2Client.DeleteRouteTable(ctx, &ec2.DeleteRouteTableInput{ + RouteTableId: rt.RouteTableId, + }) + if err != nil { + return fmt.Errorf("failed to delete route table: %w", err) + } } - l.Infof("Found %d AWS deployments", len(deployments)) - return deployments, nil + return nil } -func (p *AWSProvider) TerminateDeployment(ctx context.Context) error { +func (p *AWSProvider) cleanupInternetGateways(ctx context.Context, vpcID string) error { l := logger.Get() - l.Info("Starting termination of AWS deployment") + igws, err := p.EC2Client.DescribeInternetGateways(ctx, &ec2.DescribeInternetGatewaysInput{ + Filters: []ec2_types.Filter{ + { + Name: aws.String("attachment.vpc-id"), + Values: []string{vpcID}, + }, + }, + }) + if err != nil { + return fmt.Errorf("failed to describe internet gateways: %w", err) + } - if p.Stack == nil { - return fmt.Errorf("no active stack found for termination") + for _, igw := range igws.InternetGateways { + // Detach first + l.Debugf("Detaching internet gateway %s from VPC %s", *igw.InternetGatewayId, vpcID) + _, err := p.EC2Client.DetachInternetGateway(ctx, &ec2.DetachInternetGatewayInput{ + InternetGatewayId: igw.InternetGatewayId, + VpcId: aws.String(vpcID), + }) + if err != nil { + return fmt.Errorf("failed to detach internet gateway: %w", err) + } + + // Then delete + l.Debugf("Deleting internet gateway %s", *igw.InternetGatewayId) + _, err = p.EC2Client.DeleteInternetGateway(ctx, &ec2.DeleteInternetGatewayInput{ + InternetGatewayId: igw.InternetGatewayId, + }) + if err != nil { + return fmt.Errorf("failed to delete internet gateway: %w", err) + } } - // Create CloudFormation client - cfg, err := awsconfig.LoadDefaultConfig(ctx, awsconfig.WithRegion(p.Region)) + return nil +} + +// Helper functions for VPC routing setup +func (p *AWSProvider) setupRouting(ctx context.Context, vpc *models.AWSVPC) error { + l := logger.Get() + // Create public route table + l.Debug("Creating public route table") + publicRT, err := p.EC2Client.CreateRouteTable(ctx, &ec2.CreateRouteTableInput{ + VpcId: aws.String(vpc.VPCID), + TagSpecifications: []ec2_types.TagSpecification{ + { + ResourceType: ec2_types.ResourceTypeRouteTable, + Tags: []ec2_types.Tag{ + {Key: aws.String("Name"), Value: aws.String("public-rt")}, + }, + }, + }, + }) if err != nil { - return fmt.Errorf("failed to load AWS config: %w", err) + return fmt.Errorf("failed to create public route table: %w", err) + } + vpc.PublicRouteTableID = *publicRT.RouteTable.RouteTableId + + // Create route to Internet Gateway + if err := p.createInternetGatewayRoute(ctx, vpc); err != nil { + return err } - cfnClient := cloudformation.NewFromConfig(cfg) - // Get the stack name - stackName := *p.Stack.StackName() + // Associate public subnets with route table + return p.associatePublicSubnets(ctx, vpc) +} - // Delete the CloudFormation stack - _, err = cfnClient.DeleteStack(ctx, &cloudformation.DeleteStackInput{ - StackName: aws.String(stackName), +func (p *AWSProvider) createInternetGatewayRoute(ctx context.Context, vpc *models.AWSVPC) error { + l := logger.Get() + l.Debugf("Creating internet gateway route for VPC %s", vpc.VPCID) + _, err := p.EC2Client.CreateRoute(ctx, &ec2.CreateRouteInput{ + RouteTableId: aws.String(vpc.PublicRouteTableID), + DestinationCidrBlock: aws.String("0.0.0.0/0"), + GatewayId: aws.String(vpc.InternetGatewayID), }) - if err != nil { - return fmt.Errorf("failed to initiate stack deletion: %w", err) + return err +} + +func (p *AWSProvider) associatePublicSubnets(ctx context.Context, vpc *models.AWSVPC) error { + l := logger.Get() + for _, subnetID := range vpc.PublicSubnetIDs { + l.Debugf("Associating subnet %s with route table %s", subnetID, vpc.PublicRouteTableID) + _, err := p.EC2Client.AssociateRouteTable(ctx, &ec2.AssociateRouteTableInput{ + RouteTableId: aws.String(vpc.PublicRouteTableID), + SubnetId: aws.String(subnetID), + }) + if err != nil { + return fmt.Errorf( + "failed to associate public subnet %s with route table: %w", + subnetID, + err, + ) + } + } + return nil +} + +// VPC state display update helper +func (p *AWSProvider) updateVPCDisplayState( + m *display.DisplayModel, + state models.MachineResourceState, +) { + if m != nil && m.Deployment != nil { + for _, machine := range m.Deployment.GetMachines() { + m.QueueUpdate(display.UpdateAction{ + MachineName: machine.GetName(), + UpdateData: display.UpdateData{ + UpdateType: display.UpdateTypeResource, + ResourceType: "VPC", + ResourceState: state, + }, + }) + } } +} - l.Infof("Initiated deletion of stack: %s", stackName) +// Additional VPC manager methods +func (p *AWSProvider) GetVPCState(region string) (*VPCState, error) { + if p.vpcManager == nil { + return nil, fmt.Errorf("VPC manager not initialized") + } + return p.vpcManager.GetOrCreateVPCState(region), nil +} - // Wait for the stack to be deleted - l.Info("Waiting for stack deletion to complete...") - waiter := cloudformation.NewStackDeleteCompleteWaiter(cfnClient) - maxWaitTime := 30 * time.Minute - if err := waiter.Wait(ctx, &cloudformation.DescribeStacksInput{ - StackName: aws.String(stackName), - }, maxWaitTime); err != nil { - return fmt.Errorf("error waiting for stack deletion: %w", err) +func (p *AWSProvider) ValidateVPCState(region string) error { + state, err := p.GetVPCState(region) + if err != nil { + return err } - l.Info("Stack deletion completed successfully") + state.mu.RLock() + defer state.mu.RUnlock() + + if state.vpc == nil || state.vpc.VPCID == "" { + return fmt.Errorf("no valid VPC found for region %s", region) + } - // Clean up local state - p.Stack = nil - p.VPC = nil + return nil +} - // Remove the deployment from the configuration - if err := p.removeDeploymentFromConfig(stackName); err != nil { - l.Warnf("Failed to remove deployment from config: %v", err) +func (p *AWSProvider) ProvisionBacalhauCluster(ctx context.Context) error { + if err := p.GetClusterDeployer().ProvisionBacalhauCluster(ctx); err != nil { + return err } return nil } -func (p *AWSProvider) removeDeploymentFromConfig(stackName string) error { - deployments := viper.GetStringMap("deployments") - for uniqueID, details := range deployments { - deploymentDetails, ok := details.(map[string]interface{}) - if !ok { - continue +func (p *AWSProvider) FinalizeDeployment(ctx context.Context) error { + return nil +} + +// WaitUntilInstanceRunning waits for an EC2 instance to reach the running state +func (p *AWSProvider) WaitUntilInstanceRunning( + ctx context.Context, + input *ec2.DescribeInstancesInput, +) error { + l := logger.Get() + b := backoff.NewExponentialBackOff() + b.InitialInterval = 5 * time.Second + b.MaxInterval = 30 * time.Second + b.MaxElapsedTime = 10 * time.Minute + + operation := func() error { + if err := ctx.Err(); err != nil { + return backoff.Permanent(err) } - awsDetails, ok := deploymentDetails["aws"].(map[string]interface{}) - if !ok { - continue + + result, err := p.EC2Client.DescribeInstances(ctx, input) + if err != nil { + return fmt.Errorf("failed to describe instances: %w", err) } - if _, exists := awsDetails[stackName]; exists { - delete(awsDetails, stackName) - if len(awsDetails) == 0 { - delete(deploymentDetails, "aws") - } - if len(deploymentDetails) == 0 { - delete(deployments, uniqueID) - } - viper.Set("deployments", deployments) - return viper.WriteConfig() + + if len(result.Reservations) == 0 || len(result.Reservations[0].Instances) == 0 { + return fmt.Errorf("no instances found") + } + + instance := result.Reservations[0].Instances[0] + if instance.State == nil { + return fmt.Errorf("instance state is nil") + } + + switch instance.State.Name { + case ec2_types.InstanceStateNameRunning: + return nil + case ec2_types.InstanceStateNameTerminated, ec2_types.InstanceStateNameShuttingDown: + return backoff.Permanent(fmt.Errorf("instance terminated or shutting down")) + default: + return fmt.Errorf("instance not yet running, current state: %s", instance.State.Name) } } + + err := backoff.Retry(operation, backoff.WithContext(b, ctx)) + if err != nil { + return fmt.Errorf("timeout waiting for instance to reach running state: %w", err) + } + + l.Info("Instance is now running") return nil } -func (p *AWSProvider) ToCloudFormationTemplate( +func (p *AWSProvider) SetEC2Client(client aws_interface.EC2Clienter) { + p.EC2Client = client +} + +func (p *AWSProvider) GetEC2Client() aws_interface.EC2Clienter { + return p.EC2Client +} + +func (p *AWSProvider) GetPrimaryRegion() string { + return p.Config.Region +} + +func (p *AWSProvider) GetAccountID() string { + return p.AccountID +} + +func (p *AWSProvider) GetConfig() *aws.Config { + return p.Config +} + +// GetLatestUbuntuAMI returns the latest Ubuntu 22.04 LTS AMI ID for the specified architecture +// arch should be either "x86_64" or "arm64" +func (p *AWSProvider) GetLatestUbuntuAMI( ctx context.Context, - stackName string, -) (map[string]interface{}, error) { - svc := p.cloudFormationClient + loc string, + arch string, +) (string, error) { + c := p.GetEC2Client() - // Get the template from CloudFormation - input := &cloudformation.GetTemplateInput{ - StackName: aws.String(stackName), + input := &ec2.DescribeImagesInput{ + Filters: []ec2_types.Filter{ + { + Name: aws.String("name"), + Values: []string{"ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-*-server-*"}, + }, + { + Name: aws.String("architecture"), + Values: []string{arch}, + }, + { + Name: aws.String("virtualization-type"), + Values: []string{"hvm"}, + }, + { + Name: aws.String("state"), + Values: []string{"available"}, + }, + { + Name: aws.String("owner-id"), + Values: []string{"099720109477"}, // Canonical's AWS account ID + }, + }, } - result, err := svc.GetTemplate(ctx, input) + + result, err := c.DescribeImages(ctx, input) if err != nil { - return nil, fmt.Errorf("unable to get cloudformation template: %w", err) + return "", fmt.Errorf("failed to describe images: %w", err) + } + + if len(result.Images) == 0 { + return "", fmt.Errorf( + "no matching Ubuntu AMI found for location: '%s' and architecture: '%s'", + loc, arch, + ) + } + + // Sort images by creation date (newest first) + sort.Slice(result.Images, func(i, j int) bool { + iTime, _ := time.Parse(time.RFC3339, *result.Images[i].CreationDate) + jTime, _ := time.Parse(time.RFC3339, *result.Images[j].CreationDate) + return iTime.After(jTime) + }) + + // Return the ID of the newest image + return *result.Images[0].ImageId, nil +} + +// ListDeployments returns a list of all deployments across regions with the "andaime" tag +func (p *AWSProvider) ListDeployments(ctx context.Context) ([]DeploymentInfo, error) { + // Get list of all AWS regions + var cfg aws.Config + var err error + if p.Config != nil { + cfg = *p.Config + } else { + cfg, err = awsconfig.LoadDefaultConfig(ctx) + if err != nil { + return nil, fmt.Errorf("failed to load AWS configuration: %w", err) + } + } + + // Set the initial region if not set + if cfg.Region == "" { + cfg.Region = p.Config.Region } - // Deserialize the template body from JSON to map[string]interface{} - var template map[string]interface{} - err = json.Unmarshal([]byte(*result.TemplateBody), &template) + ec2Client := ec2.NewFromConfig(cfg) + regionsOutput, err := ec2Client.DescribeRegions(ctx, &ec2.DescribeRegionsInput{}) if err != nil { - return nil, fmt.Errorf("failed to unmarshal template body: %w", err) + return nil, fmt.Errorf("failed to list AWS regions: %w", err) + } + + var deployments []DeploymentInfo + g, ctx := errgroup.WithContext(ctx) + + // Query each region in parallel + for _, region := range regionsOutput.Regions { + region := region // Create new variable for goroutine + g.Go(func() error { + // Create regional client + regionalCfg := cfg.Copy() + regionalCfg.Region = *region.RegionName + regionalClient := ec2.NewFromConfig(regionalCfg) + + // Query VPCs with andaime tag + vpcOutput, err := regionalClient.DescribeVpcs(ctx, &ec2.DescribeVpcsInput{ + Filters: []ec2_types.Filter{ + { + Name: aws.String("tag-key"), + Values: []string{"andaime"}, + }, + }, + }) + if err != nil { + return fmt.Errorf("failed to list VPCs in region %s: %w", *region.RegionName, err) + } + + // Group VPCs by deployment ID (from tags) + deploymentVPCs := make(map[string][]ec2_types.Vpc) + for _, vpc := range vpcOutput.Vpcs { + var deploymentID string + for _, tag := range vpc.Tags { + if *tag.Key == "andaime-deployment-id" { + deploymentID = *tag.Value + break + } + } + if deploymentID != "" { + deploymentVPCs[deploymentID] = append(deploymentVPCs[deploymentID], vpc) + } + } + + // For each deployment, count instances + for deploymentID, vpcs := range deploymentVPCs { + // Get instance count for all VPCs in this deployment + var instanceCount int + for _, vpc := range vpcs { + instanceOutput, err := regionalClient.DescribeInstances( + ctx, + &ec2.DescribeInstancesInput{ + Filters: []ec2_types.Filter{ + { + Name: aws.String("vpc-id"), + Values: []string{*vpc.VpcId}, + }, + { + Name: aws.String("tag-key"), + Values: []string{"andaime"}, + }, + }, + }, + ) + if err != nil { + return fmt.Errorf("failed to list instances in VPC %s: %w", *vpc.VpcId, err) + } + + for _, reservation := range instanceOutput.Reservations { + instanceCount += len(reservation.Instances) + } + } + + // Create deployment info + info := DeploymentInfo{ + ID: deploymentID, + Region: *region.RegionName, + VPCCount: len(vpcs), + InstanceCount: instanceCount, + Tags: make(map[string]string), + } + + // Add any additional andaime-related tags from the first VPC + if len(vpcs) > 0 { + for _, tag := range vpcs[0].Tags { + if strings.HasPrefix(*tag.Key, "andaime-") { + info.Tags[*tag.Key] = *tag.Value + } + } + } + + deployments = append(deployments, info) + } + + return nil + }) + } + + if err := g.Wait(); err != nil { + return nil, err + } + + // Also check local config file for any deployments + configDeployments := viper.GetStringMap("aws.deployments") + for id := range configDeployments { + // Check if this deployment was already found in AWS + found := false + for _, d := range deployments { + if d.ID == id { + found = true + break + } + } + + if !found { + // Add deployment from config + deployments = append(deployments, DeploymentInfo{ + ID: id, + Region: viper.GetString(fmt.Sprintf("aws.deployments.%s.region", id)), + Tags: map[string]string{ + "andaime-source": "local-config", + }, + }) + } } - return template, nil + return deployments, nil } -func (p *AWSProvider) ProvisionBacalhauCluster(ctx context.Context) error { - if err := p.GetClusterDeployer().ProvisionBacalhauCluster(ctx); err != nil { - return err +// GetOrCreateVPCState gets or creates a VPC state for a region +func (rm *RegionalVPCManager) GetOrCreateVPCState(region string) *VPCState { + rm.mu.Lock() + defer rm.mu.Unlock() + + if state, exists := rm.states[region]; exists { + return state } - return nil + state := &VPCState{ + vpc: rm.deployment.AWS.RegionalResources.GetVPC(region), + lastUpdated: time.Now(), + } + rm.states[region] = state + return state } -func (p *AWSProvider) FinalizeDeployment(ctx context.Context) error { +// UpdateVPC atomically updates a VPC's state +func (rm *RegionalVPCManager) UpdateVPC(region string, updateFn func(*models.AWSVPC) error) error { + state := rm.GetOrCreateVPCState(region) + state.mu.Lock() + defer state.mu.Unlock() + + if state.vpc == nil { + state.vpc = &models.AWSVPC{} + rm.deployment.AWS.RegionalResources.SetVPC(region, state.vpc) + } + + if err := updateFn(state.vpc); err != nil { + return fmt.Errorf("failed to update VPC state: %w", err) + } + + state.lastUpdated = time.Now() return nil } -func (p *AWSProvider) SetEC2Client(client aws_interface.EC2Clienter) { - p.EC2Client = client +// SaveVPCConfig saves VPC configuration to viper +func (rm *RegionalVPCManager) SaveVPCConfig(region string) error { + state := rm.GetOrCreateVPCState(region) + state.mu.RLock() + defer state.mu.RUnlock() + + if state.vpc == nil { + return fmt.Errorf("no VPC found for region %s", region) + } + + deploymentPath := fmt.Sprintf("deployments.%s", rm.deployment.UniqueID) + viper.Set(fmt.Sprintf("%s.aws.regions.%s.vpc_id", deploymentPath, region), state.vpc.VPCID) + + return viper.WriteConfig() } diff --git a/pkg/providers/aws/provider_test.go b/pkg/providers/aws/provider_test.go index b4863fba..87443f72 100644 --- a/pkg/providers/aws/provider_test.go +++ b/pkg/providers/aws/provider_test.go @@ -1,240 +1,277 @@ -package awsprovider +package aws import ( "context" "testing" - "github.com/aws/aws-cdk-go/awscdk/v2" "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/aws-sdk-go-v2/service/cloudformation" - cdk_types "github.com/aws/aws-sdk-go-v2/service/cloudformation/types" "github.com/aws/aws-sdk-go-v2/service/ec2" "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/jsii-runtime-go" + "github.com/bacalhau-project/andaime/internal/testdata" "github.com/bacalhau-project/andaime/internal/testutil" - mocks "github.com/bacalhau-project/andaime/mocks/aws" + aws_mocks "github.com/bacalhau-project/andaime/mocks/aws" + ssh_mock "github.com/bacalhau-project/andaime/mocks/sshutils" + "github.com/bacalhau-project/andaime/pkg/display" + "github.com/bacalhau-project/andaime/pkg/logger" + "github.com/bacalhau-project/andaime/pkg/models" aws_interface "github.com/bacalhau-project/andaime/pkg/models/interfaces/aws" + sshutils_interface "github.com/bacalhau-project/andaime/pkg/models/interfaces/sshutils" + "github.com/bacalhau-project/andaime/pkg/sshutils" + pkg_testutil "github.com/bacalhau-project/andaime/pkg/testutil" "github.com/spf13/viper" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" ) -const FAKE_ACCOUNT_ID = "123456789012" -const FAKE_REGION = "burkina-faso-1" +const ( + FAKE_ACCOUNT_ID = "123456789012" + FAKE_REGION = "us-east-1" + FAKE_VPC_ID = "vpc-12345" + FAKE_SUBNET_ID = "subnet-12345" + FAKE_IGW_ID = "igw-12345" + FAKE_RTB_ID = "rtb-12345" + FAKE_INSTANCE_ID = "i-1234567890abcdef0" +) -func TestNewAWSProvider(t *testing.T) { - viper.Reset() - viper.Set("aws.region", FAKE_REGION) +type PkgProvidersAWSProviderSuite struct { + suite.Suite + ctx context.Context + origLogger *logger.Logger + testSSHPublicKeyPath string + testSSHPrivateKeyPath string + cleanupPublicKey func() + cleanupPrivateKey func() + mockAWSClient *aws_mocks.MockEC2Clienter + awsProvider *AWSProvider + origGetGlobalModelFunc func() *display.DisplayModel + origNewSSHConfigFunc func(string, int, string, string) (sshutils_interface.SSHConfiger, error) + mockSSHConfig *ssh_mock.MockSSHConfiger +} + +func (suite *PkgProvidersAWSProviderSuite) SetupSuite() { + suite.ctx = context.Background() + suite.testSSHPublicKeyPath, + suite.cleanupPublicKey, + suite.testSSHPrivateKeyPath, + suite.cleanupPrivateKey = testutil.CreateSSHPublicPrivateKeyPairOnDisk() + + suite.origGetGlobalModelFunc = display.GetGlobalModelFunc + display.GetGlobalModelFunc = func() *display.DisplayModel { + deployment, err := models.NewDeployment() + suite.Require().NoError(err) + return &display.DisplayModel{ + Deployment: deployment, + } + } + + suite.origLogger = logger.Get() + logger.SetGlobalLogger(logger.NewTestLogger(suite.T())) +} + +func (suite *PkgProvidersAWSProviderSuite) TearDownSuite() { + suite.cleanupPublicKey() + suite.cleanupPrivateKey() + display.GetGlobalModelFunc = suite.origGetGlobalModelFunc + sshutils.NewSSHConfigFunc = suite.origNewSSHConfigFunc + logger.SetGlobalLogger(suite.origLogger) +} + +func (suite *PkgProvidersAWSProviderSuite) SetupTest() { + // Initialize viper configuration + viper, err := pkg_testutil.InitializeTestViper(testdata.TestAWSConfig) + require.NoError(suite.T(), err) viper.Set("aws.account_id", FAKE_ACCOUNT_ID) - accountID := viper.GetString("aws.account_id") - region := viper.GetString("aws.region") - provider, err := NewAWSProvider(accountID, region) - assert.NoError(t, err) - assert.NotNil(t, provider) - assert.NotNil(t, provider.App) - assert.Equal(t, region, provider.Region) + // Create a properly initialized deployment model + deployment, err := models.NewDeployment() + require.NoError(suite.T(), err) + + // Initialize AWS deployment structure + deployment.AWS = &models.AWSDeployment{ + RegionalResources: &models.RegionalResources{ + VPCs: make(map[string]*models.AWSVPC), + Clients: make(map[string]aws_interface.EC2Clienter), + }, + } + + // Set up the global model function + display.GetGlobalModelFunc = func() *display.DisplayModel { + return &display.DisplayModel{ + Deployment: deployment, + } + } + + // Create a properly initialized AWS provider + provider, err := NewAWSProviderFunc(FAKE_ACCOUNT_ID) + require.NoError(suite.T(), err) + + // Set the mock client and ensure it's used for all regions + suite.mockAWSClient = new(aws_mocks.MockEC2Clienter) + provider.SetEC2Client(suite.mockAWSClient) + + // Pre-initialize VPC manager with the deployment + provider.vpcManager = NewRegionalVPCManager(deployment, suite.mockAWSClient) + + // Initialize regional resources for the test region + deployment.AWS.RegionalResources.VPCs[FAKE_REGION] = &models.AWSVPC{ + VPCID: FAKE_VPC_ID, + } + deployment.AWS.RegionalResources.Clients[FAKE_REGION] = suite.mockAWSClient + + // Mock all AWS API calls + suite.setupAWSMocks() + + // Setup SSH config mock + suite.mockSSHConfig = new(ssh_mock.MockSSHConfiger) + suite.origNewSSHConfigFunc = sshutils.NewSSHConfigFunc + sshutils.NewSSHConfigFunc = func(host string, + port int, + user string, + sshPrivateKeyPath string) (sshutils_interface.SSHConfiger, error) { + return suite.mockSSHConfig, nil + } + + suite.awsProvider = provider } -func TestCreateInfrastructure(t *testing.T) { - // Store the original function to restore it after the test - originalNewClient := NewCloudFormationClientFunc - defer func() { NewCloudFormationClientFunc = originalNewClient }() - - // mockTemplate := `{ - // "Resources": { - // "AndaimeVPC": { - // "Type": "AWS::EC2::VPC", - // "Properties": { - // "CidrBlock": "10.0.0.0/16", - // "EnableDnsHostnames": true, - // "EnableDnsSupport": true - // } - // } - // }, - // "Outputs": { - // "VpcId": { - // "Value": { "Ref": "AndaimeVPC" } - // } - // } - // }` - - mockCloudFormationAPI := new(mocks.MockCloudFormationAPIer) - - // Mock CreateStack - mockCloudFormationAPI.On("CreateStack", mock.Anything, mock.Anything). - Return(&cloudformation.CreateStackOutput{ - StackId: aws.String("test-stack-id"), +func (suite *PkgProvidersAWSProviderSuite) setupAWSMocks() { + // Mock DescribeRegions + suite.mockAWSClient.On("DescribeRegions", mock.Anything, mock.Anything). + Return(&ec2.DescribeRegionsOutput{ + Regions: []types.Region{ + {RegionName: aws.String(FAKE_REGION)}, + }, + }, nil) + + // Mock availability zones + suite.mockAWSClient.On("DescribeAvailabilityZones", mock.Anything, mock.Anything). + Return(&ec2.DescribeAvailabilityZonesOutput{ + AvailabilityZones: []types.AvailabilityZone{ + {ZoneName: aws.String("FAKE-ZONE-1")}, + {ZoneName: aws.String("FAKE-ZONE-2")}, + }, + }, nil) + + // Mock VPC-related operations + suite.mockAWSClient.On("CreateVpc", mock.Anything, mock.Anything). + Return(&ec2.CreateVpcOutput{ + Vpc: &types.Vpc{VpcId: aws.String(FAKE_VPC_ID)}, }, nil) - // Mock DescribeStacks for the waiter - mockCloudFormationAPI.On("DescribeStacks", mock.Anything, mock.Anything, mock.Anything). - Return(&cloudformation.DescribeStacksOutput{ - Stacks: []cdk_types.Stack{ + suite.mockAWSClient.On("DescribeVpcs", mock.Anything, mock.Anything). + Return(&ec2.DescribeVpcsOutput{ + Vpcs: []types.Vpc{ { - StackName: aws.String("AndaimeStack"), - StackId: aws.String("test-stack-id"), - StackStatus: cdk_types.StackStatusCreateComplete, + VpcId: aws.String(FAKE_VPC_ID), + State: types.VpcStateAvailable, }, }, }, nil) - // Mock GetTemplate - // mockCloudFormationAPI.On("GetTemplate", mock.Anything, mock.Anything). - // Return(&cloudformation.GetTemplateOutput{TemplateBody: aws.String(mockTemplate)}, nil) + suite.mockAWSClient.On("ModifyVpcAttribute", mock.Anything, mock.Anything). + Return(&ec2.ModifyVpcAttributeOutput{}, nil) - NewCloudFormationClientFunc = func(cfg aws.Config) aws_interface.CloudFormationAPIer { - return mockCloudFormationAPI - } + // Mock networking components + suite.mockAWSClient.On("CreateSubnet", mock.Anything, mock.Anything). + Return(&ec2.CreateSubnetOutput{ + Subnet: &types.Subnet{SubnetId: aws.String(FAKE_SUBNET_ID)}, + }, nil) - // Test setup - viper.Reset() - viper.Set("aws.region", "us-west-2") - viper.Set("aws.account_id", "123456789012") + suite.mockAWSClient.On("CreateInternetGateway", mock.Anything, mock.Anything). + Return(&ec2.CreateInternetGatewayOutput{ + InternetGateway: &types.InternetGateway{ + InternetGatewayId: aws.String(FAKE_IGW_ID), + }, + }, nil) - accountID := viper.GetString("aws.account_id") - region := viper.GetString("aws.region") - provider, err := NewAWSProvider(accountID, region) - require.NoError(t, err) + suite.mockAWSClient.On("CreateRouteTable", mock.Anything, mock.Anything). + Return(&ec2.CreateRouteTableOutput{ + RouteTable: &types.RouteTable{RouteTableId: aws.String(FAKE_RTB_ID)}, + }, nil) - ctx := context.Background() - err = provider.CreateInfrastructure(ctx) - assert.NoError(t, err) + // Mock security group operations + suite.mockAWSClient.On("CreateSecurityGroup", mock.Anything, mock.Anything). + Return(&ec2.CreateSecurityGroupOutput{ + GroupId: aws.String("sg-12345"), + }, nil) - // Verify the infrastructure was created - assert.NotNil(t, provider.Stack) - assert.NotNil(t, provider.VPC) + suite.mockAWSClient.On("AuthorizeSecurityGroupIngress", mock.Anything, mock.Anything). + Return(&ec2.AuthorizeSecurityGroupIngressOutput{}, nil) + + // Mock network setup operations with logging + suite.mockAWSClient.On("AttachInternetGateway", mock.Anything, mock.Anything). + Run(func(args mock.Arguments) { + input := args.Get(1).(*ec2.AttachInternetGatewayInput) + logger.Get().Debugf("Attaching Internet Gateway %s to VPC %s", + *input.InternetGatewayId, *input.VpcId) + }). + Return(&ec2.AttachInternetGatewayOutput{}, nil) + + suite.mockAWSClient.On("CreateRoute", mock.Anything, mock.Anything). + Run(func(args mock.Arguments) { + input := args.Get(1).(*ec2.CreateRouteInput) + logger.Get().Debugf("Creating route in route table %s with destination %s via IGW %s", + *input.RouteTableId, *input.DestinationCidrBlock, *input.GatewayId) + }). + Return(&ec2.CreateRouteOutput{}, nil) + + suite.mockAWSClient.On("AssociateRouteTable", mock.Anything, mock.Anything). + Run(func(args mock.Arguments) { + input := args.Get(1).(*ec2.AssociateRouteTableInput) + logger.Get().Debugf("Associating route table %s with subnet %s", + *input.RouteTableId, *input.SubnetId) + }). + Return(&ec2.AssociateRouteTableOutput{}, nil) +} - // Verify all mocked calls were made - mockCloudFormationAPI.AssertExpectations(t) +func (suite *PkgProvidersAWSProviderSuite) TestNewAWSProvider() { + provider, err := NewAWSProviderFunc(FAKE_ACCOUNT_ID) + suite.Require().NoError(err) + suite.Require().NotNil(provider) } -func TestNewVpcStack(t *testing.T) { - ctx := context.Background() - - // Store the original function to restore it after the test - originalNewClient := NewCloudFormationClientFunc - defer func() { NewCloudFormationClientFunc = originalNewClient }() - - mockTemplate := &cloudformation.GetTemplateOutput{ - TemplateBody: aws.String(`{ - "Resources": { - "AndaimeVPC": { - "Type": "AWS::EC2::VPC", - "Properties": { - "CidrBlock": "10.0.0.0/16", - "EnableDnsHostnames": true, - "EnableDnsSupport": true - } - }, - "AndaimeVPCPublicSubnet1": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "VpcId": { "Ref": "AndaimeVPC" }, - "AvailabilityZone": "us-west-2a", - "CidrBlock": "10.0.0.0/24", - "MapPublicIpOnLaunch": true - } - }, - "AndaimeVPCPrivateSubnet1": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "VpcId": { "Ref": "AndaimeVPC" }, - "AvailabilityZone": "us-west-2a", - "CidrBlock": "10.0.1.0/24", - "MapPublicIpOnLaunch": false - } - } - }, - "Outputs": { - "VpcId": { - "Value": { "Ref": "AndaimeVPC" } - }, - "PublicSubnet1Id": { - "Value": { "Ref": "AndaimeVPCPublicSubnet1" } - }, - "PrivateSubnet1Id": { - "Value": { "Ref": "AndaimeVPCPrivateSubnet1" } - } - } - }`), - } +func (suite *PkgProvidersAWSProviderSuite) TestCreateInfrastructure() { + l := logger.Get() - mockCloudFormationAPI := new(mocks.MockCloudFormationAPIer) - mockCloudFormationAPI.On("GetTemplate", mock.Anything, mock.Anything). - Return(mockTemplate, nil) - mockCloudFormationAPI.On("CreateStack", mock.Anything, mock.Anything). - Return(&cloudformation.CreateStackOutput{}, nil) + // Add debug logging + l.Info("Starting TestCreateInfrastructure") - NewCloudFormationClientFunc = func(cfg aws.Config) aws_interface.CloudFormationAPIer { - return mockCloudFormationAPI + // Check initial state + m := display.GetGlobalModelFunc() + if m != nil && m.Deployment != nil { + l.Debugf("Initial deployment state: %+v", m.Deployment.AWS) + if m.Deployment.AWS.RegionalResources != nil { + l.Debugf("VPCs: %+v", m.Deployment.AWS.RegionalResources.VPCs) + } } - app := awscdk.NewApp(nil) - stackProps := &awscdk.StackProps{ - Env: &awscdk.Environment{ - Region: jsii.String("us-west-2"), - }, + err := suite.awsProvider.CreateInfrastructure(suite.ctx) + if err != nil { + l.Debugf("CreateInfrastructure error: %v", err) + // Print the state after error + if m != nil && m.Deployment != nil && m.Deployment.AWS != nil { + l.Debugf("Final deployment state: %+v", m.Deployment.AWS) + if m.Deployment.AWS.RegionalResources != nil { + l.Debugf("VPCs: %+v", m.Deployment.AWS.RegionalResources.VPCs) + } + } } - - provider, err := NewAWSProvider(FAKE_ACCOUNT_ID, FAKE_REGION) - require.NoError(t, err) - - stack := NewVpcStack(app, "TestStack", stackProps) - assert.NotNil(t, stack) - - provider.Stack = stack - - // Verify the VPC was created with correct configuration - template, err := provider.ToCloudFormationTemplate(ctx, *provider.Stack.StackName()) - require.NoError(t, err) - resources := template["Resources"].(map[string]interface{}) - - // Verify VPC configuration - assert.Contains(t, resources, "AndaimeVPC") - vpcResource := resources["AndaimeVPC"].(map[string]interface{}) - assert.Equal(t, "AWS::EC2::VPC", vpcResource["Type"]) - - // Verify subnet configuration - assert.Contains(t, resources, "AndaimeVPCPublicSubnet1") - assert.Contains(t, resources, "AndaimeVPCPrivateSubnet1") - - publicSubnet := resources["AndaimeVPCPublicSubnet1"].(map[string]interface{}) - assert.Equal(t, "AWS::EC2::Subnet", publicSubnet["Type"]) - assert.True( - t, - publicSubnet["Properties"].(map[string]interface{})["MapPublicIpOnLaunch"].(bool), - ) - - privateSubnet := resources["AndaimeVPCPrivateSubnet1"].(map[string]interface{}) - assert.Equal(t, "AWS::EC2::Subnet", privateSubnet["Type"]) - assert.False( - t, - privateSubnet["Properties"].(map[string]interface{})["MapPublicIpOnLaunch"].(bool), - ) - - // Verify outputs - outputs := template["Outputs"].(map[string]interface{}) - assert.Contains(t, outputs, "VpcId") - assert.Contains(t, outputs, "PublicSubnet1Id") - assert.Contains(t, outputs, "PrivateSubnet1Id") + suite.Require().NoError(err) } -func TestProcessMachinesConfig(t *testing.T) { - testSSHPublicKeyPath, - cleanupPublicKey, - testSSHPrivateKeyPath, - cleanupPrivateKey := testutil.CreateSSHPublicPrivateKeyPairOnDisk() - defer cleanupPublicKey() - defer cleanupPrivateKey() +func (suite *PkgProvidersAWSProviderSuite) TestCreateVpc() { + err := suite.awsProvider.CreateVpc(suite.ctx, FAKE_REGION) + suite.Require().NoError(err) +} +func (suite *PkgProvidersAWSProviderSuite) TestProcessMachinesConfig() { viper.Reset() viper.Set("aws.default_count_per_zone", 1) viper.Set("aws.default_machine_type", "t3.micro") viper.Set("aws.default_disk_size_gb", 10) - viper.Set("general.ssh_private_key_path", testSSHPrivateKeyPath) - viper.Set("general.ssh_public_key_path", testSSHPublicKeyPath) + viper.Set("general.ssh_private_key_path", suite.testSSHPrivateKeyPath) + viper.Set("general.ssh_public_key_path", suite.testSSHPublicKeyPath) viper.Set("aws.machines", []map[string]interface{}{ { "location": "us-west-2", @@ -246,169 +283,29 @@ func TestProcessMachinesConfig(t *testing.T) { }, }) - provider, err := NewAWSProvider(FAKE_ACCOUNT_ID, FAKE_REGION) - require.NoError(t, err) - - ctx := context.Background() - machines, locations, err := provider.ProcessMachinesConfig(ctx) - - assert.NoError(t, err) - assert.Len(t, machines, 1) - assert.Contains(t, locations, "us-west-2") -} - -func TestStartResourcePolling(t *testing.T) { - viper.Reset() - viper.Set("aws.account_id", FAKE_ACCOUNT_ID) - viper.Set("aws.region", FAKE_REGION) - - provider, err := NewAWSProvider(FAKE_ACCOUNT_ID, FAKE_REGION) - require.NoError(t, err) - - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - err = provider.StartResourcePolling(ctx) - assert.NoError(t, err) + machines, locations, err := suite.awsProvider.ProcessMachinesConfig(suite.ctx) + suite.Require().NoError(err) + suite.Require().Len(machines, 1) + suite.Require().Contains(locations, "us-west-2") } -func TestValidateMachineType(t *testing.T) { - viper.Reset() - viper.Set("aws.region", FAKE_REGION) - viper.Set("aws.account_id", FAKE_ACCOUNT_ID) - - provider, err := NewAWSProvider(FAKE_ACCOUNT_ID, FAKE_REGION) - require.NoError(t, err) - - ctx := context.Background() - - testCases := []struct { - name string - location string - instanceType string - expectValid bool - }{ - { - name: "valid instance type", - location: "us-west-2", - instanceType: "t3.micro", - expectValid: true, - }, - { - name: "invalid location", - location: "invalid-region", - instanceType: "t3.micro", - expectValid: false, - }, - { - name: "invalid instance type", - location: "us-west-2", - instanceType: "invalid-type", - expectValid: false, - }, - } - - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - valid, err := provider.ValidateMachineType(ctx, tc.location, tc.instanceType) - if tc.expectValid { - assert.NoError(t, err) - assert.True(t, valid) - } else { - assert.Error(t, err) - assert.False(t, valid) - } - }) - } -} - -func TestGetVMExternalIP(t *testing.T) { - // Create a mock EC2 client - mockEC2Client := &mocks.MockEC2Clienter{} - - // Set up the expected call to DescribeInstances - mockEC2Client.On("DescribeInstances", mock.Anything, &ec2.DescribeInstancesInput{ - InstanceIds: []string{"i-1234567890abcdef0"}, +func (suite *PkgProvidersAWSProviderSuite) TestGetVMExternalIP() { + suite.mockAWSClient.On("DescribeInstances", mock.Anything, &ec2.DescribeInstancesInput{ + InstanceIds: []string{FAKE_INSTANCE_ID}, }).Return(&ec2.DescribeInstancesOutput{ - Reservations: []types.Reservation{ - { - Instances: []types.Instance{ - { - InstanceId: aws.String("i-1234567890abcdef0"), - PublicIpAddress: aws.String("203.0.113.1"), - }, - }, - }, - }, + Reservations: []types.Reservation{{ + Instances: []types.Instance{{ + InstanceId: aws.String(FAKE_INSTANCE_ID), + PublicIpAddress: aws.String("203.0.113.1"), + }}, + }}, }, nil) - // Create a provider with the mock EC2 client - provider := &AWSProvider{ - Region: "us-west-2", - Config: &aws.Config{}, - } - provider.SetEC2Client(mockEC2Client) - - // Call the method - ctx := context.Background() - ip, err := provider.GetVMExternalIP(ctx, "i-1234567890abcdef0") - - // Assert the results - assert.NoError(t, err) - assert.Equal(t, "203.0.113.1", ip) - - // Verify that the mock was called as expected - mockEC2Client.AssertExpectations(t) + ip, err := suite.awsProvider.GetVMExternalIP(suite.ctx, FAKE_INSTANCE_ID) + suite.Require().NoError(err) + suite.Require().Equal("203.0.113.1", ip) } -func TestCreateInfrastructure_Failure(t *testing.T) { - // Create a mock CloudFormation client - mockCfnClient := new(mocks.MockCloudFormationAPIer) - - // Set up CreateStack to succeed - mockCfnClient.On("CreateStack", mock.Anything, mock.AnythingOfType("*cloudformation.CreateStackInput")). - Return(&cloudformation.CreateStackOutput{}, nil) - - // Set up DescribeStacks to return a failure status - mockCfnClient.On("DescribeStacks", mock.Anything, - mock.AnythingOfType("*cloudformation.DescribeStacksInput"), - mock.Anything). - Return(&cloudformation.DescribeStacksOutput{ - Stacks: []cdk_types.Stack{ - { - StackStatus: cdk_types.StackStatusCreateFailed, - }, - }, - }, nil) - - // Set up DescribeStackEvents for error reporting - mockCfnClient.On("DescribeStackEvents", mock.Anything, mock.AnythingOfType("*cloudformation.DescribeStackEventsInput")). - Return(&cloudformation.DescribeStackEventsOutput{ - StackEvents: []cdk_types.StackEvent{ - { - LogicalResourceId: aws.String("TestResource"), - ResourceStatus: cdk_types.ResourceStatusCreateFailed, - ResourceStatusReason: aws.String("Test failure reason"), - }, - }, - }, nil) - - // Create the provider with the mock client - provider, err := NewAWSProvider(FAKE_ACCOUNT_ID, FAKE_REGION) - require.NoError(t, err) - - // Override the CloudFormation client creation - NewCloudFormationClientFunc = func(cfg aws.Config) aws_interface.CloudFormationAPIer { - return mockCfnClient - } - - // Call CreateInfrastructure - err = provider.CreateInfrastructure(context.Background()) - - // Assert an error occurred - assert.Error(t, err) - assert.Contains(t, err.Error(), "infrastructure stack creation failed") - - // Verify all expected calls were made - mockCfnClient.AssertExpectations(t) +func TestPkgProvidersAWSProviderSuite(t *testing.T) { + suite.Run(t, new(PkgProvidersAWSProviderSuite)) } diff --git a/pkg/providers/aws/spot_instances.go b/pkg/providers/aws/spot_instances.go index b6b6ff0c..1033083d 100644 --- a/pkg/providers/aws/spot_instances.go +++ b/pkg/providers/aws/spot_instances.go @@ -1,4 +1,4 @@ -package awsprovider +package aws import ( "context" @@ -84,7 +84,11 @@ func ensureKeyPairExists(ctx context.Context, client *ec2.Client, keyPairName st } // createVPCIfNotExists creates a new VPC if one with the specified tag doesn't exist -func createVPCIfNotExists(ctx context.Context, client *ec2.Client, config SpotInstanceConfig) (string, error) { +func createVPCIfNotExists( + ctx context.Context, + client *ec2.Client, + config SpotInstanceConfig, +) (string, error) { // Check if a VPC with the specified tag already exists describeVPCsOutput, err := client.DescribeVpcs(ctx, &ec2.DescribeVpcsInput{ Filters: []types.Filter{ @@ -102,7 +106,12 @@ func createVPCIfNotExists(ctx context.Context, client *ec2.Client, config SpotIn if len(describeVPCsOutput.Vpcs) > 0 { // VPC already exists vpcID := *describeVPCsOutput.Vpcs[0].VpcId - log.Printf("VPC with tag %s:%s already exists: %s", config.VPCTagKey, config.VPCTagValue, vpcID) + log.Printf( + "VPC with tag %s:%s already exists: %s", + config.VPCTagKey, + config.VPCTagValue, + vpcID, + ) return vpcID, nil } diff --git a/pkg/providers/aws/types.go b/pkg/providers/aws/types.go index 11e6c3cd..95790023 100644 --- a/pkg/providers/aws/types.go +++ b/pkg/providers/aws/types.go @@ -1,5 +1,5 @@ //nolint:lll -package awsprovider +package aws import ( "context" @@ -10,6 +10,7 @@ import ( const ( EC2InstanceType = "EC2" SpotInstanceType = "Spot" + DefaultName = "default" ) type EC2Clienter interface { @@ -28,8 +29,11 @@ type EC2Clienter interface { params *ec2.CreateSubnetInput, optFns ...func(*ec2.Options), ) (*ec2.CreateSubnetOutput, error) - //CreateSecurityGroup(ctx context.Context, params *ec2.CreateSecurityGroupInput, optFns ...func(*ec2.Options)) (*ec2.CreateSecurityGroupOutput, error) - //AuthorizeSecurityGroupIngress(ctx context.Context, params *ec2.AuthorizeSecurityGroupIngressInput, optFns ...func(*ec2.Options)) (*ec2.AuthorizeSecurityGroupIngressOutput, error) + CreateSecurityGroup( + ctx context.Context, + params *ec2.CreateSecurityGroupInput, + optFns ...func(*ec2.Options), + ) (*ec2.CreateSecurityGroupOutput, error) RunInstances( ctx context.Context, params *ec2.RunInstancesInput, @@ -75,4 +79,39 @@ type EC2Clienter interface { params *ec2.DeleteVpcInput, optFns ...func(*ec2.Options), ) (*ec2.DeleteVpcOutput, error) + CreateInternetGateway( + ctx context.Context, + params *ec2.CreateInternetGatewayInput, + optFns ...func(*ec2.Options), + ) (*ec2.CreateInternetGatewayOutput, error) + AttachInternetGateway( + ctx context.Context, + params *ec2.AttachInternetGatewayInput, + optFns ...func(*ec2.Options), + ) (*ec2.AttachInternetGatewayOutput, error) + CreateRouteTable( + ctx context.Context, + params *ec2.CreateRouteTableInput, + optFns ...func(*ec2.Options), + ) (*ec2.CreateRouteTableOutput, error) + CreateRoute( + ctx context.Context, + params *ec2.CreateRouteInput, + optFns ...func(*ec2.Options), + ) (*ec2.CreateRouteOutput, error) + AssociateRouteTable( + ctx context.Context, + params *ec2.AssociateRouteTableInput, + optFns ...func(*ec2.Options), + ) (*ec2.AssociateRouteTableOutput, error) + DescribeRouteTables( + ctx context.Context, + params *ec2.DescribeRouteTablesInput, + optFns ...func(*ec2.Options), + ) (*ec2.DescribeRouteTablesOutput, error) + ModifyVpcAttribute( + ctx context.Context, + params *ec2.ModifyVpcAttributeInput, + optFns ...func(*ec2.Options), + ) (*ec2.ModifyVpcAttributeOutput, error) } diff --git a/pkg/providers/aws/utils.go b/pkg/providers/aws/utils.go index db569600..0f692096 100644 --- a/pkg/providers/aws/utils.go +++ b/pkg/providers/aws/utils.go @@ -1,4 +1,4 @@ -package awsprovider +package aws import ( "fmt" @@ -10,11 +10,8 @@ import ( ) func (p *AWSProvider) GetAllAWSRegions(ctx context.Context) ([]string, error) { - // Create an EC2 client with the provider's configuration. - ec2Client := ec2.NewFromConfig(*p.Config) - - // Call DescribeRegions to get the list of regions. - output, err := ec2Client.DescribeRegions(ctx, &ec2.DescribeRegionsInput{ + // Use the provider's EC2Client which can be mocked in tests + output, err := p.EC2Client.DescribeRegions(ctx, &ec2.DescribeRegionsInput{ AllRegions: aws.Bool(true), }) if err != nil { diff --git a/pkg/providers/azure/client_mock.go b/pkg/providers/azure/client_mock.go deleted file mode 100644 index ff48516d..00000000 --- a/pkg/providers/azure/client_mock.go +++ /dev/null @@ -1,152 +0,0 @@ -package azure - -// type MockAzureClient struct { -// mock.Mock -// } - -// func NewMockAzureClient() *MockAzureClient { -// return new(MockAzureClient) -// } - -// func (m *MockAzureClient) DeployTemplate( -// ctx context.Context, -// resourceGroupName string, -// deploymentName string, -// template map[string]interface{}, -// parameters map[string]interface{}, -// tags map[string]*string, -// ) (Pollerer, error) { -// args := m.Called(ctx, resourceGroupName, deploymentName, template, parameters, tags) -// return args.Get(0).(Pollerer), args.Error(1) -// } - -// func (m *MockAzureClient) DestroyResourceGroup( -// ctx context.Context, -// resourceGroupName string, -// ) error { -// args := m.Called(ctx, resourceGroupName) -// return args.Error(0) -// } - -// func (m *MockAzureClient) ListAllResourcesInSubscription( -// ctx context.Context, -// subscriptionID string, -// tags map[string]*string, -// ) ([]interface{}, error) { -// args := m.Called(ctx, subscriptionID, tags) -// return args.Get(0).([]interface{}), args.Error(1) -// } - -// func (m *MockAzureClient) ListAvailableSkus( -// ctx context.Context, -// location string, -// ) ([]string, error) { -// args := m.Called(ctx, location) -// return args.Get(0).([]string), args.Error(1) -// } - -// func (m *MockAzureClient) ValidateMachineType( -// ctx context.Context, -// location, machineType string, -// ) (bool, error) { -// args := m.Called(ctx, location, machineType) -// return args.Bool(0), args.Error(1) -// } - -// func (m *MockAzureClient) GetResourceGroup( -// ctx context.Context, -// resourceGroupName string, -// location string, -// ) (*armresources.ResourceGroup, error) { -// args := m.Called(ctx, resourceGroupName, location) -// return args.Get(0).(*armresources.ResourceGroup), args.Error(1) -// } - -// func (m *MockAzureClient) GetDeploymentsClient() *armresources.DeploymentsClient { -// return m.Called().Get(0).(*armresources.DeploymentsClient) -// } - -// func (m *MockAzureClient) GetNetworkInterface( -// ctx context.Context, -// resourceGroupName, networkInterfaceName string, -// ) (*armnetwork.Interface, error) { -// args := m.Called(ctx, resourceGroupName, networkInterfaceName) -// return args.Get(0).(*armnetwork.Interface), args.Error(1) -// } - -// func (m *MockAzureClient) GetOrCreateResourceGroup( -// ctx context.Context, -// resourceGroupName string, -// location string, -// tags map[string]string, -// ) (*armresources.ResourceGroup, error) { -// args := m.Called(ctx, resourceGroupName, location, tags) -// return args.Get(0).(*armresources.ResourceGroup), args.Error(1) -// } - -// func (m *MockAzureClient) GetPublicIPAddress( -// ctx context.Context, -// resourceGroupName string, -// publicIPAddress *armnetwork.PublicIPAddress, -// ) (string, error) { -// args := m.Called(ctx, resourceGroupName, publicIPAddress) -// return args.Get(0).(string), args.Error(1) -// } - -// func (m *MockAzureClient) GetResources( -// ctx context.Context, -// resourceGroupName string, -// resourceType string, -// tags map[string]*string, -// ) ([]interface{}, error) { -// args := m.Called(ctx, resourceGroupName, resourceType, tags) -// return args.Get(0).([]interface{}), args.Error(1) -// } - -// func (m *MockAzureClient) GetSKUsByLocation( -// ctx context.Context, -// location string, -// ) ([]armcompute.ResourceSKU, error) { -// args := m.Called(ctx, location) -// return args.Get(0).([]armcompute.ResourceSKU), args.Error(1) -// } - -// func (m *MockAzureClient) GetVirtualMachine( -// ctx context.Context, -// resourceGroupName string, -// vmName string, -// ) (*armcompute.VirtualMachine, error) { -// args := m.Called(ctx, resourceGroupName, vmName) -// return args.Get(0).(*armcompute.VirtualMachine), args.Error(1) -// } - -// func (m *MockAzureClient) ListAllResourceGroups( -// ctx context.Context, -// ) ([]*armresources.ResourceGroup, error) { -// args := m.Called(ctx) -// return args.Get(0).([]*armresources.ResourceGroup), args.Error(1) -// } - -// func (m *MockAzureClient) NewSubscriptionListPager( -// ctx context.Context, -// opts *armsubscription.SubscriptionsClientListOptions, -// ) *runtime.Pager[armsubscription.SubscriptionsClientListResponse] { -// return m.Called(ctx).Get(0).(*runtime.Pager[armsubscription.SubscriptionsClientListResponse]) -// } - -// func (m *MockAzureClient) ResourceGroupExists( -// ctx context.Context, -// resourceGroupName string, -// ) (bool, error) { -// args := m.Called(ctx, resourceGroupName) -// return args.Bool(0), args.Error(1) -// } - -// func (m *MockAzureClient) GetVMExternalIP( -// ctx context.Context, -// vmName string, -// locationData map[string]string, -// ) (string, error) { -// args := m.Called(ctx, vmName, locationData) -// return args.Get(0).(string), args.Error(1) -// } diff --git a/pkg/providers/azure/create_resource_test.go b/pkg/providers/azure/create_resource_test.go index 9fac8ef3..2c338ded 100644 --- a/pkg/providers/azure/create_resource_test.go +++ b/pkg/providers/azure/create_resource_test.go @@ -9,9 +9,11 @@ import ( "github.com/bacalhau-project/andaime/internal/testdata" "github.com/bacalhau-project/andaime/internal/testutil" azure_mocks "github.com/bacalhau-project/andaime/mocks/azure" + ssh_mock "github.com/bacalhau-project/andaime/mocks/sshutils" "github.com/bacalhau-project/andaime/pkg/display" "github.com/bacalhau-project/andaime/pkg/logger" "github.com/bacalhau-project/andaime/pkg/models" + sshutils_interface "github.com/bacalhau-project/andaime/pkg/models/interfaces/sshutils" "github.com/bacalhau-project/andaime/pkg/sshutils" pkg_testutil "github.com/bacalhau-project/andaime/pkg/testutil" "github.com/spf13/viper" @@ -30,8 +32,9 @@ type PkgProvidersAzureCreateResourceTestSuite struct { mockAzureClient *azure_mocks.MockAzureClienter azureProvider *AzureProvider origGetGlobalModelFunc func() *display.DisplayModel - origNewSSHConfigFunc func(string, int, string, string) (sshutils.SSHConfiger, error) - mockSSHConfig *sshutils.MockSSHConfig + origNewSSHConfigFunc func(string, int, string, string) (sshutils_interface.SSHConfiger, error) + mockSSHConfig *ssh_mock.MockSSHConfiger + deployment *models.Deployment // Add deployment as suite field } func (suite *PkgProvidersAzureCreateResourceTestSuite) SetupSuite() { @@ -41,19 +44,9 @@ func (suite *PkgProvidersAzureCreateResourceTestSuite) SetupSuite() { suite.testSSHPrivateKeyPath, suite.cleanupPrivateKey = testutil.CreateSSHPublicPrivateKeyPairOnDisk() - suite.mockAzureClient = new(azure_mocks.MockAzureClienter) suite.origGetGlobalModelFunc = display.GetGlobalModelFunc - display.GetGlobalModelFunc = func() *display.DisplayModel { - deployment, err := models.NewDeployment() - suite.Require().NoError(err) - return &display.DisplayModel{ - Deployment: deployment, - } - } - - suite.origLogger = logger.Get() // Save the original logger - testLogger := logger.NewTestLogger(suite.T()) - logger.SetGlobalLogger(testLogger) + suite.origLogger = logger.Get() + suite.origNewSSHConfigFunc = sshutils.NewSSHConfigFunc } func (suite *PkgProvidersAzureCreateResourceTestSuite) TearDownSuite() { @@ -61,23 +54,51 @@ func (suite *PkgProvidersAzureCreateResourceTestSuite) TearDownSuite() { suite.cleanupPrivateKey() display.GetGlobalModelFunc = suite.origGetGlobalModelFunc sshutils.NewSSHConfigFunc = suite.origNewSSHConfigFunc + logger.SetGlobalLogger(suite.origLogger) } func (suite *PkgProvidersAzureCreateResourceTestSuite) SetupTest() { + // Reset everything for each test viper.Reset() pkg_testutil.SetupViper(models.DeploymentTypeAzure, suite.testSSHPublicKeyPath, suite.testSSHPrivateKeyPath, ) + // Create fresh mocks for each test + suite.mockAzureClient = new(azure_mocks.MockAzureClienter) + suite.mockSSHConfig = new(ssh_mock.MockSSHConfiger) + + // Create fresh provider for each test suite.azureProvider = &AzureProvider{} suite.azureProvider.SetAzureClient(suite.mockAzureClient) - suite.mockSSHConfig = new(sshutils.MockSSHConfig) - suite.origNewSSHConfigFunc = sshutils.NewSSHConfigFunc - sshutils.NewSSHConfigFunc = func(host string, port int, user string, sshPrivateKeyPath string) (sshutils.SSHConfiger, error) { + // Create fresh deployment for each test + suite.deployment = &models.Deployment{ + Machines: make(map[string]models.Machiner), + Azure: &models.AzureConfig{ + ResourceGroupName: "test-rg-name", + }, + SSHPublicKeyMaterial: "PUBLIC KEY MATERIAL", + } + + // Set up fresh global model function for each test + display.GetGlobalModelFunc = func() *display.DisplayModel { + return &display.DisplayModel{ + Deployment: suite.deployment, + } + } + + // Set up fresh SSH config function for each test + sshutils.NewSSHConfigFunc = func(host string, + port int, + user string, + sshPrivateKeyPath string) (sshutils_interface.SSHConfiger, error) { return suite.mockSSHConfig, nil } + + // Set up fresh logger for each test + logger.SetGlobalLogger(logger.NewTestLogger(suite.T())) } func (suite *PkgProvidersAzureCreateResourceTestSuite) TestCreateResources() { @@ -105,7 +126,7 @@ func (suite *PkgProvidersAzureCreateResourceTestSuite) TestCreateResources() { { name: "Failure - Deploy Machine Error", locations: []string{"eastus"}, - machinesPerLocation: 2, + machinesPerLocation: 1, // Only create one machine since we're testing failure deployMachineErrors: map[string]error{ "machine-eastus-0": fmt.Errorf("deploy machine error"), }, @@ -115,23 +136,21 @@ func (suite *PkgProvidersAzureCreateResourceTestSuite) TestCreateResources() { for _, tt := range tests { suite.Run(tt.name, func() { - // Reset the suite for each test case - suite.SetupTest() - - // Create a new deployment for each test case - deployment := &models.Deployment{ - Locations: tt.locations, - Machines: make(map[string]models.Machiner), - Azure: &models.AzureConfig{ - ResourceGroupName: "test-rg-name", - }, - SSHPublicKeyMaterial: "PUBLIC KEY MATERIAL", - } + // Reset everything for each test + suite.mockAzureClient = new(azure_mocks.MockAzureClienter) + suite.mockSSHConfig = new(ssh_mock.MockSSHConfiger) + suite.azureProvider = &AzureProvider{} // Create fresh provider + suite.azureProvider.SetAzureClient(suite.mockAzureClient) + // Reset deployment state + suite.deployment.Locations = tt.locations + suite.deployment.Machines = make(map[string]models.Machiner) + + // Create the test machines for _, location := range tt.locations { for i := 0; i < tt.machinesPerLocation; i++ { machineName := fmt.Sprintf("machine-%s-%d", location, i) - deployment.SetMachine(machineName, &models.Machine{ + suite.deployment.SetMachine(machineName, &models.Machine{ Name: machineName, Location: location, SSHPublicKeyPath: suite.testSSHPublicKeyPath, @@ -146,7 +165,7 @@ func (suite *PkgProvidersAzureCreateResourceTestSuite) TestCreateResources() { display.GetGlobalModelFunc = func() *display.DisplayModel { return &display.DisplayModel{ - Deployment: deployment, + Deployment: suite.deployment, } } @@ -183,29 +202,31 @@ func (suite *PkgProvidersAzureCreateResourceTestSuite) TestCreateResources() { Return(testdata.FakeNetworkInterface(), nil) suite.mockAzureClient.On("GetPublicIPAddress", mock.Anything, mock.Anything, mock.Anything). Return(testdata.FakePublicIPAddress("20.30.40.50"), nil) - suite.mockSSHConfig.On("WaitForSSH", mock.Anything, mock.Anything, - mock.Anything).Return(nil) - + mock.Anything, + ).Return(nil) } - + // Execute the test err := suite.azureProvider.CreateResources(suite.ctx) + // Verify expectations if tt.expectedError != "" { - suite.Error(err) - suite.Contains(err.Error(), tt.expectedError) + suite.Error(err, "Expected an error but got nil") + if err != nil { + suite.Contains(err.Error(), tt.expectedError) + } } else { suite.NoError(err) } - // Assert that all expectations were met + // Verify all mock expectations were met suite.mockAzureClient.AssertExpectations(suite.T()) + suite.mockSSHConfig.AssertExpectations(suite.T()) }) } } - func TestPkgProvidersAzureCreateResourceSuite(t *testing.T) { suite.Run(t, new(PkgProvidersAzureCreateResourceTestSuite)) } diff --git a/pkg/providers/azure/deploy_bacalhau_test.go b/pkg/providers/azure/deploy_bacalhau_test.go index 3394d796..b0a6a3ac 100644 --- a/pkg/providers/azure/deploy_bacalhau_test.go +++ b/pkg/providers/azure/deploy_bacalhau_test.go @@ -4,74 +4,21 @@ import ( "context" "testing" + ssh_mock "github.com/bacalhau-project/andaime/mocks/sshutils" "github.com/bacalhau-project/andaime/pkg/display" "github.com/bacalhau-project/andaime/pkg/models" + sshutils_interface "github.com/bacalhau-project/andaime/pkg/models/interfaces/sshutils" "github.com/bacalhau-project/andaime/pkg/providers/common" "github.com/bacalhau-project/andaime/pkg/sshutils" "github.com/spf13/viper" - "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" ) -// TestHelper encapsulates common test setup and verification -type TestHelper struct { - t *testing.T - mockSSH *sshutils.MockSSHConfig - expectedCall map[string]int // tracks expected calls per method - actualCalls map[string]int // tracks actual calls per method - callArgs map[string][]any // stores arguments per call for verification -} - -func NewTestHelper(t *testing.T, mockSSH *sshutils.MockSSHConfig) *TestHelper { - return &TestHelper{ - t: t, - mockSSH: mockSSH, - expectedCall: make(map[string]int), - actualCalls: make(map[string]int), - callArgs: make(map[string][]any), - } -} - -// ExpectCall registers an expected call with args -func (h *TestHelper) ExpectCall(method string, times int, args ...any) { - h.expectedCall[method] = times - h.callArgs[method] = args -} - -// OnCall sets up a mock call with verification -func (h *TestHelper) OnCall(method string, args ...any) *mock.Call { - return h.mockSSH.On(method, args...).Run(func(args mock.Arguments) { - h.actualCalls[method]++ - h.t.Logf("Called %s (%d/%d times)", method, h.actualCalls[method], h.expectedCall[method]) - }) -} - -// VerifyCalls checks if all expected calls were made correctly -func (h *TestHelper) VerifyCalls() { - h.t.Log("\nCall Verification:") - for method, expected := range h.expectedCall { - actual := h.actualCalls[method] - if actual != expected { - h.t.Errorf("Method %s: Expected %d calls, got %d", method, expected, actual) - } - } -} - type PkgProvidersAzureDeployBacalhauTestSuite struct { suite.Suite ctx context.Context deployment *models.Deployment deployer *common.ClusterDeployer - testHelper *TestHelper -} - -// Add these methods to the TestHelper struct -func (h *TestHelper) Reset() { - h.expectedCall = make(map[string]int) - h.actualCalls = make(map[string]int) - h.callArgs = make(map[string][]any) - h.mockSSH.ExpectedCalls = nil - h.mockSSH.Calls = nil } func (s *PkgProvidersAzureDeployBacalhauTestSuite) SetupTest() { @@ -89,15 +36,6 @@ func (s *PkgProvidersAzureDeployBacalhauTestSuite) SetupTest() { } s.deployer = common.NewClusterDeployer(models.DeploymentTypeAzure) - // Create fresh mocks for each test - mockSSH := sshutils.NewMockSSHConfigWithBehavior(sshutils.ExpectedSSHBehavior{}) - s.testHelper = NewTestHelper(s.T(), mockSSH) - - // Reset the global SSH config function for each test - sshutils.NewSSHConfigFunc = func(host string, port int, user string, sshPrivateKeyPath string) (sshutils.SSHConfiger, error) { - return mockSSH, nil - } - // Reset the global model function for each test display.GetGlobalModelFunc = func() *display.DisplayModel { return &display.DisplayModel{ @@ -106,20 +44,7 @@ func (s *PkgProvidersAzureDeployBacalhauTestSuite) SetupTest() { } } -// Add TearDownTest to clean up after each test -func (s *PkgProvidersAzureDeployBacalhauTestSuite) TearDownTest() { - if s.testHelper != nil { - s.testHelper.Reset() - } - - // Clear any global state - s.deployment = nil - s.deployer = nil -} - -// Example test using the new helper func (s *PkgProvidersAzureDeployBacalhauTestSuite) TestDeployOrchestrator() { - // Setup test data s.deployment.SetMachines(map[string]models.Machiner{ "orch": &models.Machine{ @@ -130,52 +55,121 @@ func (s *PkgProvidersAzureDeployBacalhauTestSuite) TestDeployOrchestrator() { }, }) - // Define expected calls - s.testHelper.ExpectCall("PushFile", 5) - s.testHelper.ExpectCall("ExecuteCommand", 7) - s.testHelper.ExpectCall("InstallSystemdService", 1) - s.testHelper.ExpectCall("RestartService", 2) - - // Setup mock behaviors with clear logging - s.testHelper.OnCall("PushFile", mock.Anything, "/tmp/install-docker.sh", mock.Anything, true, mock.Anything). - Return(nil) - s.testHelper.OnCall("PushFile", mock.Anything, "/tmp/install-core-packages.sh", mock.Anything, true, mock.Anything). - Return(nil) - s.testHelper.OnCall("PushFile", mock.Anything, "/tmp/get-node-config-metadata.sh", mock.Anything, true, mock.Anything). - Return(nil) - s.testHelper.OnCall("PushFile", mock.Anything, "/tmp/install-bacalhau.sh", mock.Anything, true, mock.Anything). - Return(nil) - s.testHelper.OnCall("PushFile", mock.Anything, "/tmp/install-run-bacalhau.sh", mock.Anything, true, mock.Anything). - Return(nil) - - s.testHelper.OnCall("ExecuteCommand", mock.Anything, "sudo docker run hello-world", mock.Anything). - Return("Hello from Docker!", nil) - s.testHelper.OnCall("ExecuteCommand", mock.Anything, "sudo /tmp/install-docker.sh", mock.Anything). - Return("", nil) - s.testHelper.OnCall("ExecuteCommand", mock.Anything, "sudo /tmp/install-core-packages.sh", mock.Anything). - Return("", nil) - s.testHelper.OnCall("ExecuteCommand", mock.Anything, "sudo /tmp/get-node-config-metadata.sh", mock.Anything). - Return("", nil) - s.testHelper.OnCall("ExecuteCommand", mock.Anything, "sudo /tmp/install-bacalhau.sh", mock.Anything). - Return("", nil) - s.testHelper.OnCall("ExecuteCommand", mock.Anything, "sudo /tmp/install-run-bacalhau.sh", mock.Anything). - Return("", nil) - s.testHelper.OnCall("ExecuteCommand", mock.Anything, "bacalhau node list --output json --api-host 0.0.0.0", mock.Anything). - Return(`[{"id": "node1"}]`, nil) - s.testHelper.OnCall("ExecuteCommand", mock.Anything, "sudo bacalhau config list --output json", mock.Anything). - Return("[]", nil) - - s.testHelper.OnCall("InstallSystemdService", mock.Anything, mock.Anything, mock.Anything). - Return(nil) - s.testHelper.OnCall("RestartService", mock.Anything, mock.Anything, mock.Anything).Return(nil) - s.testHelper.OnCall("WaitForSSH", mock.Anything, mock.Anything, mock.Anything).Return(nil) + // Create mock SSH client + mockSSHClient := new(ssh_mock.MockSSHClienter) + mockSSHClient.On("Close").Return(nil).Maybe() + mockSSHClient.On("NewSession").Return(&ssh_mock.MockSSHSessioner{}, nil).Maybe() + mockSSHClient.On("GetClient").Return(nil).Maybe() + + // Define expected behavior + behavior := sshutils.ExpectedSSHBehavior{ + ConnectExpectation: &sshutils.ConnectExpectation{ + Client: mockSSHClient, + Error: nil, + Times: 2, + }, + ExecuteCommandExpectations: []sshutils.ExecuteCommandExpectation{ + { + Cmd: "sudo docker run hello-world", + Times: 1, + Output: models.ExpectedDockerOutput, + Error: nil, + }, + { + Cmd: "sudo /tmp/install-docker.sh", + Times: 1, + Output: "", + Error: nil, + }, + { + Cmd: "sudo /tmp/install-core-packages.sh", + Times: 1, + Output: "", + Error: nil, + }, + { + Cmd: "sudo /tmp/get-node-config-metadata.sh", + Times: 1, + Output: "", + Error: nil, + }, + { + Cmd: "sudo /tmp/install-bacalhau.sh", + Times: 1, + Output: "", + Error: nil, + }, + { + Cmd: "sudo /tmp/install-run-bacalhau.sh", + Times: 1, + Output: "", + Error: nil, + }, + { + Cmd: "bacalhau node list --output json --api-host 0.0.0.0", + Times: 1, + Output: `[{"id": "node1"}]`, + Error: nil, + }, + }, + PushFileExpectations: []sshutils.PushFileExpectation{ + { + Dst: "/tmp/install-docker.sh", + Executable: true, + Times: 1, + }, + { + Dst: "/tmp/install-core-packages.sh", + Executable: true, + Times: 1, + }, + { + Dst: "/tmp/get-node-config-metadata.sh", + Executable: true, + Times: 1, + }, + { + Dst: "/tmp/install-bacalhau.sh", + Executable: true, + Times: 1, + }, + { + Dst: "/tmp/install-run-bacalhau.sh", + Executable: true, + Times: 1, + }, + }, + InstallSystemdServiceExpectation: &sshutils.Expectation{ + Error: nil, + Times: 1, + }, + RestartServiceExpectation: &sshutils.Expectation{ + Error: nil, + Times: 2, + }, + WaitForSSHCount: 1, + WaitForSSHError: nil, + } + + // Create mock SSH config with behavior + mockSSH := sshutils.NewMockSSHConfigWithBehavior(behavior) + + // Set up the mock SSH config function + origNewSSHConfigFunc := sshutils.NewSSHConfigFunc + sshutils.NewSSHConfigFunc = func(host string, + port int, + user string, + sshPrivateKeyPath string) (sshutils_interface.SSHConfiger, error) { + return mockSSH, nil + } + defer func() { sshutils.NewSSHConfigFunc = origNewSSHConfigFunc }() // Run the test err := s.deployer.ProvisionOrchestrator(s.ctx, "orch") s.NoError(err) - // Verify all calls were made as expected - s.testHelper.VerifyCalls() + // Verify expectations + mockSSH.(*ssh_mock.MockSSHConfiger).AssertExpectations(s.T()) } func (s *PkgProvidersAzureDeployBacalhauTestSuite) TestDeployWorker() { @@ -190,57 +184,124 @@ func (s *PkgProvidersAzureDeployBacalhauTestSuite) TestDeployWorker() { }, }) - // Define expected calls - s.testHelper.ExpectCall("PushFile", 5) // 5 script pushes - s.testHelper.ExpectCall("ExecuteCommand", 7) - s.testHelper.ExpectCall("InstallSystemdService", 1) - s.testHelper.ExpectCall("RestartService", 2) - - // Setup mock behaviors - s.testHelper.OnCall("PushFile", mock.Anything, "/tmp/install-docker.sh", mock.Anything, true, mock.Anything). - Return(nil) - s.testHelper.OnCall("PushFile", mock.Anything, "/tmp/install-core-packages.sh", mock.Anything, true, mock.Anything). - Return(nil) - s.testHelper.OnCall("PushFile", mock.Anything, "/tmp/get-node-config-metadata.sh", mock.Anything, true, mock.Anything). - Return(nil) - s.testHelper.OnCall("PushFile", mock.Anything, "/tmp/install-bacalhau.sh", mock.Anything, true, mock.Anything). - Return(nil) - s.testHelper.OnCall("PushFile", mock.Anything, "/tmp/install-run-bacalhau.sh", mock.Anything, true, mock.Anything). - Return(nil) - - s.testHelper.OnCall("ExecuteCommand", mock.Anything, "sudo docker run hello-world", mock.Anything). - Return("Hello from Docker!", nil) - s.testHelper.OnCall("ExecuteCommand", mock.Anything, "sudo /tmp/install-docker.sh", mock.Anything). - Return("", nil) - s.testHelper.OnCall("ExecuteCommand", mock.Anything, "sudo /tmp/install-core-packages.sh", mock.Anything). - Return("", nil) - s.testHelper.OnCall("ExecuteCommand", mock.Anything, "sudo /tmp/get-node-config-metadata.sh", mock.Anything). - Return("", nil) - s.testHelper.OnCall("ExecuteCommand", mock.Anything, "sudo /tmp/install-bacalhau.sh", mock.Anything). - Return("", nil) - s.testHelper.OnCall("ExecuteCommand", mock.Anything, "sudo /tmp/install-run-bacalhau.sh", mock.Anything). - Return("", nil) - s.testHelper.OnCall("ExecuteCommand", mock.Anything, "bacalhau node list --output json --api-host 1.2.3.4", mock.Anything). - Return(`[{"id": "node1"}]`, nil) - s.testHelper.OnCall("ExecuteCommand", mock.Anything, "sudo bacalhau config list --output json", mock.Anything). - Return("[]", nil) - - s.testHelper.OnCall("InstallSystemdService", mock.Anything, mock.Anything, mock.Anything). - Return(nil) - s.testHelper.OnCall("RestartService", mock.Anything, mock.Anything, mock.Anything).Return(nil) - s.testHelper.OnCall("WaitForSSH", mock.Anything, mock.Anything, mock.Anything).Return(nil) + // Create mock SSH client + mockSSHClient := new(ssh_mock.MockSSHClienter) + mockSSHClient.On("Close").Return(nil).Maybe() + mockSSHClient.On("NewSession").Return(&ssh_mock.MockSSHSessioner{}, nil).Maybe() + mockSSHClient.On("GetClient").Return(nil).Maybe() + + // Define expected behavior + behavior := sshutils.ExpectedSSHBehavior{ + ConnectExpectation: &sshutils.ConnectExpectation{ + Client: mockSSHClient, + Error: nil, + Times: 2, + }, + ExecuteCommandExpectations: []sshutils.ExecuteCommandExpectation{ + { + Cmd: "sudo docker run hello-world", + Times: 1, + Output: models.ExpectedDockerOutput, + Error: nil, + }, + { + Cmd: "sudo /tmp/install-docker.sh", + Times: 1, + Output: "", + Error: nil, + }, + { + Cmd: "sudo /tmp/install-core-packages.sh", + Times: 1, + Output: "", + Error: nil, + }, + { + Cmd: "sudo /tmp/get-node-config-metadata.sh", + Times: 1, + Output: "", + Error: nil, + }, + { + Cmd: "sudo /tmp/install-bacalhau.sh", + Times: 1, + Output: "", + Error: nil, + }, + { + Cmd: "sudo /tmp/install-run-bacalhau.sh", + Times: 1, + Output: "", + Error: nil, + }, + { + Cmd: "bacalhau node list --output json --api-host 1.2.3.4", + Times: 1, + Output: `[{"id": "node1"}]`, + Error: nil, + }, + }, + PushFileExpectations: []sshutils.PushFileExpectation{ + { + Dst: "/tmp/install-docker.sh", + Executable: true, + Times: 1, + }, + { + Dst: "/tmp/install-core-packages.sh", + Executable: true, + Times: 1, + }, + { + Dst: "/tmp/get-node-config-metadata.sh", + Executable: true, + Times: 1, + }, + { + Dst: "/tmp/install-bacalhau.sh", + Executable: true, + Times: 1, + }, + { + Dst: "/tmp/install-run-bacalhau.sh", + Executable: true, + Times: 1, + }, + }, + InstallSystemdServiceExpectation: &sshutils.Expectation{ + Error: nil, + Times: 1, + }, + RestartServiceExpectation: &sshutils.Expectation{ + Error: nil, + Times: 2, + }, + WaitForSSHCount: 1, + WaitForSSHError: nil, + } + + // Create mock SSH config with behavior + mockSSH := sshutils.NewMockSSHConfigWithBehavior(behavior) + + // Set up the mock SSH config function + origNewSSHConfigFunc := sshutils.NewSSHConfigFunc + sshutils.NewSSHConfigFunc = func(host string, + port int, + user string, + sshPrivateKeyPath string) (sshutils_interface.SSHConfiger, error) { + return mockSSH, nil + } + defer func() { sshutils.NewSSHConfigFunc = origNewSSHConfigFunc }() // Run the test err := s.deployer.ProvisionWorker(s.ctx, "worker") s.NoError(err) - // Verify all calls were made as expected - s.testHelper.VerifyCalls() + // Verify expectations + mockSSH.(*ssh_mock.MockSSHConfiger).AssertExpectations(s.T()) } func (s *PkgProvidersAzureDeployBacalhauTestSuite) TestSetupNodeConfigMetadata() { - s.SetupTest() - s.deployment.SetMachines(map[string]models.Machiner{ "test": &models.Machine{ Name: "test", @@ -250,43 +311,43 @@ func (s *PkgProvidersAzureDeployBacalhauTestSuite) TestSetupNodeConfigMetadata() }, }) - // Define expected calls - s.testHelper.ExpectCall("PushFile", 1) - s.testHelper.ExpectCall("ExecuteCommand", 1) + // Create mock SSH client + mockSSHClient := new(ssh_mock.MockSSHClienter) + mockSSHClient.On("Close").Return(nil).Maybe() + mockSSHClient.On("NewSession").Return(&ssh_mock.MockSSHSessioner{}, nil).Maybe() + mockSSHClient.On("GetClient").Return(nil).Maybe() + + // Define expected behavior + behavior := sshutils.ExpectedSSHBehavior{ + ExecuteCommandExpectations: []sshutils.ExecuteCommandExpectation{ + { + Cmd: "sudo /tmp/get-node-config-metadata.sh", + Times: 1, + Output: "", + Error: nil, + }, + }, + PushFileExpectations: []sshutils.PushFileExpectation{ + { + Dst: "/tmp/get-node-config-metadata.sh", + Executable: true, + Times: 1, + }, + }, + } - // Setup mock behaviors - s.testHelper.OnCall("PushFile", mock.Anything, "/tmp/get-node-config-metadata.sh", mock.Anything, true, mock.Anything). - Return(nil) - s.testHelper.OnCall("ExecuteCommand", mock.Anything, "sudo /tmp/get-node-config-metadata.sh", mock.Anything). - Return("", nil) + // Create mock SSH config with behavior + mockSSH := sshutils.NewMockSSHConfigWithBehavior(behavior) err := s.deployer.SetupNodeConfigMetadata( s.ctx, s.deployment.GetMachine("test"), - s.testHelper.mockSSH, + mockSSH, ) s.NoError(err) - s.testHelper.VerifyCalls() -} - -func (s *PkgProvidersAzureDeployBacalhauTestSuite) TestInstallBacalhau() { - s.SetupTest() - - // Define expected calls - s.testHelper.ExpectCall("PushFile", 1) - s.testHelper.ExpectCall("ExecuteCommand", 1) - - // Setup mock behaviors - s.testHelper.OnCall("PushFile", mock.Anything, "/tmp/install-bacalhau.sh", mock.Anything, true, mock.Anything). - Return(nil) - s.testHelper.OnCall("ExecuteCommand", mock.Anything, "sudo /tmp/install-bacalhau.sh", mock.Anything). - Return("", nil) - - err := s.deployer.InstallBacalhau(s.ctx, s.testHelper.mockSSH) - s.NoError(err) - - s.testHelper.VerifyCalls() + // Verify expectations + mockSSH.(*ssh_mock.MockSSHConfiger).AssertExpectations(s.T()) } func (s *PkgProvidersAzureDeployBacalhauTestSuite) TestVerifyBacalhauDeployment() { @@ -314,45 +375,48 @@ func (s *PkgProvidersAzureDeployBacalhauTestSuite) TestVerifyBacalhauDeployment( for _, tt := range tests { s.Run(tt.name, func() { - s.SetupTest() - - // Define expected calls - s.testHelper.ExpectCall("ExecuteCommand", 1) + // Create mock SSH client + mockSSHClient := new(ssh_mock.MockSSHClienter) + mockSSHClient.On("Close").Return(nil).Maybe() + mockSSHClient.On("NewSession").Return(&ssh_mock.MockSSHSessioner{}, nil).Maybe() + mockSSHClient.On("GetClient").Return(nil).Maybe() + + // Define expected behavior + behavior := sshutils.ExpectedSSHBehavior{ + ExecuteCommandExpectations: []sshutils.ExecuteCommandExpectation{ + { + Cmd: "bacalhau node list --output json --api-host 0.0.0.0", + Times: 1, + Output: tt.nodeListOutput, + Error: nil, + }, + }, + } - // Setup mock behavior - s.testHelper.OnCall("ExecuteCommand", mock.Anything, "bacalhau node list --output json --api-host 0.0.0.0", mock.Anything). - Return(tt.nodeListOutput, nil) + // Create mock SSH config with behavior + mockSSH := sshutils.NewMockSSHConfigWithBehavior(behavior) - err := s.deployer.VerifyBacalhauDeployment(s.ctx, s.testHelper.mockSSH, "0.0.0.0") + err := s.deployer.VerifyBacalhauDeployment(s.ctx, mockSSH, "0.0.0.0") if tt.expectError { - s.Error(err, "Expected an error for case: %s", tt.name) + s.Error(err) switch tt.name { case "Empty node list": - s.Contains( - err.Error(), - "no Bacalhau nodes found", - "Expected specific error message for empty node list", - ) + s.Contains(err.Error(), "no Bacalhau nodes found") case "Invalid JSON": - s.Contains( - err.Error(), - "failed to strip and parse JSON", - "Expected specific error message for invalid JSON", - ) + s.Contains(err.Error(), "failed to strip and parse JSON") } } else { - s.NoError(err, "Expected no error for case: %s", tt.name) + s.NoError(err) } - s.testHelper.VerifyCalls() + // Verify expectations + mockSSH.(*ssh_mock.MockSSHConfiger).AssertExpectations(s.T()) }) } } func (s *PkgProvidersAzureDeployBacalhauTestSuite) TestFindOrchestratorMachine() { - s.SetupTest() - tests := []struct { name string machines map[string]models.Machiner diff --git a/pkg/providers/azure/integration_test.go b/pkg/providers/azure/integration_test.go index af229fa5..06bd5f2c 100644 --- a/pkg/providers/azure/integration_test.go +++ b/pkg/providers/azure/integration_test.go @@ -12,9 +12,11 @@ import ( "github.com/bacalhau-project/andaime/internal/clouds/general" "github.com/bacalhau-project/andaime/internal/testdata" azure_mocks "github.com/bacalhau-project/andaime/mocks/azure" + ssh_mock "github.com/bacalhau-project/andaime/mocks/sshutils" "github.com/bacalhau-project/andaime/pkg/display" "github.com/bacalhau-project/andaime/pkg/logger" "github.com/bacalhau-project/andaime/pkg/models" + sshutils_interface "github.com/bacalhau-project/andaime/pkg/models/interfaces/sshutils" "github.com/bacalhau-project/andaime/pkg/providers/common" "github.com/bacalhau-project/andaime/pkg/sshutils" "github.com/spf13/viper" @@ -32,7 +34,7 @@ type PkgProvidersAzureIntegrationTest struct { origGetGlobalModelFunc func() *display.DisplayModel testDisplayModel *display.DisplayModel mockAzureClient *azure_mocks.MockAzureClienter - mockSSHConfig *sshutils.MockSSHConfig + mockSSHConfig *ssh_mock.MockSSHConfiger cleanup func() } @@ -156,160 +158,160 @@ func (s *PkgProvidersAzureIntegrationTest) SetupTest() { display.SetGlobalModel(m) sshBehavior := sshutils.ExpectedSSHBehavior{ + WaitForSSHCount: 3, PushFileExpectations: []sshutils.PushFileExpectation{ { Dst: "/tmp/get-node-config-metadata.sh", Executable: true, - ProgressCallback: mock.Anything, + ProgressCallback: func(int64, int64) {}, Error: nil, Times: 3, }, { Dst: "/tmp/install-docker.sh", Executable: true, - ProgressCallback: mock.Anything, + ProgressCallback: func(int64, int64) {}, Error: nil, Times: 3, }, { Dst: "/tmp/install-core-packages.sh", Executable: true, - ProgressCallback: mock.Anything, + ProgressCallback: func(int64, int64) {}, Error: nil, Times: 3, }, { Dst: "/tmp/install-bacalhau.sh", Executable: true, - ProgressCallback: mock.Anything, + ProgressCallback: func(int64, int64) {}, Error: nil, Times: 3, }, { Dst: "/tmp/install-run-bacalhau.sh", Executable: true, - ProgressCallback: mock.Anything, + ProgressCallback: func(int64, int64) {}, Error: nil, Times: 3, }, { Dst: "/tmp/custom_script.sh", Executable: true, - ProgressCallback: mock.Anything, + ProgressCallback: func(int64, int64) {}, Error: nil, - FileContents: localCustomScriptContent, Times: 3, }, }, ExecuteCommandExpectations: []sshutils.ExecuteCommandExpectation{ { Cmd: "sudo /tmp/get-node-config-metadata.sh", - ProgressCallback: mock.Anything, + ProgressCallback: func(int64, int64) {}, Output: "", Error: nil, Times: 3, }, { Cmd: "sudo /tmp/install-docker.sh", - ProgressCallback: mock.Anything, + ProgressCallback: func(int64, int64) {}, Output: "", Error: nil, Times: 3, }, { Cmd: "sudo docker run hello-world", - ProgressCallback: mock.Anything, - Output: "Hello from Docker!", + ProgressCallback: func(int64, int64) {}, + Output: models.ExpectedDockerOutput, Error: nil, Times: 3, }, { Cmd: "sudo /tmp/install-core-packages.sh", - ProgressCallback: mock.Anything, + ProgressCallback: func(int64, int64) {}, Output: "", Error: nil, Times: 3, }, { Cmd: "sudo /tmp/install-bacalhau.sh", - ProgressCallback: mock.Anything, + ProgressCallback: func(int64, int64) {}, Output: "", Error: nil, Times: 3, }, { Cmd: "sudo /tmp/install-run-bacalhau.sh", - ProgressCallback: mock.Anything, + ProgressCallback: func(int64, int64) {}, Output: "", Error: nil, Times: 3, }, { Cmd: "sudo bash /tmp/custom_script.sh | sudo tee /var/log/andaime-custom-script.log", - ProgressCallback: mock.Anything, + ProgressCallback: func(int64, int64) {}, Output: "", Error: nil, Times: 3, }, { Cmd: "bacalhau node list --output json --api-host 0.0.0.0", - ProgressCallback: mock.Anything, + ProgressCallback: func(int64, int64) {}, Output: `[{"id": "node1"}]`, Error: nil, Times: 1, }, { Cmd: "bacalhau node list --output json --api-host 20.30.40.50", - ProgressCallback: mock.Anything, + ProgressCallback: func(int64, int64) {}, Output: `[{"id": "node1"}]`, Error: nil, Times: 2, }, { Cmd: `sudo bacalhau config set 'compute.allowlistedlocalpaths'='/tmp,/data:rw'`, - ProgressCallback: mock.Anything, + ProgressCallback: func(int64, int64) {}, Output: "", Error: nil, Times: 3, }, { Cmd: `sudo bacalhau config set 'compute.heartbeat.interval'='5s'`, - ProgressCallback: mock.Anything, + ProgressCallback: func(int64, int64) {}, Output: "", Error: nil, Times: 3, }, { Cmd: `sudo bacalhau config set 'compute.heartbeat.infoupdateinterval'='6s'`, - ProgressCallback: mock.Anything, + ProgressCallback: func(int64, int64) {}, Output: "", Error: nil, Times: 3, }, { Cmd: `sudo bacalhau config set 'compute.heartbeat.resourceupdateinterval'='7s'`, - ProgressCallback: mock.Anything, + ProgressCallback: func(int64, int64) {}, Output: "", Error: nil, Times: 3, }, { Cmd: `sudo bacalhau config set 'orchestrator.nodemanager.disconnecttimeout'='8s'`, - ProgressCallback: mock.Anything, + ProgressCallback: func(int64, int64) {}, Output: "", Error: nil, Times: 3, }, { Cmd: `sudo bacalhau config set 'jobadmissioncontrol.acceptnetworkedjobs'='true'`, - ProgressCallback: mock.Anything, + ProgressCallback: func(int64, int64) {}, Output: "", Error: nil, Times: 3, }, { Cmd: "sudo bacalhau config list --output json", - ProgressCallback: mock.Anything, + ProgressCallback: func(int64, int64) {}, Output: "[]", Error: nil, Times: 3, @@ -325,8 +327,11 @@ func (s *PkgProvidersAzureIntegrationTest) SetupTest() { }, } - s.mockSSHConfig = sshutils.NewMockSSHConfigWithBehavior(sshBehavior) - sshutils.NewSSHConfigFunc = func(host string, port int, user string, sshPrivateKeyPath string) (sshutils.SSHConfiger, error) { + s.mockSSHConfig = sshutils.NewMockSSHConfigWithBehavior(sshBehavior).(*ssh_mock.MockSSHConfiger) + sshutils.NewSSHConfigFunc = func(host string, + port int, + user string, + sshPrivateKeyPath string) (sshutils_interface.SSHConfiger, error) { return s.mockSSHConfig, nil } @@ -339,8 +344,6 @@ func (s *PkgProvidersAzureIntegrationTest) TestProvisionResourcesSuccess() { ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second) defer cancel() - s.mockSSHConfig.On("WaitForSSH", mock.Anything, mock.Anything, mock.Anything).Return(nil) - s.origGetGlobalModelFunc = display.GetGlobalModelFunc display.GetGlobalModelFunc = func() *display.DisplayModel { return s.testDisplayModel diff --git a/pkg/providers/azure/provider.go b/pkg/providers/azure/provider.go index 680d54c5..88cf11f4 100644 --- a/pkg/providers/azure/provider.go +++ b/pkg/providers/azure/provider.go @@ -20,8 +20,8 @@ import ( "github.com/bacalhau-project/andaime/pkg/models" azure_interface "github.com/bacalhau-project/andaime/pkg/models/interfaces/azure" common_interface "github.com/bacalhau-project/andaime/pkg/models/interfaces/common" + sshutils_interface "github.com/bacalhau-project/andaime/pkg/models/interfaces/sshutils" "github.com/bacalhau-project/andaime/pkg/providers/common" - "github.com/bacalhau-project/andaime/pkg/sshutils" ) func NewAzureProviderFactory(ctx context.Context) (*AzureProvider, error) { @@ -62,7 +62,7 @@ type AzureProvider struct { Tags map[string]*string Client azure_interface.AzureClienter ClusterDeployer common_interface.ClusterDeployerer - SSHClient sshutils.SSHClienter + SSHClient sshutils_interface.SSHClienter SSHUser string SSHPort int serviceMutex sync.Mutex //nolint:unused diff --git a/pkg/providers/common/cluster_deployer.go b/pkg/providers/common/cluster_deployer.go index 1420a015..2340bf22 100644 --- a/pkg/providers/common/cluster_deployer.go +++ b/pkg/providers/common/cluster_deployer.go @@ -16,6 +16,7 @@ import ( "github.com/bacalhau-project/andaime/pkg/logger" "github.com/bacalhau-project/andaime/pkg/models" common_interface "github.com/bacalhau-project/andaime/pkg/models/interfaces/common" + sshutils_interface "github.com/bacalhau-project/andaime/pkg/models/interfaces/sshutils" "github.com/bacalhau-project/andaime/pkg/sshutils" "github.com/bacalhau-project/andaime/pkg/utils" "golang.org/x/sync/errgroup" @@ -26,7 +27,7 @@ type UpdateCallback func(*models.DisplayStatus) // ClusterDeployer struct that implements ClusterDeployerInterface type ClusterDeployer struct { - sshClient sshutils.SSHClienter + sshClient sshutils_interface.SSHClienter provider models.DeploymentType } @@ -36,7 +37,7 @@ func NewClusterDeployer(provider models.DeploymentType) *ClusterDeployer { } } -func (cd *ClusterDeployer) SetSSHClient(client sshutils.SSHClienter) { +func (cd *ClusterDeployer) SetSSHClient(client sshutils_interface.SSHClienter) { cd.sshClient = client } @@ -233,7 +234,7 @@ func (cd *ClusterDeployer) FindOrchestratorMachine() (models.Machiner, error) { // and marks the machine as complete. func (cd *ClusterDeployer) ProvisionBacalhauNode( ctx context.Context, - sshConfig sshutils.SSHConfiger, + sshConfig sshutils_interface.SSHConfiger, machine models.Machiner, bacalhauSettings []models.BacalhauSettings, ) error { @@ -289,7 +290,7 @@ func (cd *ClusterDeployer) sendErrorUpdate( func (cd *ClusterDeployer) ProvisionBacalhauNodeWithCallback( ctx context.Context, - sshConfig sshutils.SSHConfiger, + sshConfig sshutils_interface.SSHConfiger, machine models.Machiner, bacalhauSettings []models.BacalhauSettings, callback UpdateCallback, @@ -477,13 +478,15 @@ func (cd *ClusterDeployer) ProvisionBacalhauNodeWithCallback( false, ) - if err := sshConfig.RestartService(ctx, "bacalhau"); err != nil { + if out, err := sshConfig.RestartService(ctx, "bacalhau"); err != nil { cd.sendErrorUpdate( stepRegistry.GetStep(common_interface.ServiceRestart), callback, err, ) return cd.HandleDeploymentError(ctx, machine, err) + } else { + l.Infof("Bacalhau service restarted: %s", out) } cd.sendStepUpdate( @@ -521,7 +524,9 @@ func (cd *ClusterDeployer) ProvisionBacalhauNodeWithCallback( return nil } -func (cd *ClusterDeployer) createSSHConfig(machine models.Machiner) (sshutils.SSHConfiger, error) { +func (cd *ClusterDeployer) createSSHConfig( + machine models.Machiner, +) (sshutils_interface.SSHConfiger, error) { return sshutils.NewSSHConfigFunc( machine.GetPublicIP(), machine.GetSSHPort(), @@ -533,7 +538,7 @@ func (cd *ClusterDeployer) createSSHConfig(machine models.Machiner) (sshutils.SS func (cd *ClusterDeployer) SetupNodeConfigMetadata( ctx context.Context, machine models.Machiner, - sshConfig sshutils.SSHConfiger, + sshConfig sshutils_interface.SSHConfiger, ) error { m := display.GetGlobalModelFunc() @@ -607,7 +612,7 @@ func (cd *ClusterDeployer) SetupNodeConfigMetadata( func (cd *ClusterDeployer) InstallBacalhau( ctx context.Context, - sshConfig sshutils.SSHConfiger, + sshConfig sshutils_interface.SSHConfiger, ) error { installScriptBytes, err := internal.GetInstallBacalhauScript() if err != nil { @@ -628,7 +633,7 @@ func (cd *ClusterDeployer) InstallBacalhau( func (cd *ClusterDeployer) InstallBacalhauRunScript( ctx context.Context, - sshConfig sshutils.SSHConfiger, + sshConfig sshutils_interface.SSHConfiger, ) error { installScriptBytes, err := internal.GetInstallRunBacalhauScript() if err != nil { @@ -649,7 +654,7 @@ func (cd *ClusterDeployer) InstallBacalhauRunScript( func (cd *ClusterDeployer) SetupBacalhauService( ctx context.Context, - sshConfig sshutils.SSHConfiger, + sshConfig sshutils_interface.SSHConfiger, ) error { serviceContent, err := internal.GetBacalhauServiceScript() if err != nil { @@ -661,8 +666,10 @@ func (cd *ClusterDeployer) SetupBacalhauService( } // Always restart after service installation - if err := sshConfig.RestartService(ctx, "bacalhau"); err != nil { + if out, err := sshConfig.RestartService(ctx, "bacalhau"); err != nil { return fmt.Errorf("failed to restart Bacalhau service: %w", err) + } else { + logger.Get().Infof("Bacalhau service restarted: %s", out) } return nil @@ -670,7 +677,7 @@ func (cd *ClusterDeployer) SetupBacalhauService( func (cd *ClusterDeployer) VerifyBacalhauDeployment( ctx context.Context, - sshConfig sshutils.SSHConfiger, + sshConfig sshutils_interface.SSHConfiger, orchestratorIP string, ) error { l := logger.Get() @@ -705,7 +712,7 @@ func (cd *ClusterDeployer) VerifyBacalhauDeployment( func (cd *ClusterDeployer) ExecuteCustomScript( ctx context.Context, - sshConfig sshutils.SSHConfiger, + sshConfig sshutils_interface.SSHConfiger, machine models.Machiner, ) error { l := logger.Get() @@ -739,7 +746,7 @@ func (cd *ClusterDeployer) ExecuteCustomScript( func (cd *ClusterDeployer) ApplyBacalhauConfigs( ctx context.Context, - sshConfig sshutils.SSHConfiger, + sshConfig sshutils_interface.SSHConfiger, combinedSettings []models.BacalhauSettings, ) error { l := logger.Get() @@ -759,7 +766,7 @@ func (cd *ClusterDeployer) ApplyBacalhauConfigs( func applySettings( ctx context.Context, - sshConfig sshutils.SSHConfiger, + sshConfig sshutils_interface.SSHConfiger, settings []models.BacalhauSettings, ) error { l := logger.Get() @@ -800,7 +807,7 @@ func applySettings( func verifySettings( ctx context.Context, - sshConfig sshutils.SSHConfiger, + sshConfig sshutils_interface.SSHConfiger, expectedSettings []models.BacalhauSettings, ) error { l := logger.Get() @@ -864,7 +871,7 @@ func (cd *ClusterDeployer) HandleDeploymentError( func (cd *ClusterDeployer) ProvisionMachine( ctx context.Context, - sshConfig sshutils.SSHConfiger, + sshConfig sshutils_interface.SSHConfiger, machine models.Machiner, ) error { m := display.GetGlobalModelFunc() diff --git a/pkg/providers/common/cluster_deployer_test.go b/pkg/providers/common/cluster_deployer_test.go index a1937c81..f4c0ed19 100644 --- a/pkg/providers/common/cluster_deployer_test.go +++ b/pkg/providers/common/cluster_deployer_test.go @@ -9,13 +9,16 @@ import ( "testing" "github.com/bacalhau-project/andaime/internal/testutil" + sshutils_mock "github.com/bacalhau-project/andaime/mocks/sshutils" "github.com/bacalhau-project/andaime/pkg/display" "github.com/bacalhau-project/andaime/pkg/models" + sshutils_interface "github.com/bacalhau-project/andaime/pkg/models/interfaces/sshutils" "github.com/bacalhau-project/andaime/pkg/sshutils" "github.com/spf13/viper" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" + "golang.org/x/crypto/ssh" ) type PkgProvidersCommonClusterDeployerTestSuite struct { @@ -130,7 +133,17 @@ func (s *PkgProvidersCommonClusterDeployerTestSuite) SetupTest() { // } func (s *PkgProvidersCommonClusterDeployerTestSuite) TestProvisionBacalhauCluster() { + mockSSHClient := new(sshutils_mock.MockSSHClienter) + mockSSHClient.On("Close").Return(nil).Maybe() + mockSSHClient.On("NewSession").Return(&sshutils_mock.MockSSHSessioner{}, nil).Maybe() + mockSSHClient.On("GetClient").Return(&ssh.Client{}).Maybe() + sshBehavior := sshutils.ExpectedSSHBehavior{ + ConnectExpectation: &sshutils.ConnectExpectation{ + Client: mockSSHClient, + Error: nil, + Times: 2, + }, PushFileExpectations: []sshutils.PushFileExpectation{ {Dst: mock.Anything, Executable: true, Error: nil, Times: 3}, }, @@ -194,7 +207,10 @@ func (s *PkgProvidersCommonClusterDeployerTestSuite) TestProvisionBacalhauCluste RestartServiceExpectation: &sshutils.Expectation{Error: nil, Times: 4}, } - sshutils.NewSSHConfigFunc = func(host string, port int, user string, sshPrivateKeyPath string) (sshutils.SSHConfiger, error) { + sshutils.NewSSHConfigFunc = func(host string, + port int, + user string, + sshPrivateKeyPath string) (sshutils_interface.SSHConfiger, error) { return sshutils.NewMockSSHConfigWithBehavior(sshBehavior), nil } @@ -562,7 +578,7 @@ func TestApplyBacalhauConfigs(t *testing.T) { } // Verify that all expected commands were executed - mockSSHConfig.AssertExpectations(t) + mockSSHConfig.(*sshutils_mock.MockSSHConfiger).AssertExpectations(t) }) } } diff --git a/pkg/providers/common/deployment.go b/pkg/providers/common/deployment.go index ade6e840..a88e34c5 100644 --- a/pkg/providers/common/deployment.go +++ b/pkg/providers/common/deployment.go @@ -152,7 +152,7 @@ func PrepareDeployment( defaultCountPerLocation = deployment.GCP.DefaultCountPerZone defaultDiskSizeGB = int(deployment.GCP.DefaultDiskSizeGB) } else if provider == models.DeploymentTypeAWS { - defaultCountPerLocation = deployment.AWS.DefaultCountPerRegion + defaultCountPerLocation = int(deployment.AWS.DefaultCountPerRegion) defaultDiskSizeGB = int(deployment.AWS.DefaultDiskSizeGB) } diff --git a/pkg/providers/common/machine_config.go b/pkg/providers/common/machine_config.go index 397a2ba2..6149654d 100644 --- a/pkg/providers/common/machine_config.go +++ b/pkg/providers/common/machine_config.go @@ -170,6 +170,7 @@ func ProcessMachinesConfig( newMachine.SetOrchestrator(true) } } + newMachines[newMachine.GetName()] = newMachine newMachines[newMachine.GetName()].SetMachineResourceState( string(providerType)+"VM", @@ -286,6 +287,8 @@ func createNewMachine( } newMachine.SetDiskImageURL(diskImageURL) newMachine.SetDiskImageFamily(diskImageFamily) + } else if providerType == models.DeploymentTypeAWS { + l.Debugf("Nothing to do for AWS - we will set the Ubuntu AMI in the cloud provider") } return newMachine, nil diff --git a/pkg/providers/gcp/client_compute.go b/pkg/providers/gcp/client_compute.go index 74120732..d1bcdc8d 100644 --- a/pkg/providers/gcp/client_compute.go +++ b/pkg/providers/gcp/client_compute.go @@ -56,7 +56,6 @@ func (c *LiveGCPClient) CreateVPCNetwork( b.RandomizationFactor = 0.3 // Add some jitter operation := func() error { - // Try to get existing network first network, err := c.networksClient.Get(ctx, &computepb.GetNetworkRequest{ Project: projectID, @@ -159,9 +158,9 @@ func (c *LiveGCPClient) CleanupFirewallRules( } // Skip SSH rule (port 22) - if rule.Allowed != nil && len(rule.Allowed) > 0 { + if len(rule.Allowed) > 0 { for _, allowed := range rule.Allowed { - if allowed.Ports != nil && len(allowed.Ports) > 0 { + if len(allowed.Ports) > 0 { if allowed.Ports[0] == "22" { l.Infof("Keeping SSH firewall rule: %s", *rule.Name) continue @@ -586,7 +585,10 @@ func (c *LiveGCPClient) CreateVM( } // Update resource states for the VM - machine.SetMachineResourceState("compute.googleapis.com/Instance", models.ResourceStateSucceeded) + machine.SetMachineResourceState( + "compute.googleapis.com/Instance", + models.ResourceStateSucceeded, + ) machine.SetMachineResourceState("compute.googleapis.com/Network", models.ResourceStateSucceeded) machine.SetMachineResourceState("compute.googleapis.com/Disk", models.ResourceStateSucceeded) machine.SetMachineResourceState("compute.googleapis.com/IP", models.ResourceStateSucceeded) diff --git a/pkg/providers/gcp/integration_test.go b/pkg/providers/gcp/integration_test.go index 909ad282..6b37b0b7 100644 --- a/pkg/providers/gcp/integration_test.go +++ b/pkg/providers/gcp/integration_test.go @@ -13,9 +13,11 @@ import ( "github.com/bacalhau-project/andaime/internal/clouds/general" "github.com/bacalhau-project/andaime/internal/testdata" gcp_mocks "github.com/bacalhau-project/andaime/mocks/gcp" + ssh_mock "github.com/bacalhau-project/andaime/mocks/sshutils" "github.com/bacalhau-project/andaime/pkg/display" "github.com/bacalhau-project/andaime/pkg/logger" "github.com/bacalhau-project/andaime/pkg/models" + sshutils_interface "github.com/bacalhau-project/andaime/pkg/models/interfaces/sshutils" "github.com/bacalhau-project/andaime/pkg/providers/common" "github.com/bacalhau-project/andaime/pkg/sshutils" "github.com/spf13/viper" @@ -33,7 +35,7 @@ type PkgProvidersGCPIntegrationTest struct { origGetGlobalModelFunc func() *display.DisplayModel testDisplayModel *display.DisplayModel mockGCPClient *gcp_mocks.MockGCPClienter - mockSSHConfig *sshutils.MockSSHConfig + mockSSHConfig *ssh_mock.MockSSHConfiger cleanup func() } @@ -66,6 +68,7 @@ func (s *PkgProvidersGCPIntegrationTest) SetupSuite() { viper.Set("gcp.region", "us-central1") viper.Set("general.ssh_user", "testuser") viper.Set("general.ssh_port", 22) + viper.Set("general.custom_script_path", localCustomScriptPath) viper.Set("gcp.default_disk_size_gb", 30) s.mockGCPClient = new(gcp_mocks.MockGCPClienter) @@ -88,10 +91,6 @@ func (s *PkgProvidersGCPIntegrationTest) SetupSuite() { } } -func (s *PkgProvidersGCPIntegrationTest) TearDownSuite() { - s.cleanup() -} - func (s *PkgProvidersGCPIntegrationTest) SetupTest() { s.mockGCPClient.On("EnsureProject", mock.Anything, mock.Anything, mock.Anything, mock.Anything). Return("test-project-id", nil) @@ -168,156 +167,155 @@ func (s *PkgProvidersGCPIntegrationTest) SetupTest() { { Dst: "/tmp/get-node-config-metadata.sh", Executable: true, - ProgressCallback: mock.Anything, + ProgressCallback: func(int64, int64) {}, Error: nil, Times: 3, }, { Dst: "/tmp/install-docker.sh", Executable: true, - ProgressCallback: mock.Anything, + ProgressCallback: func(int64, int64) {}, Error: nil, Times: 3, }, { Dst: "/tmp/install-core-packages.sh", Executable: true, - ProgressCallback: mock.Anything, + ProgressCallback: func(int64, int64) {}, Error: nil, Times: 3, }, { Dst: "/tmp/install-bacalhau.sh", Executable: true, - ProgressCallback: mock.Anything, + ProgressCallback: func(int64, int64) {}, Error: nil, Times: 3, }, { Dst: "/tmp/install-run-bacalhau.sh", Executable: true, - ProgressCallback: mock.Anything, + ProgressCallback: func(int64, int64) {}, Error: nil, Times: 3, }, { Dst: "/tmp/custom_script.sh", Executable: true, - ProgressCallback: mock.Anything, + ProgressCallback: func(int64, int64) {}, Error: nil, - FileContents: localCustomScriptContent, Times: 3, }, }, ExecuteCommandExpectations: []sshutils.ExecuteCommandExpectation{ { Cmd: "sudo /tmp/get-node-config-metadata.sh", - ProgressCallback: mock.Anything, + ProgressCallback: func(int64, int64) {}, Output: "", Error: nil, Times: 3, }, { Cmd: "sudo /tmp/install-docker.sh", - ProgressCallback: mock.Anything, + ProgressCallback: func(int64, int64) {}, Output: "", Error: nil, Times: 3, }, { Cmd: "sudo docker run hello-world", - ProgressCallback: mock.Anything, + ProgressCallback: func(int64, int64) {}, Output: "Hello from Docker!", Error: nil, Times: 3, }, { Cmd: "sudo /tmp/install-core-packages.sh", - ProgressCallback: mock.Anything, + ProgressCallback: func(int64, int64) {}, Output: "", Error: nil, Times: 3, }, { Cmd: "sudo /tmp/install-bacalhau.sh", - ProgressCallback: mock.Anything, + ProgressCallback: func(int64, int64) {}, Output: "", Error: nil, Times: 3, }, { Cmd: "sudo /tmp/install-run-bacalhau.sh", - ProgressCallback: mock.Anything, + ProgressCallback: func(int64, int64) {}, Output: "", Error: nil, Times: 3, }, { Cmd: "sudo bash /tmp/custom_script.sh | sudo tee /var/log/andaime-custom-script.log", - ProgressCallback: mock.Anything, + ProgressCallback: func(int64, int64) {}, Output: "", Error: nil, Times: 3, }, { Cmd: "bacalhau node list --output json --api-host 0.0.0.0", - ProgressCallback: mock.Anything, - Output: `[{"id": "node1"}]`, + ProgressCallback: func(int64, int64) {}, + Output: `[{"id":"12D3KooWRTzN7HfmjoUB3WNSCUEm8rDqFqJqmmGwvvcSqyh5vxpq","host":{"name":"orchestrator","address":"10.0.0.1"},"labels":{"andaime_role":"orchestrator"},"compute":{"executors":["docker"],"concurrency":10},"status":{"state":"ready","time":"2024-04-01T10:00:00Z"}}]`, Error: nil, Times: 1, }, { Cmd: "bacalhau node list --output json --api-host 35.200.100.100", - ProgressCallback: mock.Anything, - Output: `[{"id": "node1"}]`, + ProgressCallback: func(int64, int64) {}, + Output: `[{"id":"12D3KooWRTzN7HfmjoUB3WNSCUEm8rDqFqJqmmGwvvcSqyh5vxpq","host":{"name":"orchestrator","address":"35.200.100.100"},"labels":{"andaime_role":"orchestrator"},"compute":{"executors":["docker"],"concurrency":10},"status":{"state":"ready","time":"2024-04-01T10:00:00Z"}}]`, Error: nil, Times: 2, }, { Cmd: `sudo bacalhau config set 'compute.allowlistedlocalpaths'='/tmp,/data:rw'`, - ProgressCallback: mock.Anything, + ProgressCallback: func(int64, int64) {}, Output: "", Error: nil, Times: 3, }, { Cmd: `sudo bacalhau config set 'compute.heartbeat.interval'='15s'`, - ProgressCallback: mock.Anything, + ProgressCallback: func(int64, int64) {}, Output: "", Error: nil, Times: 3, }, { Cmd: `sudo bacalhau config set 'compute.heartbeat.infoupdateinterval'='16s'`, - ProgressCallback: mock.Anything, + ProgressCallback: func(int64, int64) {}, Output: "", Error: nil, Times: 3, }, { Cmd: `sudo bacalhau config set 'compute.heartbeat.resourceupdateinterval'='17s'`, - ProgressCallback: mock.Anything, + ProgressCallback: func(int64, int64) {}, Output: "", Error: nil, Times: 3, }, { Cmd: `sudo bacalhau config set 'orchestrator.nodemanager.disconnecttimeout'='18s'`, - ProgressCallback: mock.Anything, + ProgressCallback: func(int64, int64) {}, Output: "", Error: nil, Times: 3, }, { Cmd: `sudo bacalhau config set 'jobadmissioncontrol.acceptnetworkedjobs'='true'`, - ProgressCallback: mock.Anything, + ProgressCallback: func(int64, int64) {}, Output: "", Error: nil, Times: 3, }, { Cmd: "sudo bacalhau config list --output json", - ProgressCallback: mock.Anything, + ProgressCallback: func(int64, int64) {}, Output: "[]", Error: nil, Times: 3, @@ -333,8 +331,11 @@ func (s *PkgProvidersGCPIntegrationTest) SetupTest() { }, } - s.mockSSHConfig = sshutils.NewMockSSHConfigWithBehavior(sshBehavior) - sshutils.NewSSHConfigFunc = func(host string, port int, user string, sshPrivateKeyPath string) (sshutils.SSHConfiger, error) { + s.mockSSHConfig = sshutils.NewMockSSHConfigWithBehavior(sshBehavior).(*ssh_mock.MockSSHConfiger) + sshutils.NewSSHConfigFunc = func(host string, + port int, + user string, + sshPrivateKeyPath string) (sshutils_interface.SSHConfiger, error) { return s.mockSSHConfig, nil } } @@ -346,7 +347,7 @@ func (s *PkgProvidersGCPIntegrationTest) TestProvisionResourcesSuccess() { ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second) defer cancel() - s.mockSSHConfig.On("WaitForSSH", mock.Anything, mock.Anything, mock.Anything).Return(nil) + models.ExpectedDockerOutput = "" s.origGetGlobalModelFunc = display.GetGlobalModelFunc display.GetGlobalModelFunc = func() *display.DisplayModel { diff --git a/pkg/providers/gcp/provider.go b/pkg/providers/gcp/provider.go index 01b54e36..e3e5c5d9 100644 --- a/pkg/providers/gcp/provider.go +++ b/pkg/providers/gcp/provider.go @@ -23,8 +23,8 @@ import ( "github.com/bacalhau-project/andaime/pkg/models" common_interface "github.com/bacalhau-project/andaime/pkg/models/interfaces/common" gcp_interface "github.com/bacalhau-project/andaime/pkg/models/interfaces/gcp" + sshutils_interface "github.com/bacalhau-project/andaime/pkg/models/interfaces/sshutils" "github.com/bacalhau-project/andaime/pkg/providers/common" - "github.com/bacalhau-project/andaime/pkg/sshutils" ) var NewGCPProviderFunc = NewGCPProviderFactory @@ -81,7 +81,7 @@ type GCPProvider struct { ClusterDeployer common_interface.ClusterDeployerer CleanupClient func() Config *viper.Viper - SSHClient sshutils.SSHClienter + SSHClient sshutils_interface.SSHClienter SSHUser string SSHPort int updateQueue chan display.UpdateAction @@ -234,7 +234,10 @@ func (p *GCPProvider) PollResources(ctx context.Context) ([]interface{}, error) return backoff.Permanent(fmt.Errorf("failed to check if project exists: %w", err)) } if !projectExists { - l.Debugf("Project %s does not exist, skipping resource polling", m.Deployment.GCP.ProjectID) + l.Debugf( + "Project %s does not exist, skipping resource polling", + m.Deployment.GCP.ProjectID, + ) return nil } @@ -307,9 +310,9 @@ func (p *GCPProvider) StartResourcePolling(ctx context.Context) <-chan error { if err != nil { consecutiveErrors++ l.Warnf("Poll error (%d/%d): %v", consecutiveErrors, maxConsecutiveErrors, err) - + if consecutiveErrors >= maxConsecutiveErrors { - errChan <- fmt.Errorf("polling failed after %d consecutive errors: %w", + errChan <- fmt.Errorf("polling failed after %d consecutive errors: %w", maxConsecutiveErrors, err) return } @@ -859,7 +862,7 @@ func randomString(n int) string { const letterBytes = "abcdefghijklmnopqrstuvwxyz" b := make([]byte, n) for i := range b { - b[i] = letterBytes[rand.Intn(len(letterBytes))] + b[i] = letterBytes[rand.Intn(len(letterBytes))] //nolint:gosec } return string(b) } diff --git a/pkg/sshutils/constants.go b/pkg/sshutils/constants.go index b64076e7..2489a6b8 100644 --- a/pkg/sshutils/constants.go +++ b/pkg/sshutils/constants.go @@ -6,8 +6,8 @@ var ( TimeInBetweenSSHRetries = 2 * time.Second SSHTimeOut = 1 * time.Minute SSHRetryAttempts = 3 - SSHDialTimeout = 3 * time.Second - SSHClientConfigTimeout = 3 * time.Second + SSHDialTimeout = 10 * time.Second + SSHClientConfigTimeout = 10 * time.Second SSHRetryDelay = 3 * time.Second ) diff --git a/pkg/sshutils/mock_helpers.go b/pkg/sshutils/mock_helpers.go new file mode 100644 index 00000000..01eccff4 --- /dev/null +++ b/pkg/sshutils/mock_helpers.go @@ -0,0 +1,205 @@ +package sshutils + +import ( + "strings" + + ssh_mock "github.com/bacalhau-project/andaime/mocks/sshutils" + sshutils_interfaces "github.com/bacalhau-project/andaime/pkg/models/interfaces/sshutils" + "github.com/stretchr/testify/mock" +) + +// ExpectedSSHBehavior defines the expected behavior for the mock +type ExpectedSSHBehavior struct { + WaitForSSHCount int + WaitForSSHError error + ExecuteCommandOutputs map[string]struct { + Output string + Error error + } + PushFileErrors map[string]error + PushFileExpectations []PushFileExpectation + ExecuteCommandExpectations []ExecuteCommandExpectation + InstallSystemdServiceExpectation *Expectation + RestartServiceExpectation *Expectation + ConnectExpectation *ConnectExpectation +} + +type ConnectExpectation struct { + Client sshutils_interfaces.SSHClienter + Error error + Times int +} + +// NewMockSSHConfigWithBehavior creates a new mock SSH config with predefined behavior +func NewMockSSHConfigWithBehavior(behavior ExpectedSSHBehavior) sshutils_interfaces.SSHConfiger { + mockSSH := new(ssh_mock.MockSSHConfiger) + + // Setup Connect behavior + if behavior.ConnectExpectation != nil { + call := mockSSH.On("Connect") + if behavior.ConnectExpectation.Times > 0 { + call.Times(behavior.ConnectExpectation.Times) + } else { + call.Once() + } + call.Return(behavior.ConnectExpectation.Client, behavior.ConnectExpectation.Error) + } else { + mockSSH.On("Connect").Return(&ssh_mock.MockSSHClienter{}, nil).Maybe() + } + + // Setup Close behavior + mockSSH.On("Close").Return(nil).Maybe() + + for _, exp := range behavior.ExecuteCommandExpectations { + call := mockSSH.On( + "ExecuteCommand", + mock.Anything, + mock.MatchedBy(func(cmd string) bool { + return PrefixCommand(exp.Cmd).Matches(cmd) + }), + ) + + if exp.Times > 0 { + call.Times(exp.Times) + } else { + call.Once() + } + + call.Return(exp.Output, exp.Error) + + if exp.ProgressCallback != nil { + call.Run(func(args mock.Arguments) { + exp.ProgressCallback(50, 100) //nolint:mnd + exp.ProgressCallback(100, 100) //nolint:mnd + }) + } + } + + // Setup default ExecuteCommand behavior for unmatched calls + mockSSH.On("ExecuteCommand", + mock.Anything, + mock.Anything, + ).Return("", nil).Maybe() + + // Setup PushFile expectations + for _, exp := range behavior.PushFileExpectations { + call := mockSSH.On("PushFile", + mock.Anything, + exp.Dst, + mock.Anything, + mock.Anything, + ) + + if exp.Times > 0 { + call.Times(exp.Times) + } else { + call.Once() + } + + call.Return(exp.Error) + + if exp.ProgressCallback != nil { + call.Run(func(args mock.Arguments) { + exp.ProgressCallback(50, 100) //nolint:mnd + exp.ProgressCallback(100, 100) //nolint:mnd + }) + } + } + + // Setup default PushFile behavior + mockSSH.On("PushFile", + mock.Anything, + mock.Anything, + mock.Anything, + mock.Anything, + ).Return(nil).Maybe() + + // Setup InstallSystemdService behavior + if behavior.InstallSystemdServiceExpectation != nil { + call := mockSSH.On("InstallSystemdService", + mock.Anything, + mock.Anything, + mock.Anything, + ) + + if behavior.InstallSystemdServiceExpectation.Times > 0 { + call.Times(behavior.InstallSystemdServiceExpectation.Times) + } + + call.Return(behavior.InstallSystemdServiceExpectation.Error) + } else { + mockSSH.On("InstallSystemdService", + mock.Anything, + mock.Anything, + mock.Anything, + ).Return(nil).Maybe() + } + + // Setup RestartService behavior + if behavior.RestartServiceExpectation != nil { + call := mockSSH.On("RestartService", + mock.Anything, + mock.Anything, + ) + + if behavior.RestartServiceExpectation.Times > 0 { + call.Times(behavior.RestartServiceExpectation.Times) + } + + call.Return("", behavior.RestartServiceExpectation.Error) + } else { + mockSSH.On("RestartService", + mock.Anything, + mock.Anything, + ).Return("", nil).Maybe() + } + + // Setup WaitForSSH behavior + mockSSH.On("WaitForSSH", + mock.Anything, + mock.Anything, + mock.Anything, + ).Return(behavior.WaitForSSHError).Maybe() + + return mockSSH +} + +type PushFileExpectation struct { + Dst string + Executable bool + ProgressCallback func(int64, int64) + Error error + Times int +} + +type ExecuteCommandExpectation struct { + Cmd string + ProgressCallback func(int64, int64) + Output string + Error error + Times int +} + +type Expectation struct { + Error error + Times int +} + +// CommandMatcher is an interface for matching command strings +type CommandMatcher interface { + Matches(cmd string) bool +} + +// StringCommand is for exact matching +type StringCommand string + +func (s StringCommand) Matches(cmd string) bool { + return string(s) == cmd +} + +// PrefixCommand is a command matcher that checks if a command starts with a specific prefix +type PrefixCommand string + +func (p PrefixCommand) Matches(cmd string) bool { + return strings.HasPrefix(cmd, string(p)) +} diff --git a/pkg/sshutils/mock_sshutils.go b/pkg/sshutils/mock_sshutils.go deleted file mode 100644 index 60566c40..00000000 --- a/pkg/sshutils/mock_sshutils.go +++ /dev/null @@ -1,128 +0,0 @@ -package sshutils - -import ( - "context" - "io" - "testing" - - "github.com/bacalhau-project/andaime/pkg/logger" - "github.com/stretchr/testify/mock" - "golang.org/x/crypto/ssh" -) - -type MockSSHClient struct { - mock.Mock - Session SSHSessioner - Dialer SSHDialer -} - -func (m *MockSSHClient) PushFile( - ctx context.Context, - remotePath string, - content []byte, - executable bool, -) error { - args := m.Called(ctx, remotePath, content, executable) - return args.Error(0) -} - -func (m *MockSSHClient) NewSession() (SSHSessioner, error) { - if m.Session != nil { - return m.Session, nil - } - args := m.Called() - return args.Get(0).(SSHSessioner), args.Error(1) -} - -func (m *MockSSHClient) Close() error { - args := m.Called() - return args.Error(0) -} - -func (m *MockSSHClient) IsConnected() bool { - args := m.Called() - return args.Bool(0) -} - -func (m *MockSSHClient) GetClient() *ssh.Client { - args := m.Called() - return args.Get(0).(*ssh.Client) -} - -func GetTypedMockClient(t *testing.T, log *logger.Logger) (*MockSSHClient, SSHConfiger) { - mockSSHClient, sshConfig := NewMockSSHClient(NewMockSSHDialer()) - return mockSSHClient, sshConfig -} - -type MockWriteCloser struct { - mock.Mock -} - -func (m *MockWriteCloser) Write(p []byte) (n int, err error) { - args := m.Called(p) - return args.Int(0), args.Error(1) -} - -func (m *MockWriteCloser) Close() error { - args := m.Called() - return args.Error(0) -} - -type MockSessioner interface { - Run(cmd string) error - CombinedOutput(cmd string) ([]byte, error) - StdinPipe() (io.WriteCloser, error) - Start(cmd string) error - Close() error - Wait() error -} - -type MockSSHSession struct { - mock.Mock -} - -func NewMockSSHSession() *MockSSHSession { - return &MockSSHSession{} -} - -func (m *MockSSHSession) Run(cmd string) error { - args := m.Called(cmd) - return args.Error(0) -} - -func (m *MockSSHSession) CombinedOutput(cmd string) ([]byte, error) { - args := m.Called(cmd) - return args.Get(0).([]byte), args.Error(1) -} - -func (m *MockSSHSession) StdinPipe() (io.WriteCloser, error) { - args := m.Called() - return args.Get(0).(io.WriteCloser), args.Error(1) -} - -func (m *MockSSHSession) StdoutPipe() (io.Reader, error) { - args := m.Called() - return args.Get(0).(io.Reader), args.Error(1) -} - -func (m *MockSSHSession) StderrPipe() (io.Reader, error) { - args := m.Called() - return args.Get(0).(io.Reader), args.Error(1) -} - -func (m *MockSSHSession) Start(cmd string) error { - args := m.Called(cmd) - return args.Error(0) -} - -func (m *MockSSHSession) Close() error { - args := m.Called() - return args.Error(0) -} - -func (m *MockSSHSession) Wait() error { - args := m.Called() - return args.Error(0) -} - -var _ SSHSessioner = &MockSSHSession{} diff --git a/pkg/sshutils/sftp.go b/pkg/sshutils/sftp.go index beb36525..dc71ff79 100644 --- a/pkg/sshutils/sftp.go +++ b/pkg/sshutils/sftp.go @@ -1,17 +1,34 @@ package sshutils import ( - "io" + "fmt" - "golang.org/x/crypto/ssh" + sshutils_interfaces "github.com/bacalhau-project/andaime/pkg/models/interfaces/sshutils" + "github.com/pkg/sftp" ) -// SFTPClienter interface defines the methods we need for SFTP operations -type SFTPClienter interface { - Create(path string) (io.WriteCloser, error) - Open(path string) (io.ReadCloser, error) - Close() error +// defaultSFTPClientCreator is a struct for creating SFTP clients +type defaultSFTPClientCreator struct{} + +func (d *defaultSFTPClientCreator) NewSFTPClient( + client sshutils_interfaces.SSHClienter, +) (*sftp.Client, error) { + if client == nil { + return nil, fmt.Errorf("SSH client is nil") + } + + sshClient := client.GetClient() + if sshClient == nil { + return nil, fmt.Errorf("SSH client connection is nil") + } + + sftpClient, err := sftp.NewClient(sshClient) + if err != nil { + return nil, fmt.Errorf("failed to create SFTP client: %w", err) + } + + return sftpClient, nil } -// SFTPDial is a function type for creating SFTP clients -type SFTPDialFunc func(conn *ssh.Client) (SFTPClienter, error) +// DefaultSFTPClientCreator is the default SFTP client creator instance +var DefaultSFTPClientCreator = &defaultSFTPClientCreator{} diff --git a/pkg/sshutils/ssh_client.go b/pkg/sshutils/ssh_client.go index 58a1fd64..c3c9b6bf 100644 --- a/pkg/sshutils/ssh_client.go +++ b/pkg/sshutils/ssh_client.go @@ -1,368 +1,3 @@ package sshutils -import ( - "bufio" - "fmt" - "io" - "strings" - "time" - - "github.com/bacalhau-project/andaime/pkg/logger" - "golang.org/x/crypto/ssh" -) - -// SSHClienter interface defines the methods we need for SSH operations -type SSHClienter interface { - NewSession() (SSHSessioner, error) - IsConnected() bool - Close() error - GetClient() *ssh.Client -} - -// SSHClient struct definition -type SSHClient struct { - SSHClientConfig *ssh.ClientConfig - Client SSHClienter - Dialer SSHDialer -} - -func (cl *SSHClient) NewSession() (SSHSessioner, error) { - if cl.Client == nil { - return nil, fmt.Errorf("SSH client not connected") - } - return cl.Client.NewSession() -} - -func (cl *SSHClient) Close() error { - if cl.Client == nil { - return nil - } - return cl.Client.Close() -} - -func (cl *SSHClient) IsConnected() bool { - return cl.Client != nil && cl.Client.IsConnected() -} - -func (cl *SSHClient) GetClient() *ssh.Client { - if cl.Client == nil { - return nil - } - return cl.Client.GetClient() -} - -// SSHClientWrapper is a thin wrapper around an *ssh.Client that allows us to -// satisfy the SSHClienter interface. -type SSHClientWrapper struct { - *ssh.Client -} - -func (w *SSHClientWrapper) NewSession() (SSHSessioner, error) { - session, err := w.Client.NewSession() - if err != nil { - return nil, err - } - return &SSHSessionWrapper{Session: session}, nil -} - -func (w *SSHClientWrapper) Close() error { - return w.Client.Close() -} - -func (w *SSHClientWrapper) IsConnected() bool { - l := logger.Get() - if w.Client == nil { - l.Debug("SSH client is nil") - return false - } - - // Check if the underlying network connection is still alive - session, err := w.Client.NewSession() - if err != nil { - l.Debugf("Failed to create new session, connection may be dead: %v", err) - if strings.Contains(err.Error(), "use of closed network connection") { - l.Error("SSH connection has been closed") - } else if strings.Contains(err.Error(), "i/o timeout") { - l.Error("SSH connection timed out") - } else { - l.Errorf("Unexpected SSH error: %v", err) - } - return false - } - defer session.Close() - - // Run a simple command to check if the connection is alive - l.Debug("Testing SSH connection with 'echo' command") - err = session.Run("echo") - if err != nil { - l.Debugf("SSH connection test failed: %v", err) - return false - } - - l.Debug("SSH connection test successful") - return true -} - -func (w *SSHClientWrapper) GetClient() *ssh.Client { - return w.Client -} - -type SSHSessionWrapper struct { - Session *ssh.Session -} - -// SSHError represents an SSH command execution error with output -type SSHError struct { - Cmd string - Output string - Err error -} - -func (e *SSHError) Error() string { - return fmt.Sprintf("SSH command failed:\nCommand: %s\nOutput: %s\nError: %v", - e.Cmd, e.Output, e.Err) -} - -func (s *SSHSessionWrapper) Run(cmd string) error { - l := logger.Get() - if s.Session == nil { - l.Error("SSH session is nil") - return fmt.Errorf("SSH session is nil") - } - - l.Infof("Executing SSH command: %s", cmd) - defer l.Sync() // Ensure logs are flushed - - // Wrap the command in sudo bash -c to handle all parts in one go, with proper escaping - escapedCmd := strings.Replace(cmd, "'", "'\"'\"'", -1) - escapedCmd = strings.Replace(escapedCmd, "\\", "\\\\", -1) - wrappedCmd := fmt.Sprintf("sudo bash -c '%s'", escapedCmd) - - // Keep a reference to the session for cleanup - session := s.Session - defer func() { - if session != nil { - session.Close() - } - }() - - // For file transfer commands that contain a pipe, handle them separately - if strings.Contains(wrappedCmd, "cat >") { - return s.handleFileTransfer(cmd, wrappedCmd) - } - - // Set up pipes for stdout and stderr - stdout, err := session.StdoutPipe() - if err != nil { - return fmt.Errorf("failed to get stdout pipe: %w", err) - } - stderr, err := session.StderrPipe() - if err != nil { - return fmt.Errorf("failed to get stderr pipe: %w", err) - } - - // Start the command - if err := session.Start(wrappedCmd); err != nil { - l.Errorf("Failed to start SSH command: %s", wrappedCmd) - l.Debugf("SSH command start error details: %v", err) - l.Sync() // Ensure error logs are flushed - return &SSHError{ - Cmd: cmd, - Output: "Command failed to start", - Err: fmt.Errorf("failed to start command: %w", err), - } - } - l.Debugf("Successfully started SSH command: %s", wrappedCmd) - - // Channel to track the last activity time - lastActivity := make(chan time.Time, 1) - done := make(chan error, 1) - - l.Debug("Starting command execution monitoring") - err = l.Sync() - if err != nil { - l.Errorf("Failed to sync logger: %v", err) - } - - // Start monitoring stdout - go func() { - scanner := bufio.NewScanner(stdout) - for scanner.Scan() { - line := scanner.Text() - l.Infof("stdout: %s", line) - lastActivity <- time.Now() - } - if err := scanner.Err(); err != nil { - l.Errorf("Error reading stdout: %v", err) - } - l.Debug("Stdout monitoring completed") - }() - - // Start monitoring stderr - go func() { - scanner := bufio.NewScanner(stderr) - for scanner.Scan() { - line := scanner.Text() - l.Infof("stderr: %s", line) - lastActivity <- time.Now() - } - }() - - // Start a goroutine to wait for the command completion - go func() { - done <- session.Wait() - }() - - // Initialize the last activity time - lastActivityTime := time.Now() - const inactivityTimeout = 30 * time.Second - - // Monitor for completion or timeout - for { - select { - case err := <-done: - return err - case t := <-lastActivity: - lastActivityTime = t - case <-time.After(1 * time.Second): // Check activity every second - if time.Since(lastActivityTime) > inactivityTimeout { - l.Warnf("Command inactive for %v, initiating termination", inactivityTimeout) - - // Try graceful termination first - l.Debug("Sending SIGTERM signal") - if err := session.Signal(ssh.SIGTERM); err != nil { - l.Errorf("Error sending SIGTERM: %v", err) - } - - time.Sleep(5 * time.Second) // Give it 5 seconds to cleanup - - // Force kill if still running - l.Debug("Sending SIGKILL signal") - if err := session.Signal(ssh.SIGKILL); err != nil { - l.Errorf("Error sending SIGKILL: %v", err) - } - - return &SSHError{ - Cmd: cmd, - Output: "Command timed out due to inactivity", - Err: fmt.Errorf( - "command terminated due to %v of inactivity - last activity at %v", - inactivityTimeout, - lastActivityTime.Format(time.RFC3339), - ), - } - } - } - } -} - -// handleFileTransfer handles the special case of file transfer commands -func (s *SSHSessionWrapper) handleFileTransfer(cmd, wrappedCmd string) error { - l := logger.Get() - stdin, err := s.Session.StdinPipe() - if err != nil { - return &SSHError{ - Cmd: cmd, - Err: fmt.Errorf("failed to get stdin pipe: %w", err), - } - } - - var stderrBuf strings.Builder - stderr, err := s.Session.StderrPipe() - if err != nil { - return &SSHError{ - Cmd: cmd, - Err: fmt.Errorf("failed to get stderr pipe: %w", err), - } - } - - // Copy stderr in background - go func() { - scanner := bufio.NewScanner(stderr) - for scanner.Scan() { - line := scanner.Text() - l.Infof("stderr: %s", line) - stderrBuf.WriteString(line + "\n") - } - }() - - if err := s.Session.Start(wrappedCmd); err != nil { - return &SSHError{ - Cmd: cmd, - Err: fmt.Errorf("failed to start command: %w", err), - } - } - - // Extract and write content - parts := strings.Split(cmd, ">") - if len(parts) < 2 { - l.Error("Invalid file transfer command format") - return fmt.Errorf("invalid file transfer command format") - } - - content := strings.TrimSpace(parts[1]) - if idx := strings.Index(content, "&&"); idx != -1 { - content = strings.TrimSpace(content[:idx]) - } - - l.Debugf("Attempting to write content (length: %d) to remote file", len(content)) - - written, err := io.WriteString(stdin, content) - if err != nil { - l.Errorf("Failed to write content: %v", err) - return &SSHError{ - Cmd: cmd, - Err: fmt.Errorf("failed to write content: %w", err), - } - } - l.Debugf("Successfully wrote %d bytes", written) - - if err := stdin.Close(); err != nil { - l.Errorf("Error closing stdin: %v", err) - return &SSHError{ - Cmd: cmd, - Err: fmt.Errorf("failed to close stdin: %w", err), - } - } - l.Debug("Successfully closed stdin") - - return s.Session.Wait() -} - -func (s *SSHSessionWrapper) Start(cmd string) error { - return s.Session.Start(cmd) -} - -func (s *SSHSessionWrapper) Wait() error { - return s.Session.Wait() -} - -func (s *SSHSessionWrapper) Close() error { - if s.Session != nil { - return s.Session.Close() - } - return nil -} - -func (s *SSHSessionWrapper) StdinPipe() (io.WriteCloser, error) { - return s.Session.StdinPipe() -} - -func (s *SSHSessionWrapper) StdoutPipe() (io.Reader, error) { - return s.Session.StdoutPipe() -} - -func (s *SSHSessionWrapper) StderrPipe() (io.Reader, error) { - return s.Session.StderrPipe() -} - -func (s *SSHSessionWrapper) CombinedOutput(cmd string) ([]byte, error) { - if s.Session == nil { - return nil, fmt.Errorf("ssh session is nil") - } - output, err := s.Session.CombinedOutput(cmd) - if err != nil { - return output, err - } - return output, nil -} +// Removed duplicate method implementations diff --git a/pkg/sshutils/ssh_config.go b/pkg/sshutils/ssh_config.go index 5cac8de1..20b4bc2e 100644 --- a/pkg/sshutils/ssh_config.go +++ b/pkg/sshutils/ssh_config.go @@ -4,378 +4,424 @@ import ( "context" "fmt" "io" - "net" "os" "path/filepath" "strings" "time" "github.com/bacalhau-project/andaime/pkg/logger" + sshutils_interfaces "github.com/bacalhau-project/andaime/pkg/models/interfaces/sshutils" "github.com/pkg/sftp" "golang.org/x/crypto/ssh" ) -var NullCallback = func(int64, int64) {} - +// SSHConfig holds the configuration for SSH connections type SSHConfig struct { - Host string - Port int - User string - SSHPrivateKeyPath string - PrivateKeyMaterial []byte - Timeout time.Duration - Logger *logger.Logger - - SSHClient SSHClienter - SSHDial SSHDialer - - SSHPrivateKeyReader func(path string) ([]byte, error) - SSHPublicKeyReader func(path string) ([]byte, error) - ClientConfig *ssh.ClientConfig - InsecureIgnoreHostKey bool - + Host string + Port int + User string + SSHPrivateKeyPath string + PrivateKeyMaterial []byte + Timeout time.Duration + Logger *logger.Logger + SSHClient *ssh.Client + SSHPrivateKeyReader func(path string) ([]byte, error) + SSHPublicKeyReader func(path string) ([]byte, error) + clientCreator sshutils_interfaces.SSHClientCreator + sftpClientCreator sshutils_interfaces.SFTPClientCreator + ClientConfig *ssh.ClientConfig ValidateSSHConnectionFunc func() error } -type SSHConfiger interface { - GetSSHClienter() SSHClienter - SetSSHClienter(client SSHClienter) - GetSSHClient() *ssh.Client - SetSSHClient(client *ssh.Client) - - Connect() (SSHClienter, error) - WaitForSSH(ctx context.Context, retry int, timeout time.Duration) error - ExecuteCommand(ctx context.Context, command string) (string, error) - ExecuteCommandWithCallback(ctx context.Context, - command string, - callback func(string)) (string, error) - PushFile(ctx context.Context, remotePath string, content []byte, executable bool) error - PushFileWithCallback(ctx context.Context, - remotePath string, - content []byte, - executable bool, - callback func(int64, int64)) error - InstallSystemdService(ctx context.Context, serviceName, serviceContent string) error - StartService(ctx context.Context, serviceName string) error - RestartService(ctx context.Context, serviceName string) error - - GetHost() string - GetPort() int - GetUser() string - GetPrivateKeyMaterial() []byte - GetSSHDial() SSHDialer - SetSSHDial(dialer SSHDialer) - SetValidateSSHConnection(func() error) +// SSHDialer is an interface for creating SSH connections +type SSHDialer interface { + Dial(network, addr string, config *ssh.ClientConfig) (*ssh.Client, error) +} + +// DefaultSSHDialer implements SSHDialer using the standard ssh.Dial +type DefaultSSHDialer struct{} + +func (d *DefaultSSHDialer) Dial( + network, addr string, + config *ssh.ClientConfig, +) (*ssh.Client, error) { + return ssh.Dial(network, addr, config) } +// NewSSHConfigFunc is the function used to create new SSH configurations +// This can be overridden for testing var NewSSHConfigFunc = NewSSHConfig -func NewSSHConfig( - host string, - port int, - user string, - sshPrivateKeyPath string, -) (SSHConfiger, error) { - if len(sshPrivateKeyPath) == 0 { - return nil, fmt.Errorf("private key path is empty") +func (c *SSHConfig) ExecuteCommandWithCallback( + ctx context.Context, + command string, + callback func(string), +) (string, error) { + // Create a new connection specifically for this command + client, err := c.clientCreator.NewClient( + c.Host, + c.Port, + c.User, + c.SSHPrivateKeyPath, + c.ClientConfig, + ) + if err != nil { + c.Logger.Errorf("Failed to create SSH connection for command %s: %v", command, err) + return "", fmt.Errorf("SSH connection failed: %w", err) } + defer client.Close() - if len(host) == 0 { - return nil, fmt.Errorf("host is empty") + session, err := client.NewSession() + if err != nil { + c.Logger.Errorf("Failed to create session for command %s: %v", command, err) + return "", fmt.Errorf("failed to create session: %w", err) } + defer session.Close() + + var output strings.Builder - if len(user) == 0 { - return nil, fmt.Errorf("user is empty") + session.SetStdout(&output) + session.SetStderr(&output) + + if err := session.Run(command); err != nil { + c.Logger.Errorf("Failed to run command %s: %v", command, err) + return output.String(), fmt.Errorf("command execution failed: %w", err) } - if port == 0 { - return nil, fmt.Errorf("port is empty") + outputStr := output.String() + callback(outputStr) + return outputStr, nil +} + +func (c *SSHConfig) PushFileWithCallback( + ctx context.Context, + remotePath string, + content []byte, + executable bool, + callback func(int64, int64), +) error { + // Use existing client if available, otherwise create new one + var sshClient sshutils_interfaces.SSHClienter + var err error + + if c.SSHClient != nil { + sshClient = NewSSHClientWrapper(c.SSHClient) + } else { + sshClient, err = c.clientCreator.NewClient( + c.Host, + c.Port, + c.User, + c.SSHPrivateKeyPath, + c.ClientConfig, + ) + if err != nil { + c.Logger.Errorf("Failed to create SSH connection for file push to %s: %v", remotePath, err) + return fmt.Errorf("SSH connection failed: %w", err) + } + defer sshClient.Close() } - sshClientConfig, err := getSSHClientConfig(user, host, sshPrivateKeyPath) - if err != nil { - return nil, fmt.Errorf("failed to get SSH client config: %w", err) + // Use sftpClientCreator if set, otherwise fall back to default + if c.sftpClientCreator == nil { + c.sftpClientCreator = &defaultSFTPClientCreator{} } - sshPrivateKeyMaterial, err := os.ReadFile(sshPrivateKeyPath) + // Create SFTP client + sftpClient, err := c.GetSFTPClientCreator().NewSFTPClient(sshClient) if err != nil { - return nil, fmt.Errorf("failed to read private key material: %w", err) + c.Logger.Errorf("Failed to create SFTP client: %v", err) + return fmt.Errorf("failed to create SFTP client: %w", err) } + defer sftpClient.Close() - dialer := NewSSHDial(host, port, sshClientConfig) - - return &SSHConfig{ - Host: host, - Port: port, - User: user, - SSHPrivateKeyPath: sshPrivateKeyPath, - PrivateKeyMaterial: sshPrivateKeyMaterial, - Timeout: SSHTimeOut, - Logger: logger.Get(), - ClientConfig: sshClientConfig, - SSHDial: dialer, - InsecureIgnoreHostKey: false, - }, nil -} - -func getSSHClientConfig(user, host, privateKeyPath string) (*ssh.ClientConfig, error) { - l := logger.Get() - l.Debugf("Getting SSH client config for %s", host) + // Create parent directory if it doesn't exist + parentDir := filepath.Dir(remotePath) + if err := sftpClient.MkdirAll(parentDir); err != nil { + c.Logger.Errorf("Failed to create parent directory %s: %v", parentDir, err) + return fmt.Errorf("failed to create parent directory: %w", err) + } - privateKeyBytes, err := os.ReadFile(privateKeyPath) + // Create or overwrite the file + file, err := sftpClient.Create(remotePath) if err != nil { - return nil, fmt.Errorf("failed to read private key: %v", err) + c.Logger.Errorf("Failed to create remote file %s: %v", remotePath, err) + return fmt.Errorf("failed to create remote file: %w", err) } + defer file.Close() - key, err := getPrivateKey(string(privateKeyBytes)) + // Write content to file + n, err := file.Write(content) if err != nil { - return nil, fmt.Errorf("failed to get private key: %v", err) + c.Logger.Errorf("Failed to write content to %s: %v", remotePath, err) + return fmt.Errorf("failed to write to remote file: %w", err) } + callback(int64(n), int64(len(content))) - // Use a custom host key callback that ignores mismatches and insecure connections - hostKeyCallback := func(hostname string, remote net.Addr, key ssh.PublicKey) error { - // This callback accepts all host keys - return nil + // Set file permissions if executable + if executable { + if err := sftpClient.Chmod(remotePath, 0755); err != nil { //nolint:mnd + c.Logger.Errorf("Failed to set executable permissions on %s: %v", remotePath, err) + return fmt.Errorf("failed to set executable permissions: %w", err) + } } - return &ssh.ClientConfig{ - User: user, - Auth: []ssh.AuthMethod{ - ssh.PublicKeys(key), - }, - HostKeyCallback: hostKeyCallback, - Timeout: SSHClientConfigTimeout, - }, nil + c.Logger.Debugf("Successfully pushed file to %s (size: %d bytes)", remotePath, len(content)) + return nil } -func getPrivateKey(privateKeyMaterial string) (ssh.Signer, error) { - // Check if the key material is empty - if len(privateKeyMaterial) == 0 { - return nil, fmt.Errorf("SSH private key is empty") +func (c *SSHConfig) InstallSystemdService( + ctx context.Context, + serviceName string, + serviceContent string, +) error { + // Create SFTP client + newConn, err := c.clientCreator.NewClient( + c.Host, + c.Port, + c.User, + c.SSHPrivateKeyPath, + c.ClientConfig, + ) + if err != nil { + return fmt.Errorf("failed to create SSH connection: %w", err) } - - // Attempt to parse the private key - privateKey, err := ssh.ParsePrivateKey([]byte(privateKeyMaterial)) + sftpClient, err := currentSFTPClientCreator(newConn) if err != nil { - // Provide more detailed error messages for common key parsing issues - switch { - case strings.Contains(err.Error(), "x509: malformed private key"): - return nil, fmt.Errorf("invalid private key format: malformed key") - case strings.Contains(err.Error(), "x509: unsupported key type"): - return nil, fmt.Errorf("unsupported private key type") - case strings.Contains(err.Error(), "x509: key is encrypted"): - return nil, fmt.Errorf("encrypted private key is not supported: remove passphrase") - case strings.Contains(err.Error(), "failed to parse private key"): - return nil, fmt.Errorf("failed to parse private key: incorrect format or permissions") - default: - return nil, fmt.Errorf("failed to parse private key: %v", err) - } + return fmt.Errorf("failed to create SFTP client: %w", err) } + defer sftpClient.Close() - // Additional validation - if privateKey == nil { - return nil, fmt.Errorf("parsed private key is nil") - } + // Create temporary directory with timestamp + timestamp := time.Now().Unix() + tempDir := fmt.Sprintf("/tmp/andaime-%d", timestamp) + if err := sftpClient.MkdirAll(tempDir); err != nil { + return fmt.Errorf("failed to create temporary directory: %w", err) + } + defer func() { + if out, err := c.ExecuteCommand(ctx, fmt.Sprintf("rm -rf %s", tempDir)); err != nil { + c.Logger.Errorf( + "Failed to cleanup temporary directory %s: %v (output: %s)", + tempDir, + err, + out, + ) + } + }() - // Check key type - switch privateKey.PublicKey().Type() { - case "ssh-rsa", - "ssh-ed25519", - "ecdsa-sha2-nistp256", - "ecdsa-sha2-nistp384", - "ecdsa-sha2-nistp521": - // Supported key types - default: - return nil, fmt.Errorf("unsupported SSH key type: %s", privateKey.PublicKey().Type()) + // Create temporary service file + tempServicePath := fmt.Sprintf("%s/%s.service", tempDir, serviceName) + file, err := sftpClient.Create(tempServicePath) + if err != nil { + return fmt.Errorf("failed to create temporary service file: %w", err) } + defer file.Close() - return privateKey, nil -} - -func (c *SSHConfig) validateSSHConnection() error { - l := logger.Get() + // Write service content to temporary file + if _, err := file.Write([]byte(serviceContent)); err != nil { + return fmt.Errorf("failed to write service content: %w", err) + } + file.Close() - // Validate host and port - if c.Host == "" { - return fmt.Errorf("host is empty") + // Move file to systemd directory with sudo + systemdPath := fmt.Sprintf("/etc/systemd/system/%s.service", serviceName) + moveCmd := fmt.Sprintf("sudo mv %s %s", tempServicePath, systemdPath) + if out, err := c.ExecuteCommand(ctx, moveCmd); err != nil { + return fmt.Errorf( + "failed to move service file to systemd directory: %w (output: %s)", + err, + out, + ) } - if c.Port == 0 { - return fmt.Errorf("port is empty") + // Set correct permissions with sudo + chmodCmd := fmt.Sprintf("sudo chmod 644 %s", systemdPath) + if out, err := c.ExecuteCommand(ctx, chmodCmd); err != nil { + return fmt.Errorf("failed to set service file permissions: %w (output: %s)", err, out) } - // Check if port is open - address := fmt.Sprintf("%s:%d", c.Host, c.Port) - conn, err := net.DialTimeout("tcp", address, SSHDialTimeout) - if err != nil { - l.Debugf("Port %d is closed on host %s", c.Port, c.Host) - return fmt.Errorf("SSH port %d is closed on host %s: %v", c.Port, c.Host, err) + // Reload systemd daemon with sudo + if out, err := c.ExecuteCommand(ctx, "sudo systemctl daemon-reload"); err != nil { + return fmt.Errorf("failed to reload systemd daemon: %w (output: %s)", err, out) + } else { + c.Logger.Infof("systemctl daemon-reload output: %s", out) } - defer conn.Close() - // Validate SSH private key - if _, err := getPrivateKey(string(c.PrivateKeyMaterial)); err != nil { - l.Debugf("Invalid SSH private key: %v", err) - return fmt.Errorf("invalid SSH private key: %v", err) + // Enable service with sudo + if out, err := c.ExecuteCommand(ctx, fmt.Sprintf("sudo systemctl enable %s", serviceName)); err != nil { + return fmt.Errorf("failed to enable service: %w (output: %s)", err, out) + } else { + c.Logger.Infof("systemctl enable %s output: %s", serviceName, out) } return nil } -func (c *SSHConfig) Connect() (SSHClienter, error) { - l := logger.Get() - l.Infof("Connecting to SSH server: %s:%d", c.Host, c.Port) - - // Validate connection prerequisites - if err := c.ValidateSSHConnectionFunc(); err != nil { - return nil, err - } +func (c *SSHConfig) StartService(ctx context.Context, serviceName string) (string, error) { + output, err := c.ExecuteCommand(ctx, fmt.Sprintf("sudo systemctl start %s", serviceName)) + return output, err +} - var err error - var client SSHClienter +func (c *SSHConfig) RestartService(ctx context.Context, serviceName string) (string, error) { + // Attempt to stop the service + stopOutput, stopErr := c.ExecuteCommand(ctx, fmt.Sprintf("sudo systemctl stop %s", serviceName)) - for i := 0; i < SSHRetryAttempts; i++ { - l.Debugf("Attempt %d to connect via SSH\n", i+1) - client, err = c.SSHDial.Dial( - "tcp", - fmt.Sprintf("%s:%d", c.Host, c.Port), - c.ClientConfig, - ) - if err == nil { - break - } + // Wait a short moment + time.Sleep(2 * time.Second) - if netErr, ok := err.(net.Error); ok && netErr.Timeout() { - l.Debugf("timed out waiting to connect to SSH server\n") - continue - } + // Attempt to start the service + startOutput, startErr := c.ExecuteCommand( + ctx, + fmt.Sprintf("sudo systemctl start %s", serviceName), + ) - l.Error(err.Error()) + // Wait another moment + time.Sleep(2 * time.Second) - time.Sleep(SSHRetryDelay) - } + // Check service status + statusOutput, statusErr := c.ExecuteCommand( + ctx, + fmt.Sprintf("sudo systemctl status %s", serviceName), + ) - if err != nil { - if strings.Contains(err.Error(), "connection refused") { - return nil, fmt.Errorf( - "SSH connection refused: check host, port, and firewall settings", - ) - } + // Combine all outputs for logging + combinedOutput := fmt.Sprintf("Stop Output: %s\nStart Output: %s\nStatus Output: %s", + stopOutput, startOutput, statusOutput) - if strings.Contains(err.Error(), "no route to host") { - return nil, fmt.Errorf("no route to host: verify network connectivity") + // Determine the final error + var finalErr error + if stopErr != nil { + finalErr = fmt.Errorf("stop service failed: %w", stopErr) + } + if startErr != nil { + if finalErr != nil { + finalErr = fmt.Errorf("%v; start service failed: %w", finalErr, startErr) + } else { + finalErr = fmt.Errorf("start service failed: %w", startErr) } - - if strings.Contains(err.Error(), "handshake failed") { - return nil, fmt.Errorf( - "SSH handshake failed: check username and private key authentication", - ) + } + if statusErr != nil { + if finalErr != nil { + finalErr = fmt.Errorf("%v; status check failed: %w", finalErr, statusErr) + } else { + finalErr = fmt.Errorf("status check failed: %w", statusErr) } - - return nil, fmt.Errorf("SSH connection failed: %v", err) } - c.SSHClient = client + // Log the full details for debugging + if finalErr != nil { + c.Logger.Errorf("Service restart failed for %s. Details: %s. Error: %v", + serviceName, combinedOutput, finalErr) + } - return client, nil + return combinedOutput, finalErr } -func (c *SSHConfig) WaitForSSH(ctx context.Context, retry int, timeout time.Duration) error { - l := logger.Get() - for i := 0; i < SSHRetryAttempts; i++ { - l.Debugf("Attempt %d to connect via SSH\n", i+1) - client, err := c.Connect() - if err != nil { - err = fmt.Errorf("failed to connect to SSH: %v", err) - l.Error(err.Error()) - time.Sleep(SSHRetryDelay) - continue - } - session, err := client.NewSession() - if err != nil { - err = fmt.Errorf("failed to create SSH session: %v", err) - l.Error(err.Error()) - client.Close() - time.Sleep(SSHRetryDelay) - continue - } - - defer func() { - if client != nil { - client.Close() +// NewSSHConfig creates a new SSH configuration +func NewSSHConfig( + host string, + port int, + user string, + privateKeyPath string, +) (sshutils_interfaces.SSHConfiger, error) { + config := &SSHConfig{ + Host: host, + Port: port, + User: user, + SSHPrivateKeyPath: privateKeyPath, + Logger: logger.Get(), + clientCreator: DefaultSSHClientCreatorInstance, + sftpClientCreator: DefaultSFTPClientCreator, + ValidateSSHConnectionFunc: func() error { + if host == "" { + return fmt.Errorf("host cannot be empty") } - if session != nil { - session.Close() + if port <= 0 { + return fmt.Errorf("invalid port number: %d", port) } - }() - - if session == nil { - err = fmt.Errorf("SSH session is nil despite no error") - l.Error(err.Error()) - time.Sleep(SSHRetryDelay) - continue - } + if user == "" { + return fmt.Errorf("user cannot be empty") + } + if privateKeyPath == "" { + return fmt.Errorf("private key path is empty") + } + return nil + }, + Timeout: SSHDialTimeout, + } - l.Debug("SSH connection established") - return nil + clientConfig, err := getSSHClientConfig(user, privateKeyPath) + if err != nil { + return nil, fmt.Errorf("failed to get SSH client config: %w", err) } + config.ClientConfig = clientConfig - err := fmt.Errorf("failed to establish SSH connection after multiple attempts") - l.Error(err.Error()) - return err + return config, nil } -func (c *SSHConfig) NewSession() (SSHSessioner, error) { - if c.SSHClient == nil { - sshClient, err := ssh.Dial("tcp", fmt.Sprintf("%s:%d", c.Host, c.Port), c.ClientConfig) - if err != nil { - return nil, fmt.Errorf("failed to create SSH client: %w", err) - } - c.SSHClient = &SSHClientWrapper{Client: sshClient} +// Connect establishes an SSH connection +func (c *SSHConfig) Connect() (sshutils_interfaces.SSHClienter, error) { + // If we already have a client, return a wrapper around it + if c.SSHClient != nil { + return NewSSHClientWrapper(c.SSHClient), nil } - if !c.SSHClient.IsConnected() { - connectedClient, err := c.Connect() - if err != nil { - return nil, fmt.Errorf("failed to connect to SSH: %w", err) - } - c.SSHClient.(*SSHClientWrapper).Client = connectedClient.(*SSHClientWrapper).Client + // Create new client using the client creator + client, err := c.clientCreator.NewClient( + c.Host, + c.Port, + c.User, + c.SSHPrivateKeyPath, + c.ClientConfig, + ) + if err != nil { + return nil, fmt.Errorf("failed to create SSH client: %w", err) + } + + // Store the underlying SSH client + if sshClient, ok := client.(*SSHClientWrapper); ok { + c.SSHClient = sshClient.Client } - return c.SSHClient.NewSession() + return client, nil } -func (c *SSHConfig) ExecuteCommand(ctx context.Context, command string) (string, error) { - return c.ExecuteCommandWithCallback(ctx, command, nil) +// SetClientCreator allows injection of a custom client creator (useful for testing) +func (c *SSHConfig) SetSSHClientCreator(creator sshutils_interfaces.SSHClientCreator) { + c.clientCreator = creator } -// ExecuteCommandWithCallback runs a command on the remote server over SSH. -// It takes the command as a string argument. -// It retries the execution a configurable number of times if it fails. -// It returns the output of the command as a string and any error encountered. -func (c *SSHConfig) ExecuteCommandWithCallback(ctx context.Context, - command string, - callback func(string)) (string, error) { - l := logger.Get() - l.Infof("Executing command: %s", command) +func (c *SSHConfig) ExecuteCommand(ctx context.Context, command string) (string, error) { + // Create a new connection specifically for this command + client, err := c.clientCreator.NewClient( + c.Host, + c.Port, + c.User, + c.SSHPrivateKeyPath, + c.ClientConfig, + ) + if err != nil { + c.Logger.Errorf("Failed to create SSH connection for command %s: %v", command, err) + return "", fmt.Errorf("SSH connection failed: %w", err) + } + defer client.Close() - var output string - err := retry(SSHRetryAttempts, SSHRetryDelay, func() error { - session, err := c.NewSession() - if err != nil { - return fmt.Errorf("failed to create session: %w", err) - } - defer session.Close() + session, err := client.NewSession() + if err != nil { + c.Logger.Errorf("Failed to create session for command %s: %v", command, err) + return "", fmt.Errorf("failed to create session: %w", err) + } + defer session.Close() - outputBytes, err := session.CombinedOutput(command) - if err != nil { - return fmt.Errorf("failed to execute command: %w", err) - } - output = string(outputBytes) - return nil - }) + var output strings.Builder + session.SetStdout(&output) + session.SetStderr(&output) - return output, err + if err := session.Run(command); err != nil { + c.Logger.Errorf("Failed to run command %s: %v", command, err) + return output.String(), fmt.Errorf("command execution failed: %w", err) + } + + return output.String(), nil } func (c *SSHConfig) PushFile( @@ -384,225 +430,294 @@ func (c *SSHConfig) PushFile( content []byte, executable bool, ) error { - return c.PushFileWithCallback(ctx, - remotePath, - content, - executable, - NullCallback, - ) + return c.PushFileWithCallback(ctx, remotePath, content, executable, func(int64, int64) {}) } -// SFTPFile interface defines the file operations we need -type SFTPFile interface { - io.WriteCloser -} +func getSSHClientConfig(user, privateKeyPath string) (*ssh.ClientConfig, error) { + if privateKeyPath == "" { + return nil, fmt.Errorf("private key path is empty") + } -// SFTPClient interface defines the SFTP operations we need -type SFTPClient interface { - MkdirAll(path string) error - Create(path string) (SFTPFile, error) - Chmod(path string, mode os.FileMode) error - Close() error -} + // Expand the path to handle ~ + expandedPath := os.ExpandEnv(privateKeyPath) + if strings.HasPrefix(expandedPath, "~/") { + home, err := os.UserHomeDir() + if err != nil { + return nil, fmt.Errorf("failed to get home directory: %w", err) + } + expandedPath = filepath.Join(home, expandedPath[2:]) + } -// SFTPClientCreator is a function type for creating SFTP clients -type SFTPClientCreator func(client *ssh.Client) (SFTPClient, error) + privateKeyBytes, err := os.ReadFile(expandedPath) + if err != nil { + return nil, fmt.Errorf("failed to read private key from %s: %w", privateKeyPath, err) + } -// Default SFTP client creator that uses the real sftp.NewClient -var defaultSFTPClientCreator = func(client *ssh.Client) (SFTPClient, error) { - return &sftpClientWrapper{client: client}, nil -} + signer, err := getPrivateKey(string(privateKeyBytes)) + if err != nil { + return nil, fmt.Errorf("failed to parse private key: %w", err) + } -// Current SFTP client creator - can be overridden in tests -var currentSFTPClientCreator = defaultSFTPClientCreator + config := &ssh.ClientConfig{ + User: user, + Auth: []ssh.AuthMethod{ + ssh.PublicKeys(signer), + }, + HostKeyCallback: ssh.InsecureIgnoreHostKey(), //nolint:gosec + Timeout: SSHDialTimeout, + } -// sftpClientWrapper wraps the real sftp.Client to implement our interface -type sftpClientWrapper struct { - client *ssh.Client - sftp *sftp.Client + return config, nil } -func (w *sftpClientWrapper) init() error { - if w.sftp == nil { - client, err := sftp.NewClient(w.client) - if err != nil { - return err - } - w.sftp = client +func getPrivateKey(privateKeyMaterial string) (ssh.Signer, error) { + privateKey, err := ssh.ParsePrivateKey([]byte(privateKeyMaterial)) + if err != nil { + return nil, fmt.Errorf("failed to parse private key: %w", err) } - return nil + return privateKey, nil } -func (w *sftpClientWrapper) MkdirAll(path string) error { - if err := w.init(); err != nil { - return err +func currentSFTPClientCreator(client sshutils_interfaces.SSHClienter) (*sftp.Client, error) { + sshClient := client.GetClient() + if sshClient == nil { + return nil, fmt.Errorf("invalid SSH client") } - return w.sftp.MkdirAll(path) + return sftp.NewClient(sshClient) } -func (w *sftpClientWrapper) Create(path string) (SFTPFile, error) { - if err := w.init(); err != nil { - return nil, err +// DefaultSSHClientCreator implements SSHClientCreator interface +type DefaultSSHClientCreator struct{} + +func (d *DefaultSSHClientCreator) NewClient( + host string, + port int, + user string, + privateKeyPath string, + config *ssh.ClientConfig, +) (sshutils_interfaces.SSHClienter, error) { + client, err := ssh.Dial("tcp", fmt.Sprintf("%s:%d", host, port), config) + if err != nil { + return nil, fmt.Errorf("failed to dial: %w", err) } - return w.sftp.Create(path) + + return NewSSHClientWrapper(client), nil } -func (w *sftpClientWrapper) Chmod(path string, mode os.FileMode) error { - if err := w.init(); err != nil { +// DefaultSSHClientCreatorInstance is the default SSH client creator instance +var DefaultSSHClientCreatorInstance = &DefaultSSHClientCreator{} + +// Close closes the SSH client connection +func (c *SSHConfig) Close() error { + if c.SSHClient != nil { + err := c.SSHClient.Close() + c.SSHClient = nil return err } - return w.sftp.Chmod(path, mode) + return nil } -func (w *sftpClientWrapper) Close() error { - if w.sftp != nil { - return w.sftp.Close() - } - return nil +// GetHost returns the SSH host +func (c *SSHConfig) GetHost() string { + return c.Host } -func (c *SSHConfig) PushFileWithCallback( - ctx context.Context, - remotePath string, - content []byte, - executable bool, - _ func(int64, int64), -) error { - l := logger.Get() - l.Infof("Pushing file to: %s", remotePath) +// GetPort returns the SSH port +func (c *SSHConfig) GetPort() int { + return c.Port +} - // Get the SSH client - sshClient := c.GetSSHClient() - if sshClient == nil { - return fmt.Errorf("SSH client is nil") - } +// GetUser returns the SSH user +func (c *SSHConfig) GetUser() string { + return c.User +} - // Create a new SFTP client using the current creator - sftpClient, err := currentSFTPClientCreator(sshClient) - if err != nil { - return fmt.Errorf("failed to create SFTP client: %w", err) +// GetPrivateKeyMaterial returns the SSH private key material +func (c *SSHConfig) GetPrivateKeyMaterial() []byte { + return c.PrivateKeyMaterial +} + +func (c *SSHConfig) GetSSHPrivateKeyPath() string { + return c.SSHPrivateKeyPath +} + +// SetValidateSSHConnection sets the SSH connection validation function +func (c *SSHConfig) SetValidateSSHConnection(fn func() error) { + c.ValidateSSHConnectionFunc = fn +} + +// GetSSHClient returns the underlying SSH client +func (c *SSHConfig) GetSSHClient() *ssh.Client { + if c.SSHClient == nil { + return nil } - defer sftpClient.Close() + return c.SSHClient +} - // Create the parent directory if it doesn't exist - parentDir := filepath.Dir(remotePath) - if err := sftpClient.MkdirAll(parentDir); err != nil { - return fmt.Errorf("failed to create parent directory: %w", err) +// SetSSHClient sets the SSH client +func (c *SSHConfig) SetSSHClient(client *ssh.Client) { + if client == nil { + c.SSHClient = nil + } else { + c.SSHClient = client } +} - // Create the remote file - remoteFile, err := sftpClient.Create(remotePath) - if err != nil { - return fmt.Errorf("failed to create remote file: %w", err) +// WaitForSSH waits for SSH connection to be available +func (c *SSHConfig) WaitForSSH(ctx context.Context, retry int, timeout time.Duration) error { + var lastErr error + deadline := time.Now().Add(timeout) + + // Try immediately first + if _, err := c.clientCreator.NewClient( + c.Host, + c.Port, + c.User, + c.SSHPrivateKeyPath, + c.ClientConfig, + ); err == nil { + return nil + } else { + lastErr = err + fmt.Printf("Could not connect: %v\nRetrying in %v seconds...\n", err, SSHRetryDelay.Seconds()) + } + + // If first attempt fails, start retrying with backoff + ticker := time.NewTicker(SSHRetryDelay) + defer ticker.Stop() + + attempts := 1 + + for attempts < retry && time.Now().Before(deadline) { + select { + case <-ctx.Done(): + return fmt.Errorf("context cancelled while waiting for SSH: %w", lastErr) + case <-ticker.C: + // Try to connect + if _, err := c.clientCreator.NewClient( + c.Host, + c.Port, + c.User, + c.SSHPrivateKeyPath, + c.ClientConfig, + ); err == nil { + return nil + } else { + lastErr = err + attempts++ + fmt.Printf("Could not connect: %v\nRetrying in %v seconds... (attempt %d/%d)\n", + err, SSHRetryDelay.Seconds(), attempts, retry) + } + } } - defer remoteFile.Close() - // Write the content to the remote file - if _, err := remoteFile.Write(content); err != nil { - return fmt.Errorf("failed to write to remote file: %w", err) + if attempts >= retry { + return fmt.Errorf("max retries (%d) exceeded: %w", retry, lastErr) } - // If the file should be executable, set the permissions - if executable { - if err := sftpClient.Chmod(remotePath, 0700); err != nil { - return fmt.Errorf("failed to set file permissions: %w", err) - } + if time.Now().After(deadline) { + return fmt.Errorf("timeout after %v: %w", timeout, lastErr) } - return nil + return lastErr } -func (c *SSHConfig) InstallSystemdService( - ctx context.Context, - serviceName, - serviceContent string, -) error { - l := logger.Get() - l.Infof("Installing systemd service: %s", serviceName) - remoteServicePath := fmt.Sprintf("/etc/systemd/system/%s.service", serviceName) +// GetSSHClientCreator returns the SSH client creator +func (c *SSHConfig) GetSSHClientCreator() sshutils_interfaces.SSHClientCreator { + return c.clientCreator +} - session, err := c.NewSession() - if err != nil { - return fmt.Errorf("failed to create session: %w", err) - } - defer session.Close() +// Add IsConnected method +func (c *SSHConfig) IsConnected() bool { + return c.SSHClient != nil +} - cmd := fmt.Sprintf("echo '%s' | sudo tee %s > /dev/null", serviceContent, remoteServicePath) - err = session.Run(cmd) - if err != nil { - return fmt.Errorf("failed to create service file: %w", err) - } +// Add these methods after the existing methods +func (c *SSHConfig) SetSFTPClientCreator(creator sshutils_interfaces.SFTPClientCreator) { + c.sftpClientCreator = creator +} - return nil +func (c *SSHConfig) GetSFTPClientCreator() sshutils_interfaces.SFTPClientCreator { + return c.sftpClientCreator } -func (c *SSHConfig) StartService(ctx context.Context, serviceName string) error { - return c.manageService(ctx, serviceName, "start") +// SSHSessionWrapper implements SSHSessioner interface +type SSHSessionWrapper struct { + Session *ssh.Session } -func (c *SSHConfig) RestartService(ctx context.Context, serviceName string) error { - return c.manageService(ctx, serviceName, "restart") +func (w *SSHSessionWrapper) Run(cmd string) error { + return w.Session.Run(cmd) } -func (c *SSHConfig) manageService(_ context.Context, serviceName, action string) error { - l := logger.Get() - l.Infof("Managing service: %s %s", serviceName, action) - session, err := c.NewSession() - if err != nil { - return fmt.Errorf("failed to create session: %w", err) - } - defer session.Close() +func (w *SSHSessionWrapper) Close() error { + return w.Session.Close() +} - cmd := fmt.Sprintf("sudo systemctl %s %s", action, serviceName) - err = session.Run(cmd) - if err != nil { - return fmt.Errorf("failed to %s service: %w", action, err) - } +func (w *SSHSessionWrapper) SetStdout(writer io.Writer) { + w.Session.Stdout = writer +} - return nil +func (w *SSHSessionWrapper) SetStderr(writer io.Writer) { + w.Session.Stderr = writer } -func (c *SSHConfig) GetHost() string { - return c.Host +func (w *SSHSessionWrapper) CombinedOutput(cmd string) ([]byte, error) { + return w.Session.CombinedOutput(cmd) } -func (c *SSHConfig) GetPort() int { - return c.Port +func (w *SSHSessionWrapper) StdinPipe() (io.WriteCloser, error) { + return w.Session.StdinPipe() } -func (c *SSHConfig) GetUser() string { - return c.User +func (w *SSHSessionWrapper) Start(cmd string) error { + return w.Session.Start(cmd) } -func (c *SSHConfig) GetPrivateKeyMaterial() []byte { - return c.PrivateKeyMaterial +func (w *SSHSessionWrapper) Wait() error { + return w.Session.Wait() } -func (c *SSHConfig) GetSSHDial() SSHDialer { - return c.SSHDial +func (w *SSHSessionWrapper) Signal(sig ssh.Signal) error { + return w.Session.Signal(sig) } -func (c *SSHConfig) SetSSHDial(dialer SSHDialer) { - c.SSHDial = dialer +// SSHClientWrapper implements SSHClienter interface +type SSHClientWrapper struct { + Client *ssh.Client } -func (c *SSHConfig) SetValidateSSHConnection(fn func() error) { - c.ValidateSSHConnectionFunc = fn +func (w *SSHClientWrapper) NewSession() (sshutils_interfaces.SSHSessioner, error) { + if w.Client == nil { + return nil, fmt.Errorf("SSH client is not connected") + } + session, err := w.Client.NewSession() + if err != nil { + return nil, fmt.Errorf("failed to create SSH session: %w", err) + } + return &SSHSessionWrapper{Session: session}, nil +} + +func (w *SSHClientWrapper) Close() error { + if w.Client != nil { + return w.Client.Close() + } + return nil } -func (c *SSHConfig) GetSSHClienter() SSHClienter { return c.SSHClient } +func (w *SSHClientWrapper) GetClient() *ssh.Client { + return w.Client +} -func (c *SSHConfig) SetSSHClienter(client SSHClienter) { - c.SSHClient = client +func (w *SSHClientWrapper) Connect() (sshutils_interfaces.SSHClienter, error) { + return w, nil } -func (c *SSHConfig) GetSSHClient() *ssh.Client { - if c.SSHClient == nil { - return nil - } - return c.SSHClient.GetClient() +func (w *SSHClientWrapper) IsConnected() bool { + return w.Client != nil } -func (c *SSHConfig) SetSSHClient(client *ssh.Client) { - c.SetSSHClienter(&SSHClientWrapper{Client: client}) +// NewSSHClientWrapper creates a new SSHClientWrapper +func NewSSHClientWrapper(client *ssh.Client) *SSHClientWrapper { + return &SSHClientWrapper{Client: client} } diff --git a/pkg/sshutils/ssh_config_mock.go b/pkg/sshutils/ssh_config_mock.go index 0dd20d12..eb16eee4 100644 --- a/pkg/sshutils/ssh_config_mock.go +++ b/pkg/sshutils/ssh_config_mock.go @@ -1,268 +1,15 @@ package sshutils -import ( - "context" - "encoding/json" - "fmt" - "time" - - "github.com/stretchr/testify/mock" - "golang.org/x/crypto/ssh" -) - -// ExpectedSSHBehavior holds the expected outcomes for SSH methods -type ExpectedSSHBehavior struct { - PushFileExpectations []PushFileExpectation - ExecuteCommandExpectations []ExecuteCommandExpectation - InstallSystemdServiceExpectation *Expectation - RestartServiceExpectation *Expectation -} - -type PushFileExpectation struct { - Dst string - FileContents []byte - Executable bool - ProgressCallback interface{} - Error error - Times int -} - -type ExecuteCommandExpectation struct { - Cmd string - CmdMatcher func(string) bool - ProgressCallback interface{} - Output interface{} - Error error - Times int -} - -type Expectation struct { - Error error - Times int -} - -// NewMockSSHConfigWithBehavior creates a mock SSHConfig based on the expected behavior -func NewMockSSHConfigWithBehavior(behavior ExpectedSSHBehavior) *MockSSHConfig { - mockSSHConfig := new(MockSSHConfig) - - for _, exp := range behavior.PushFileExpectations { - call := mockSSHConfig.On( - "PushFile", - mock.Anything, // ctx - exp.Dst, - mock.Anything, // fileContents - exp.Executable, - ) - call.Return(exp.Error) - if exp.Times > 0 { - call.Times(exp.Times) - } - } - - for _, exp := range behavior.ExecuteCommandExpectations { - var cmdArg interface{} - if exp.CmdMatcher != nil { - cmdArg = mock.MatchedBy(exp.CmdMatcher) - } else { - cmdArg = exp.Cmd - } - call := mockSSHConfig.On( - "ExecuteCommand", - mock.Anything, // ctx - cmdArg, - ) - call.Return(exp.Output, exp.Error) - if exp.Times > 0 { - call.Times(exp.Times) - } - } - - if behavior.InstallSystemdServiceExpectation != nil { - call := mockSSHConfig.On( - "InstallSystemdService", - mock.Anything, // ctx - mock.Anything, // serviceName - mock.Anything, // serviceContent - ) - call.Return(behavior.InstallSystemdServiceExpectation.Error) - if behavior.InstallSystemdServiceExpectation.Times > 0 { - call.Times(behavior.InstallSystemdServiceExpectation.Times) - } - } - - if behavior.RestartServiceExpectation != nil { - call := mockSSHConfig.On( - "RestartService", - mock.Anything, // ctx - mock.Anything, // serviceName - ) - call.Return(behavior.RestartServiceExpectation.Error) - if behavior.RestartServiceExpectation.Times > 0 { - call.Times(behavior.RestartServiceExpectation.Times) - } - } - - return mockSSHConfig +// CommandBehavior defines expected command behavior +type CommandBehavior struct { + Output string + Error error } -// MockSSHConfig is a mock implementation of SSHConfiger -type MockSSHConfig struct { - mock.Mock - lastOutput string +// ServiceBehavior defines expected service behavior +type ServiceBehavior struct { + Name string + Content string + Output string + Error error } - -func (m *MockSSHConfig) PushFile( - ctx context.Context, - dst string, - fileContents []byte, - executable bool, -) error { - fmt.Printf("PushFile called with: %s\n", dst) - args := m.Called(ctx, dst, fileContents, executable) - return args.Error(0) -} - -func (m *MockSSHConfig) PushFileWithCallback( - ctx context.Context, - dst string, - fileContents []byte, - executable bool, - progressCallback func(int64, int64), -) error { - args := m.Called(ctx, dst, fileContents, executable, progressCallback) - return args.Error(0) -} - -func (m *MockSSHConfig) ExecuteCommand( - ctx context.Context, - cmd string, -) (string, error) { - fmt.Printf("ExecuteCommand called with: %s\n", cmd) - args := m.Called(ctx, cmd) - if args.Get(0) == nil { - return "", args.Error(1) - } - // Try to convert the result to a string - switch v := args.Get(0).(type) { - case string: - return v, args.Error(1) - case []byte: - return string(v), args.Error(1) - default: - // If it's not a string or []byte, convert it to a JSON string - jsonBytes, err := json.Marshal(v) - if err != nil { - return "", fmt.Errorf("failed to convert mock result to string: %v", err) - } - return string(jsonBytes), args.Error(1) - } -} - -func (m *MockSSHConfig) ExecuteCommandWithCallback( - ctx context.Context, - cmd string, - progressCallback func(string), -) (string, error) { - args := m.Called(ctx, cmd, progressCallback) - return args.Get(0).(string), args.Error(1) -} - -func (m *MockSSHConfig) InstallSystemdService( - ctx context.Context, - serviceName string, - serviceContent string, -) error { - args := m.Called(ctx, serviceName, serviceContent) - return args.Error(0) -} - -func (m *MockSSHConfig) RestartService(ctx context.Context, serviceName string) error { - args := m.Called(ctx, serviceName) - return args.Error(0) -} - -func (m *MockSSHConfig) Connect() (SSHClienter, error) { - args := m.Called() - return args.Get(0).(SSHClienter), args.Error(1) -} - -func (m *MockSSHConfig) Close() error { return nil } - -func (m *MockSSHConfig) WaitForSSH( - ctx context.Context, - retries int, - retryDelay time.Duration, -) error { - args := m.Called(ctx, retries, retryDelay) - return args.Error(0) -} - -func (m *MockSSHConfig) StartService( - ctx context.Context, - serviceName string, -) error { - return nil -} - -func (m *MockSSHConfig) GetLastOutput() string { - return m.lastOutput -} - -func (m *MockSSHConfig) GetHost() string { - args := m.Called() - return args.String(0) -} - -func (m *MockSSHConfig) GetPort() int { - args := m.Called() - return args.Int(0) -} - -func (m *MockSSHConfig) GetUser() string { - args := m.Called() - return args.String(0) -} - -func (m *MockSSHConfig) GetPrivateKeyMaterial() []byte { - args := m.Called() - if ret := args.Get(0); ret != nil { - return ret.([]byte) - } - return nil -} - -func (m *MockSSHConfig) GetSSHDial() SSHDialer { - args := m.Called() - return args.Get(0).(SSHDialer) -} - -func (m *MockSSHConfig) SetSSHDial(dialer SSHDialer) { - m.Called(dialer) -} - -func (m *MockSSHConfig) SetValidateSSHConnection(callback func() error) { - m.Called(callback) -} - -func (m *MockSSHConfig) GetSSHClienter() SSHClienter { - args := m.Called() - return args.Get(0).(SSHClienter) -} - -func (m *MockSSHConfig) SetSSHClienter(clienter SSHClienter) { - m.Called(clienter) -} - -func (m *MockSSHConfig) GetSSHClient() *ssh.Client { - args := m.Called() - if ret := args.Get(0); ret != nil { - return ret.(*ssh.Client) - } - return nil -} - -func (m *MockSSHConfig) SetSSHClient(client *ssh.Client) { - m.Called(client) -} - -var _ SSHConfiger = &MockSSHConfig{} diff --git a/pkg/sshutils/ssh_config_test.go b/pkg/sshutils/ssh_config_test.go new file mode 100644 index 00000000..4cdb7008 --- /dev/null +++ b/pkg/sshutils/ssh_config_test.go @@ -0,0 +1,89 @@ +package sshutils + +import ( + "testing" + + "github.com/bacalhau-project/andaime/internal/testutil" + "github.com/stretchr/testify/assert" +) + +func TestSSHConfigValidation(t *testing.T) { + _, + cleanupPrivateKey, + testPrivateKeyPath, + cleanupPublicKey := testutil.CreateSSHPublicPrivateKeyPairOnDisk() + defer cleanupPrivateKey() + defer cleanupPublicKey() + + tests := []struct { + name string + host string + port int + user string + keyPath string + expectedError string + }{ + { + name: "valid config", + host: "example.com", + port: 22, + user: "testuser", + keyPath: testPrivateKeyPath, + expectedError: "", + }, + { + name: "empty host", + host: "", + port: 22, + user: "testuser", + keyPath: testPrivateKeyPath, + expectedError: "host cannot be empty", + }, + { + name: "invalid port", + host: "example.com", + port: 0, + user: "testuser", + keyPath: testPrivateKeyPath, + expectedError: "invalid port number: 0", + }, + { + name: "empty user", + host: "example.com", + port: 22, + user: "", + keyPath: testPrivateKeyPath, + expectedError: "user cannot be empty", + }, + { + name: "empty key path", + host: "example.com", + port: 22, + user: "testuser", + keyPath: "", + expectedError: "private key path is empty", + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + // Create config with mocked key reader + config, err := NewSSHConfigFunc(tt.host, tt.port, tt.user, tt.keyPath) + if tt.expectedError != "" { + if err == nil { + // If validation function exists, test it directly + if config != nil { + err = config.(*SSHConfig).ValidateSSHConnectionFunc() + } + } + assert.Contains(t, err.Error(), tt.expectedError) + } else { + assert.NoError(t, err) + assert.NotNil(t, config) + // Test validation function + err = config.(*SSHConfig).ValidateSSHConnectionFunc() + assert.NoError(t, err) + } + }) + } +} diff --git a/pkg/sshutils/ssh_dial.go b/pkg/sshutils/ssh_dial.go deleted file mode 100644 index 753bcaef..00000000 --- a/pkg/sshutils/ssh_dial.go +++ /dev/null @@ -1,135 +0,0 @@ -package sshutils - -import ( - "context" - - "github.com/stretchr/testify/mock" - "golang.org/x/crypto/ssh" - - internal_testutil "github.com/bacalhau-project/andaime/internal/testutil" -) - -var SSHDialerFunc = NewSSHDial - -type SSHDialer interface { - Dial(network, addr string, config *ssh.ClientConfig) (SSHClienter, error) - DialContext( - ctx context.Context, - network, addr string, - config *ssh.ClientConfig, - ) (SSHClienter, error) -} - -func NewSSHDial(host string, port int, config *ssh.ClientConfig) SSHDialer { - return &SSHDial{ - DialCreator: func(network, addr string, config *ssh.ClientConfig) (SSHClienter, error) { - client, err := ssh.Dial(network, addr, config) - if err != nil { - return nil, err - } - return &SSHClientWrapper{Client: client}, nil - }, - } -} - -type SSHDial struct { - DialCreator func(network, addr string, config *ssh.ClientConfig) (SSHClienter, error) -} - -func (d *SSHDial) Dial(network, addr string, config *ssh.ClientConfig) (SSHClienter, error) { - return d.DialCreator(network, addr, config) -} - -func (d *SSHDial) DialContext( - ctx context.Context, - network, addr string, - config *ssh.ClientConfig, -) (SSHClienter, error) { - // Create a channel to receive the dial result - type dialResult struct { - client SSHClienter - err error - } - result := make(chan dialResult, 1) - - // Start dialing in a goroutine - go func() { - client, err := d.Dial(network, addr, config) - result <- dialResult{client, err} - }() - - // Wait for either context cancellation or dial completion - select { - case <-ctx.Done(): - return nil, ctx.Err() - case res := <-result: - return res.client, res.err - } -} - -// Mock Functions - -// MockSSHDialer is a mock implementation of SSHDialer -type MockSSHDialer struct { - mock.Mock -} - -// MockSSHClient is a mock implementation of SSHClienter -type MockSFTPClient struct { - mock.Mock -} - -// Dial is a mock implementation of the Dial method -func (m *MockSSHDialer) Dial(network, addr string, config *ssh.ClientConfig) (SSHClienter, error) { - args := m.Called(network, addr, config) - if args.Get(1) != nil { - return nil, args.Error(1) - } - return args.Get(0).(SSHClienter), nil -} - -// DialContext is a mock implementation of the DialContext method -func (m *MockSSHDialer) DialContext( - ctx context.Context, - network, addr string, - config *ssh.ClientConfig, -) (SSHClienter, error) { - args := m.Called(ctx, network, addr, config) - if args.Get(1) != nil { - return nil, args.Error(1) - } - return args.Get(0).(SSHClienter), nil -} - -// NewMockSSHDialer returns a MockSSHDialer with a default implementation -func NewMockSSHDialer() *MockSSHDialer { - return &MockSSHDialer{} -} - -func NewMockSFTPClient() *MockSFTPClient { - return &MockSFTPClient{} -} - -func NewMockSSHClient(dialer SSHDialer) (*MockSSHClient, SSHConfiger) { - _, - cleanupPublicKey, - testSSHPrivateKeyPath, - cleanupPrivateKey := internal_testutil.CreateSSHPublicPrivateKeyPairOnDisk() - defer cleanupPublicKey() - defer cleanupPrivateKey() - - configInterface, err := NewSSHConfigFunc( - "example.com", - 22, //nolint:mnd - "testuser", - testSSHPrivateKeyPath, - ) //nolint:mnd - if err != nil { - panic(err) - } - config := configInterface - config.SetSSHClienter(&MockSSHClient{}) - - mockClient := &MockSSHClient{} - return mockClient, config -} diff --git a/pkg/sshutils/ssh_session.go b/pkg/sshutils/ssh_session.go index b9a67896..adbf9a06 100644 --- a/pkg/sshutils/ssh_session.go +++ b/pkg/sshutils/ssh_session.go @@ -3,20 +3,10 @@ package sshutils import ( "encoding/base64" "fmt" - "io" "strings" ) -type SSHSessioner interface { - Run(cmd string) error - Start(cmd string) error - Wait() error - Close() error - StdinPipe() (io.WriteCloser, error) - StdoutPipe() (io.Reader, error) - StderrPipe() (io.Reader, error) - CombinedOutput(cmd string) ([]byte, error) -} +// SSHSessioner is now defined in interfaces.go // ValidateSSHPublicKey checks if the provided SSH public key is valid func ValidateSSHPublicKey(key string) error { diff --git a/pkg/sshutils/ssh_session_wrapper.go b/pkg/sshutils/ssh_session_wrapper.go index 15defc3f..0726396c 100644 --- a/pkg/sshutils/ssh_session_wrapper.go +++ b/pkg/sshutils/ssh_session_wrapper.go @@ -1,9 +1 @@ package sshutils - -import ( - "golang.org/x/crypto/ssh" -) - -func (s *SSHSessionWrapper) Signal(sig ssh.Signal) error { - return s.Session.Signal(sig) -} diff --git a/pkg/sshutils/sshutils_test.go b/pkg/sshutils/sshutils_test.go index 9a2a06c0..6c4f5390 100644 --- a/pkg/sshutils/sshutils_test.go +++ b/pkg/sshutils/sshutils_test.go @@ -1,13 +1,13 @@ package sshutils import ( - "bytes" "context" - "fmt" - "os" + "io" "testing" "github.com/bacalhau-project/andaime/internal/testutil" + ssh_mock "github.com/bacalhau-project/andaime/mocks/sshutils" + sshutils_interfaces "github.com/bacalhau-project/andaime/pkg/models/interfaces/sshutils" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" "golang.org/x/crypto/ssh" @@ -17,11 +17,8 @@ type PkgSSHUtilsTestSuite struct { suite.Suite testSSHPrivateKeyPath string cleanupPrivateKey func() - mockDialer *MockSSHDialer - mockClient *MockSSHClient - mockSession *MockSSHSession - sshConfig SSHConfiger ctx context.Context + sshConfig sshutils_interfaces.SSHConfiger } func (s *PkgSSHUtilsTestSuite) SetupSuite() { @@ -36,245 +33,55 @@ func (s *PkgSSHUtilsTestSuite) SetupSuite() { func (s *PkgSSHUtilsTestSuite) SetupTest() { s.ctx = context.Background() - s.mockDialer = NewMockSSHDialer() - s.mockClient = &MockSSHClient{} - s.mockSession = &MockSSHSession{} - s.sshConfig, _ = NewSSHConfigFunc( - "example.com", - 22, //nolint:mnd - "testuser", - s.testSSHPrivateKeyPath, - ) - - s.sshConfig.SetSSHDial(s.mockDialer) - s.sshConfig.SetSSHClienter(s.mockClient) - - // Mock the validateSSHConnection method to bypass network checks - s.sshConfig.SetValidateSSHConnection(func() error { - return nil - }) -} - -func (s *PkgSSHUtilsTestSuite) TestConnect() { - s.mockDialer.On("Dial", "tcp", "example.com:22", mock.AnythingOfType("*ssh.ClientConfig")). - Return(s.mockClient, nil) - - client, err := s.sshConfig.Connect() - s.NoError(err) - s.NotNil(client) - s.IsType(&MockSSHClient{}, client) - - s.mockDialer.AssertExpectations(s.T()) -} - -func (s *PkgSSHUtilsTestSuite) TestConnectFailure() { - expectedError := fmt.Errorf("connection error") - s.mockDialer.On("Dial", "tcp", "example.com:22", mock.AnythingOfType("*ssh.ClientConfig")). - Return(nil, expectedError) - - client, err := s.sshConfig.Connect() - s.Error(err) - s.Nil(client) - s.Contains(err.Error(), "connection error") - s.mockDialer.AssertExpectations(s.T()) + sshConfig, err := NewSSHConfig("test-host", 22, "test-user", s.testSSHPrivateKeyPath) + s.Require().NoError(err) + s.sshConfig = sshConfig } func (s *PkgSSHUtilsTestSuite) TestExecuteCommand() { - s.mockClient.On("NewSession").Return(s.mockSession, nil) - s.mockClient.On("IsConnected").Return(true) - expectedOutput := []byte("command output") - s.mockSession.On("CombinedOutput", "ls -l").Return(expectedOutput, nil) - s.mockSession.On("Close").Return(nil) - - actualResult, err := s.sshConfig.ExecuteCommand(s.ctx, "ls -l") - s.NoError(err) - s.Equal(string(expectedOutput), actualResult) - - s.mockClient.AssertExpectations(s.T()) - s.mockSession.AssertExpectations(s.T()) -} - -func (s *PkgSSHUtilsTestSuite) TestExecuteCommandWithRetry() { - s.mockClient.On("NewSession").Return(s.mockSession, nil) - s.mockClient.On("IsConnected").Return(true) - expectedOutput := []byte("command output") - s.mockSession.On("CombinedOutput", "ls -l"). - Return([]byte{}, fmt.Errorf("temporary error")).Once(). - On("CombinedOutput", "ls -l").Return(expectedOutput, nil).Once() - s.mockSession.On("Close").Return(nil).Times(2) - - actualResult, err := s.sshConfig.ExecuteCommand(s.ctx, "ls -l") - s.NoError(err) - s.Equal(string(expectedOutput), actualResult) - - s.mockClient.AssertExpectations(s.T()) - s.mockSession.AssertNumberOfCalls(s.T(), "CombinedOutput", 2) - s.mockSession.AssertExpectations(s.T()) -} - -type mockWriteCloser struct { - *bytes.Buffer - closeFunc func() error -} - -func (m *mockWriteCloser) Close() error { - if m.closeFunc != nil { - return m.closeFunc() - } - return nil -} - -type mockSFTPClient struct { - mock.Mock -} - -// Verify that mockSFTPClient implements SFTPClient -var _ SFTPClient = &mockSFTPClient{} - -func (m *mockSFTPClient) MkdirAll(path string) error { - args := m.Called(path) - return args.Error(0) -} - -func (m *mockSFTPClient) Create(path string) (SFTPFile, error) { - args := m.Called(path) - return args.Get(0).(SFTPFile), args.Error(1) -} - -func (m *mockSFTPClient) Chmod(path string, mode os.FileMode) error { - args := m.Called(path, mode) - return args.Error(0) -} - -func (m *mockSFTPClient) Close() error { - args := m.Called() - return args.Error(0) -} - -type mockSFTPFile struct { - mock.Mock -} - -func (m *mockSFTPFile) Write(p []byte) (int, error) { - args := m.Called(p) - return args.Int(0), args.Error(1) -} - -func (m *mockSFTPFile) Close() error { - args := m.Called() - return args.Error(0) -} - -func (s *PkgSSHUtilsTestSuite) TestPushFile() { - s.runPushFileTest(false) -} - -func (s *PkgSSHUtilsTestSuite) TestPushFileExecutable() { - s.runPushFileTest(true) -} - -func (s *PkgSSHUtilsTestSuite) runPushFileTest(executable bool) { - localContent := []byte("test file content") - if executable { - localContent = []byte("#!/bin/bash\necho 'Hello, World!'") - } - - // Create mock SFTP file - mockFile := &mockSFTPFile{} - mockFile.On("Write", localContent).Return(len(localContent), nil) - mockFile.On("Close").Return(nil) - - // Create mock SFTP client - mockSFTP := &mockSFTPClient{} - mockSFTP.On("MkdirAll", "/remote").Return(nil) - mockSFTP.On("Create", "/remote/path").Return(mockFile, nil) - if executable { - mockSFTP.On("Chmod", "/remote/path", os.FileMode(0700)).Return(nil) - } - mockSFTP.On("Close").Return(nil) - - // Save the original creator and restore it after the test - originalCreator := currentSFTPClientCreator - defer func() { currentSFTPClientCreator = originalCreator }() - - // Set up our test creator that returns the mock - var testCreator SFTPClientCreator = func(client *ssh.Client) (SFTPClient, error) { - return mockSFTP, nil - } - currentSFTPClientCreator = testCreator + expectedOutput := "command output" + + // Create mock session + mockSession := &ssh_mock.MockSSHSessioner{} + mockSession.On("Run", "ls -l").Return(nil) + mockSession.On("Close").Return(nil) + mockSession.On("SetStdout", mock.MatchedBy(func(w interface{}) bool { + writer := w.(io.Writer) + _, err := writer.Write([]byte(expectedOutput)) + return err == nil + })).Return() + mockSession.On("SetStderr", mock.Anything).Return() + + // Create mock SSH client + mockClient := &ssh_mock.MockSSHClienter{} + mockClient.On("NewSession").Return(mockSession, nil) + mockClient.On("Close").Return(nil) + mockClient.On("GetClient").Return(&ssh.Client{}).Maybe() + mockClient.On("Connect").Return(mockClient, nil).Maybe() + mockClient.On("IsConnected").Return(true).Maybe() + + // Create mock client creator + mockClientCreator := &ssh_mock.MockSSHClientCreator{} + mockClientCreator.On("NewClient", + "test-host", + 22, + "test-user", + s.testSSHPrivateKeyPath, + mock.Anything, + ).Return(mockClient, nil) - // Mock GetClient to return a mock ssh.Client - mockSSHClient := &ssh.Client{} - s.mockClient.On("GetClient").Return(mockSSHClient) + // Set mock client creator + s.sshConfig.SetSSHClientCreator(mockClientCreator) - err := s.sshConfig.PushFile(s.ctx, "/remote/path", localContent, executable) + // Execute command + actualOutput, err := s.sshConfig.ExecuteCommand(s.ctx, "ls -l") s.NoError(err) + s.Equal(expectedOutput, actualOutput) - s.mockClient.AssertExpectations(s.T()) - mockSFTP.AssertExpectations(s.T()) - mockFile.AssertExpectations(s.T()) -} - -func (s *PkgSSHUtilsTestSuite) TestSystemdServiceOperations() { - tests := []struct { - name string - operation interface{} - serviceName string - serviceContent string - expectedCmd string - expectError bool - }{ - { - name: "InstallSystemdService", - operation: s.sshConfig.InstallSystemdService, - serviceName: "test_service", - serviceContent: "service content", - expectedCmd: "echo 'service content' | sudo tee /etc/systemd/system/test_service.service > /dev/null", - expectError: false, - }, - { - name: "StartService", - operation: s.sshConfig.StartService, - serviceName: "test_service", - expectedCmd: "sudo systemctl start test_service", - expectError: false, - }, - { - name: "RestartService", - operation: s.sshConfig.RestartService, - serviceName: "test_service", - expectedCmd: "sudo systemctl restart test_service", - expectError: false, - }, - } - - for _, tt := range tests { - s.Run(tt.name, func() { - s.mockClient.On("NewSession").Return(s.mockSession, nil) - s.mockClient.On("IsConnected").Return(true) - s.mockSession.On("Run", tt.expectedCmd).Return(nil) - s.mockSession.On("Close").Return(nil) - - var err error - switch op := tt.operation.(type) { - case func(context.Context, string, string) error: - err = op(s.ctx, tt.serviceName, tt.serviceContent) - case func(context.Context, string) error: - err = op(s.ctx, tt.serviceName) - default: - s.Fail("Unexpected operation type") - } - - if tt.expectError { - s.Error(err) - } else { - s.NoError(err) - } - - s.mockClient.AssertExpectations(s.T()) - s.mockSession.AssertExpectations(s.T()) - }) - } + // Verify expectations + mockSession.AssertExpectations(s.T()) + mockClient.AssertExpectations(s.T()) + mockClientCreator.AssertExpectations(s.T()) } func TestSSHUtilsSuite(t *testing.T) { diff --git a/pkg/testutil/testutil.go b/pkg/testutil/testutil.go index 3fb946fc..da258bb6 100644 --- a/pkg/testutil/testutil.go +++ b/pkg/testutil/testutil.go @@ -5,16 +5,15 @@ import ( "math/rand" "strings" - "github.com/bacalhau-project/andaime/internal/testdata" internal_testutil "github.com/bacalhau-project/andaime/internal/testutil" "github.com/bacalhau-project/andaime/pkg/globals" "github.com/bacalhau-project/andaime/pkg/models" "github.com/spf13/viper" ) -func InitializeTestViper() (*viper.Viper, error) { +func InitializeTestViper(testConfig string) (*viper.Viper, error) { viper.Reset() - configFile, cleanup, err := internal_testutil.WriteStringToTempFile(testdata.TestAzureConfig) + configFile, cleanup, err := internal_testutil.WriteStringToTempFile(testConfig) if err != nil { return nil, err } @@ -66,6 +65,8 @@ func SetupViper(deploymentType models.DeploymentType, }, }, }) + } else if deploymentType == models.DeploymentTypeAWS { + viper.Set("aws.account_id", "1234567890") } } diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..1e38e06b --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[tool.pyright] +exclude = ["archival-python-version"] +ignore = ["archival-python-version"] diff --git a/requirements.txt b/requirements.txt index 7e9dfd53..d7f8ce1f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,11 +1,11 @@ # This file was autogenerated by uv via the following command: # uv pip compile - -o requirements.txt -aider-chat==0.65.0 -aiohappyeyeballs==2.4.3 +aider-chat==0.67.0 +aiohappyeyeballs==2.4.4 # via # aider-chat # aiohttp -aiohttp==3.11.7 +aiohttp==3.11.9 # via # aider-chat # huggingface-hub @@ -27,6 +27,7 @@ anyio==4.6.2.post1 # groq # httpx # openai + # watchfiles attrs==24.2.0 # via # aider-chat @@ -115,7 +116,7 @@ greenlet==3.0.3 # via # playwright # sqlalchemy -grep-ast==0.4.0 +grep-ast==0.4.1 # via aider-chat groq==0.10.0 h11==0.14.0 @@ -131,12 +132,13 @@ httpx==0.27.2 # aider-chat # anthropic # groq + # litellm # llama-cloud # llama-index-core # ollama # openai # tavily-python -huggingface-hub==0.26.2 +huggingface-hub==0.26.3 # via # aider-chat # llama-index-embeddings-huggingface @@ -161,7 +163,7 @@ jinja2==3.1.4 # aider-chat # litellm # torch -jiter==0.7.1 +jiter==0.8.0 # via # aider-chat # anthropic @@ -174,7 +176,7 @@ joblib==1.4.2 # via # nltk # scikit-learn -json5==0.9.28 +json5==0.10.0 # via aider-chat jsonschema==4.23.0 # via @@ -184,7 +186,7 @@ jsonschema-specifications==2024.10.1 # via # aider-chat # jsonschema -litellm==1.52.16 +litellm==1.53.5 # via aider-chat llama-cloud==0.0.6 # via llama-index-core @@ -244,7 +246,7 @@ numpy==1.26.4 # sentence-transformers # transformers ollama==0.3.0 -openai==1.55.1 +openai==1.56.2 # via # aider-chat # litellm @@ -271,7 +273,7 @@ pillow==10.4.0 # sentence-transformers pip==24.2 playwright==1.45.0 -posthog==3.7.3 +posthog==3.7.4 # via aider-chat primp==0.5.5 # via duckduckgo-search @@ -279,7 +281,7 @@ prompt-toolkit==3.0.48 # via # aider-chat # pypager -propcache==0.2.0 +propcache==0.2.1 # via # aider-chat # aiohttp @@ -298,7 +300,7 @@ pycparser==2.22 # via # aider-chat # cffi -pydantic==2.10.2 +pydantic==2.10.3 # via # aider-chat # anthropic @@ -371,7 +373,7 @@ requests==2.32.3 # transformers rich==13.9.4 # via aider-chat -rpds-py==0.21.0 +rpds-py==0.22.3 # via # aider-chat # jsonschema @@ -394,7 +396,7 @@ sentence-transformers==3.0.1 setuptools==74.1.2 # via setuptools-scm setuptools-scm==8.1.0 -six==1.16.0 +six==1.17.0 # via # aider-chat # mixpanel @@ -491,6 +493,8 @@ urllib3==2.2.3 # mixpanel # requests uv==0.4.26 +watchfiles==1.0.0 + # via aider-chat wcwidth==0.2.13 # via # aider-chat @@ -500,7 +504,7 @@ wrapt==1.16.0 # via # deprecated # llama-index-core -yarl==1.18.0 +yarl==1.18.3 # via # aider-chat # aiohttp diff --git a/test/integration/create_deployment_test.go b/test/integration/create_deployment_test.go index 634135a2..7dd87743 100644 --- a/test/integration/create_deployment_test.go +++ b/test/integration/create_deployment_test.go @@ -12,12 +12,16 @@ import ( "cloud.google.com/go/compute/apiv1/computepb" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/service/ec2" + "github.com/aws/aws-sdk-go-v2/service/ec2/types" "github.com/spf13/cobra" "github.com/spf13/viper" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" - "github.com/bacalhau-project/andaime/cmd" + "github.com/bacalhau-project/andaime/cmd/beta/azure" + "github.com/bacalhau-project/andaime/cmd/beta/gcp" "github.com/bacalhau-project/andaime/internal/clouds/general" "github.com/bacalhau-project/andaime/internal/testutil" "github.com/bacalhau-project/andaime/pkg/display" @@ -26,17 +30,24 @@ import ( "github.com/bacalhau-project/andaime/internal/testdata" - "github.com/bacalhau-project/andaime/cmd/beta/azure" - "github.com/bacalhau-project/andaime/cmd/beta/gcp" + common_mock "github.com/bacalhau-project/andaime/mocks/common" + aws_mock "github.com/bacalhau-project/andaime/mocks/aws" azure_mock "github.com/bacalhau-project/andaime/mocks/azure" - common_mock "github.com/bacalhau-project/andaime/mocks/common" gcp_mock "github.com/bacalhau-project/andaime/mocks/gcp" + ssh_mock "github.com/bacalhau-project/andaime/mocks/sshutils" + + aws_interface "github.com/bacalhau-project/andaime/pkg/models/interfaces/aws" + azure_interface "github.com/bacalhau-project/andaime/pkg/models/interfaces/azure" + sshutils_interface "github.com/bacalhau-project/andaime/pkg/models/interfaces/sshutils" + + aws_provider "github.com/bacalhau-project/andaime/pkg/providers/aws" azure_provider "github.com/bacalhau-project/andaime/pkg/providers/azure" gcp_provider "github.com/bacalhau-project/andaime/pkg/providers/gcp" - azure_interface "github.com/bacalhau-project/andaime/pkg/models/interfaces/azure" - gcp_interface "github.com/bacalhau-project/andaime/pkg/models/interfaces/gcp" + aws_cmd "github.com/bacalhau-project/andaime/cmd/beta/aws" + azure_cmd "github.com/bacalhau-project/andaime/cmd/beta/azure" + gcp_cmd "github.com/bacalhau-project/andaime/cmd/beta/gcp" ) var ( @@ -49,17 +60,22 @@ type IntegrationTestSuite struct { suite.Suite viperConfigFile string cleanup func() + testSSHUser string testSSHPublicKeyPath string testSSHPrivateKeyPath string mockClusterDeployer *common_mock.MockClusterDeployerer - mockSSHConfig *sshutils.MockSSHConfig + mockSSHConfig *ssh_mock.MockSSHConfiger azureProvider *azure_provider.AzureProvider gcpProvider *gcp_provider.GCPProvider + awsProvider *aws_provider.AWSProvider } func (s *IntegrationTestSuite) SetupSuite() { os.Setenv("ANDAIME_TEST_MODE", "true") - publicKeyPath, cleanupPublicKey, privateKeyPath, cleanupPrivateKey := testutil.CreateSSHPublicPrivateKeyPairOnDisk() + publicKeyPath, + cleanupPublicKey, + privateKeyPath, + cleanupPrivateKey := testutil.CreateSSHPublicPrivateKeyPairOnDisk() s.testSSHPublicKeyPath = publicKeyPath s.testSSHPrivateKeyPath = privateKeyPath @@ -83,7 +99,7 @@ func (s *IntegrationTestSuite) SetupSuite() { } s.mockClusterDeployer = new(common_mock.MockClusterDeployerer) - s.mockSSHConfig = new(sshutils.MockSSHConfig) + s.mockSSHConfig = new(ssh_mock.MockSSHConfiger) } func (s *IntegrationTestSuite) TearDownSuite() { @@ -96,17 +112,19 @@ func (s *IntegrationTestSuite) SetupTest() { s.Require().NoError(err) var configContent string - if viper.GetString("general.deployment_type") == "gcp" { + switch viper.GetString("general.deployment_type") { + case string(models.DeploymentTypeGCP): configContent, err = testdata.ReadTestGCPConfig() - s.Require().NoError(err) - } else { + case string(models.DeploymentTypeAWS): + configContent, err = testdata.ReadTestAWSConfig() + default: configContent, err = testdata.ReadTestAzureConfig() - s.Require().NoError(err) } + s.Require().NoError(err) os.WriteFile(f.Name(), []byte(configContent), 0o644) s.viperConfigFile = f.Name() - viper.SetConfigFile(s.viperConfigFile) // Also set it for Viper directly + viper.SetConfigFile(s.viperConfigFile) s.setupCommonConfig() s.setupMockClusterDeployer() @@ -120,8 +138,13 @@ func (s *IntegrationTestSuite) TearDownTest() { } } +func TestIntegrationSuite(t *testing.T) { + suite.Run(t, new(IntegrationTestSuite)) +} + func (s *IntegrationTestSuite) setupCommonConfig() { viper.Set("general.project_prefix", fmt.Sprintf("test-%d", time.Now().UnixNano())) + viper.Set("general.ssh_user", "testuser") viper.Set("general.ssh_public_key_path", s.testSSHPublicKeyPath) viper.Set("general.ssh_private_key_path", s.testSSHPrivateKeyPath) viper.Set("general.custom_script_path", localScriptPath) @@ -175,7 +198,215 @@ func (s *IntegrationTestSuite) setupProviderConfig(provider models.DeploymentTyp }, }, }) + case models.DeploymentTypeAWS: + viper.Set("aws.account_id", "123456789012") + viper.Set("aws.default_count_per_zone", 1) + viper.Set("aws.default_machine_type", "t3.medium") + viper.Set("aws.default_disk_size_gb", 30) + viper.Set("aws.region", "us-west-2") // Set default region + + // Configure multi-region deployment with proper orchestrator setup + viper.Set("aws.machines", []interface{}{ + map[string]interface{}{ + "location": "us-west-2a", + "parameters": map[string]interface{}{ + "count": 1, + "orchestrator": true, + }, + }, + map[string]interface{}{ + "location": "us-east-1a", + "parameters": map[string]interface{}{ + "count": 1, + }, + }, + }) + + // Configure regional resources + regions := []string{"us-west-2", "us-east-1"} + for _, region := range regions { + viper.Set(fmt.Sprintf("aws.regions.%s.vpc_id", region), "vpc-12345") + viper.Set( + fmt.Sprintf("aws.regions.%s.security_group_id", region), + "sg-1234567890abcdef0", + ) + } + } +} + +func (s *IntegrationTestSuite) setupDeploymentModel( + testName string, + provider models.DeploymentType, +) { + deploymentName := fmt.Sprintf("test-deployment-%s-%d", testName, time.Now().UnixNano()) + viper.Set("general.project_prefix", deploymentName) + + m := display.GetGlobalModelFunc() + m.Deployment = &models.Deployment{ + DeploymentType: provider, + Name: deploymentName, + } + + // Initialize provider-specific structures + switch provider { + case models.DeploymentTypeAWS: + m.Deployment.AWS = &models.AWSDeployment{ + AccountID: "123456789012", + RegionalResources: &models.RegionalResources{ + VPCs: make(map[string]*models.AWSVPC), + Clients: make(map[string]aws_interface.EC2Clienter), + }, + } + // Initialize VPC maps for each region + regions := []string{"us-west-2", "us-east-1"} + for _, region := range regions { + m.Deployment.AWS.RegionalResources.SetVPC(region, &models.AWSVPC{ + VPCID: fmt.Sprintf("vpc-%s", region), + SecurityGroupID: fmt.Sprintf("sg-%s", region), + }) + } + case models.DeploymentTypeAzure: + m.Deployment.Azure = &models.AzureConfig{ + SubscriptionID: "4a45a76b-5754-461d-84a1-f5e47b0a7198", + } + case models.DeploymentTypeGCP: + m.Deployment.GCP = &models.GCPConfig{ + ProjectID: "test-1292-gcp", + OrganizationID: "org-1234567890", + } + } + + // Set common SSH configuration + m.Deployment.SSHPublicKeyPath = s.testSSHPublicKeyPath + m.Deployment.SSHPrivateKeyPath = s.testSSHPrivateKeyPath +} + +func (s *IntegrationTestSuite) setupAWSTest() (*cobra.Command, error) { + cmd := aws_cmd.GetAwsCreateDeploymentCmd() + cmd.SetContext(context.Background()) + + // Initialize deployment model first + s.setupDeploymentModel("aws-test", models.DeploymentTypeAWS) + + var err error + s.awsProvider, err = aws_provider.NewAWSProvider("123456789012") + if err != nil { + return nil, err } + + // Create and configure mock EC2 client + mockEC2Client := new(aws_mock.MockEC2Clienter) + s.setupMockAWSResources(mockEC2Client) + s.awsProvider.SetEC2Client(mockEC2Client) + + // Set up the provider in the command + aws_provider.NewAWSProviderFunc = func(accountID string) (*aws_provider.AWSProvider, error) { + return s.awsProvider, nil + } + + // Initialize the deployment model with AWS-specific configuration + m := display.GetGlobalModelFunc() + if m.Deployment != nil && m.Deployment.AWS != nil { + // Initialize VPCs map with required regions + m.Deployment.AWS.RegionalResources.VPCs = map[string]*models.AWSVPC{ + "us-west-2": { + VPCID: "vpc-12345", + SecurityGroupID: "sg-1234567890abcdef0", + }, + "us-east-1": { + VPCID: "vpc-12345", + SecurityGroupID: "sg-1234567890abcdef0", + }, + } + // Set up EC2 clients for each region + for region := range m.Deployment.AWS.RegionalResources.VPCs { + m.Deployment.AWS.RegionalResources.Clients[region] = mockEC2Client + } + } + + return cmd, nil +} + +func (s *IntegrationTestSuite) setupMockAWSResources(mockEC2Client *aws_mock.MockEC2Clienter) { + // Region mocks + mockEC2Client.On("DescribeRegions", mock.Anything, mock.AnythingOfType("*ec2.DescribeRegionsInput")). + Return(&ec2.DescribeRegionsOutput{ + Regions: []types.Region{ + { + RegionName: aws.String("us-west-2"), + Endpoint: aws.String("ec2.us-west-2.amazonaws.com"), + }, + { + RegionName: aws.String("us-east-1"), + Endpoint: aws.String("ec2.us-east-1.amazonaws.com"), + }, + }, + }, nil) + mockEC2Client.On("DescribeAvailabilityZones", mock.Anything, mock.AnythingOfType("*ec2.DescribeAvailabilityZonesInput")). + Return(&ec2.DescribeAvailabilityZonesOutput{ + AvailabilityZones: []types.AvailabilityZone{ + { + ZoneName: aws.String("us-west-2a"), + State: types.AvailabilityZoneStateAvailable, + }, + { + ZoneName: aws.String("us-west-2b"), + State: types.AvailabilityZoneStateAvailable, + }, + { + ZoneName: aws.String("us-east-1a"), + State: types.AvailabilityZoneStateAvailable, + }, + { + ZoneName: aws.String("us-east-1b"), + State: types.AvailabilityZoneStateAvailable, + }, + }, + }, nil) + + // VPC and Networking mocks + mockEC2Client.On("CreateVpc", mock.Anything, mock.AnythingOfType("*ec2.CreateVpcInput")). + Return(testdata.FakeEC2CreateVpcOutput(), nil) + mockEC2Client.On("DescribeVpcs", mock.Anything, mock.AnythingOfType("*ec2.DescribeVpcsInput")). + Return(testdata.FakeEC2DescribeVpcsOutput(), nil) + mockEC2Client.On("ModifyVpcAttribute", mock.Anything, mock.AnythingOfType("*ec2.ModifyVpcAttributeInput")). + Return(testdata.FakeEC2ModifyVpcAttributeOutput(), nil) + mockEC2Client.On("CreateSecurityGroup", mock.Anything, mock.AnythingOfType("*ec2.CreateSecurityGroupInput")). + Return(testdata.FakeEC2CreateSecurityGroupOutput(), nil) + mockEC2Client.On("AuthorizeSecurityGroupIngress", mock.Anything, mock.AnythingOfType("*ec2.AuthorizeSecurityGroupIngressInput")). + Return(testdata.FakeAuthorizeSecurityGroupIngressOutput(), nil) + + // Routing mocks + mockEC2Client.On("CreateInternetGateway", mock.Anything, mock.AnythingOfType("*ec2.CreateInternetGatewayInput")). + Return(testdata.FakeEC2CreateInternetGatewayOutput(), nil) + mockEC2Client.On("AttachInternetGateway", mock.Anything, mock.AnythingOfType("*ec2.AttachInternetGatewayInput")). + Return(testdata.FakeEC2AttachInternetGatewayOutput(), nil) + mockEC2Client.On("CreateRouteTable", mock.Anything, mock.AnythingOfType("*ec2.CreateRouteTableInput")). + Return(testdata.FakeEC2CreateRouteTableOutput(), nil) + mockEC2Client.On("CreateRoute", mock.Anything, mock.AnythingOfType("*ec2.CreateRouteInput")). + Return(testdata.FakeEC2CreateRouteOutput(), nil) + mockEC2Client.On("AssociateRouteTable", mock.Anything, mock.AnythingOfType("*ec2.AssociateRouteTableInput")). + Return(testdata.FakeEC2AssociateRouteTableOutput(), nil) + mockEC2Client.On("DescribeRouteTables", mock.Anything, mock.AnythingOfType("*ec2.DescribeRouteTablesInput")). + Return(testdata.FakeEC2DescribeRouteTablesOutput(), nil) + + // Instance mocks + mockEC2Client.On("RunInstances", mock.Anything, mock.AnythingOfType("*ec2.RunInstancesInput")). + Return(testdata.FakeEC2RunInstancesOutput(), nil) + mockEC2Client.On("DescribeInstances", mock.Anything, + mock.AnythingOfType("*ec2.DescribeInstancesInput"), + mock.Anything). + Return(testdata.FakeEC2DescribeInstancesOutput(), nil) + mockEC2Client.On("DescribeImages", mock.Anything, mock.AnythingOfType("*ec2.DescribeImagesInput")). + Return(testdata.FakeEC2DescribeImagesOutput(), nil) + mockEC2Client.On("CreateTags", mock.Anything, mock.AnythingOfType("*ec2.CreateTagsInput")). + Return(&ec2.CreateTagsOutput{}, nil) + + // Subnet mocks + mockEC2Client.On("CreateSubnet", mock.Anything, mock.AnythingOfType("*ec2.CreateSubnetInput")). + Return(testdata.FakeEC2CreateSubnetOutput(), nil) + mockEC2Client.On("DescribeSubnets", mock.Anything, mock.AnythingOfType("*ec2.DescribeSubnetsInput")). + Return(testdata.FakeEC2DescribeSubnetsOutput(), nil) } func (s *IntegrationTestSuite) setupMockClusterDeployer() { @@ -198,6 +429,7 @@ func (s *IntegrationTestSuite) setupMockClusterDeployer() { } func (s *IntegrationTestSuite) setupMockSSHConfig() { + s.mockSSHConfig.On("Connect").Return(nil, nil) s.mockSSHConfig.On("ExecuteCommand", mock.Anything, "sudo docker run hello-world"). Return("Hello from Docker!", nil) s.mockSSHConfig.On("ExecuteCommand", mock.Anything, mock.Anything). @@ -210,14 +442,18 @@ func (s *IntegrationTestSuite) setupMockSSHConfig() { Return(nil) s.mockSSHConfig.On("InstallSystemdService", mock.Anything, mock.Anything, mock.Anything). Return(nil) - s.mockSSHConfig.On("RestartService", mock.Anything, mock.Anything).Return(nil) + s.mockSSHConfig.On("RestartService", mock.Anything, mock.Anything).Return("", nil) s.mockSSHConfig.On("WaitForSSH", mock.Anything, mock.Anything, mock.Anything, ).Return(nil) + s.mockSSHConfig.On("Close").Return(nil) - sshutils.NewSSHConfigFunc = func(host string, port int, user string, sshPrivateKeyPath string) (sshutils.SSHConfiger, error) { + sshutils.NewSSHConfigFunc = func(host string, + port int, + user string, + sshPrivateKeyPath string) (sshutils_interface.SSHConfiger, error) { return s.mockSSHConfig, nil } } @@ -226,195 +462,201 @@ func (s *IntegrationTestSuite) TestExecuteCreateDeployment() { tests := []struct { name string provider models.DeploymentType + setup func() (*cobra.Command, error) }{ - {"azure", models.DeploymentTypeAzure}, - {"gcp", models.DeploymentTypeGCP}, + { + name: "aws", + provider: models.DeploymentTypeAWS, + setup: s.setupAWSTest, + }, + { + name: "azure", + provider: models.DeploymentTypeAzure, + setup: s.setupAzureTest, + }, + { + name: "gcp", + provider: models.DeploymentTypeGCP, + setup: s.setupGCPTest, + }, } - var err error for _, tt := range tests { s.Run(tt.name, func() { s.SetupTest() s.setupProviderConfig(tt.provider) + s.setupDeploymentModel(tt.name, tt.provider) - deploymentName := fmt.Sprintf("test-deployment-%s-%d", tt.name, time.Now().UnixNano()) - viper.Set("general.project_prefix", deploymentName) - - m := display.GetGlobalModelFunc() - m.Deployment = &models.Deployment{ - DeploymentType: tt.provider, - Name: deploymentName, - } - - var providerCmd *cobra.Command - var createDeploymentCmd *cobra.Command - - switch tt.provider { - case models.DeploymentTypeAzure: - providerCmd = azure.GetAzureCmd() - createDeploymentCmd = azure.GetAzureCreateDeploymentCmd() - createDeploymentCmd.SetContext(context.Background()) - - s.azureProvider, err = azure_provider.NewAzureProviderFunc( - context.Background(), - viper.GetString("azure.subscription_id"), - ) - s.Require().NoError(err) - - mockPoller := new(MockPoller) - mockPoller.On("PollUntilDone", mock.Anything, mock.Anything). - Return(armresources.DeploymentsClientCreateOrUpdateResponse{ - DeploymentExtended: testdata.FakeDeployment(), - }, nil) - - mockAzureClient := new(azure_mock.MockAzureClienter) - mockAzureClient.On("ValidateMachineType", - mock.Anything, - mock.Anything, - mock.Anything, - ).Return(true, nil) - mockAzureClient.On("GetOrCreateResourceGroup", - mock.Anything, - mock.Anything, - mock.Anything, - mock.Anything, - ).Return(testdata.FakeResourceGroup(), nil) - mockAzureClient.On("DeployTemplate", - mock.Anything, - mock.Anything, - mock.Anything, - mock.Anything, - mock.Anything, - mock.Anything, - ).Return(mockPoller, nil) - mockAzureClient.On("GetVirtualMachine", mock.Anything, mock.Anything, mock.Anything). - Return(testdata.FakeVirtualMachine(), nil) - mockAzureClient.On("GetNetworkInterface", mock.Anything, mock.Anything, mock.Anything). - Return(testdata.FakeNetworkInterface(), nil) - mockAzureClient.On("GetPublicIPAddress", mock.Anything, mock.Anything, mock.Anything). - Return(testdata.FakePublicIPAddress("20.30.40.50"), nil) - - azure_provider.NewAzureProviderFunc = func(ctx context.Context, - subscriptionID string) (*azure_provider.AzureProvider, error) { - return s.azureProvider, nil - } - azure_provider.NewAzureClientFunc = func(subscriptionID string) (azure_interface.AzureClienter, error) { - return mockAzureClient, nil - } - err = azure.ExecuteCreateDeployment(createDeploymentCmd, []string{}) - s.Require().NoError(err) - case models.DeploymentTypeGCP: - providerCmd = gcp.GetGCPCmd() - createDeploymentCmd = gcp.GetGCPCreateDeploymentCmd() - createDeploymentCmd.SetContext(context.Background()) - - mockGCPClient := new(gcp_mock.MockGCPClienter) - mockGCPClient.On("IsAPIEnabled", mock.Anything, mock.Anything, mock.Anything). - Return(true, nil) - mockGCPClient.On("ValidateMachineType", mock.Anything, mock.Anything, mock.Anything). - Return(true, nil) - mockGCPClient.On("EnsureProject", - mock.Anything, - mock.Anything, - mock.Anything, - mock.Anything, - ).Return("test-1292-gcp", nil) - mockGCPClient.On("EnableAPI", - mock.Anything, - mock.Anything, - mock.Anything, - ).Return(nil) - mockGCPClient.On("CreateVPCNetwork", - mock.Anything, - mock.Anything, - mock.Anything, - ).Return(nil) - mockGCPClient.On("ListAddresses", mock.Anything, mock.Anything, mock.Anything). - Return([]*computepb.Address{testdata.FakeGCPIPAddress()}, nil) - mockGCPClient.On("CreateIP", mock.Anything, mock.Anything, mock.Anything). - Return(nil) - mockGCPClient.On("CreateFirewallRules", - mock.Anything, - mock.Anything, - mock.Anything, - ).Return(nil) - mockGCPClient.On("CreateVM", - mock.Anything, - mock.Anything, - mock.Anything, - mock.Anything, - mock.Anything, - ).Return(testdata.FakeGCPInstance(), nil) - - s.gcpProvider, err = gcp_provider.NewGCPProvider( - context.Background(), - viper.GetString("gcp.organization_id"), - viper.GetString("gcp.billing_account_id"), - ) - s.Require().NoError(err) - - gcp_provider.NewGCPClientFunc = func(ctx context.Context, - organizationID string, - ) (gcp_interface.GCPClienter, func(), error) { - return s.gcpProvider.GetGCPClient(), func() {}, nil - } - - s.gcpProvider.SetGCPClient(mockGCPClient) - - machine, err := models.NewMachine( - tt.provider, - "us-central1-a", - "n2-standard-2", - 30, - models.CloudSpecificInfo{}, - ) - s.Require().NoError(err) - machine.SetOrchestrator(true) - m.Deployment.SetMachines(map[string]models.Machiner{"test-machine": machine}) - - gcp_provider.NewGCPProviderFunc = func(ctx context.Context, - organizationID, billingAccountID string, - ) (*gcp_provider.GCPProvider, error) { - return s.gcpProvider, nil - } - - err = gcp.ExecuteCreateDeployment(createDeploymentCmd, []string{}) - s.Require().NoError(err) - } - - rootCmd := cmd.GetRootCommandForTest() - - rootCmd.AddCommand(providerCmd) - providerCmd.AddCommand(createDeploymentCmd) - - rootCmd.SetArgs( - []string{tt.name, "create-deployment", "--config", s.viperConfigFile}, - ) + cmd, err := tt.setup() + s.Require().NoError(err) - err := rootCmd.Execute() + err = s.executeDeployment(cmd, tt.provider) s.Require().NoError(err) - // Have to pull it again because it's out of sync - m = display.GetGlobalModelFunc() - s.NotEmpty(m.Deployment.Name) - s.Equal( - strings.ToLower(string(tt.provider)), - strings.ToLower(string(m.Deployment.DeploymentType)), - ) - s.NotEmpty(m.Deployment.Machines) - s.Equal(s.testSSHPublicKeyPath, m.Deployment.SSHPublicKeyPath) - s.Equal(s.testSSHPrivateKeyPath, m.Deployment.SSHPrivateKeyPath) - - if tt.provider == models.DeploymentTypeAzure { - s.Equal("4a45a76b-5754-461d-84a1-f5e47b0a7198", m.Deployment.Azure.SubscriptionID) - } else { - s.Equal("test-1292-gcp", m.Deployment.GCP.ProjectID) - s.Equal("org-1234567890", m.Deployment.GCP.OrganizationID) - } + s.verifyDeploymentResult(tt.provider) }) } } +func (s *IntegrationTestSuite) setupAzureTest() (*cobra.Command, error) { + cmd := azure.GetAzureCreateDeploymentCmd() + cmd.SetContext(context.Background()) + + var err error + s.azureProvider, err = azure_provider.NewAzureProvider( + context.Background(), + viper.GetString("azure.subscription_id"), + ) + if err != nil { + return nil, err + } + + mockPoller := new(MockPoller) + mockAzureClient := new(azure_mock.MockAzureClienter) + s.setupAzureMocks(mockAzureClient, mockPoller) + + azure_provider.NewAzureProviderFunc = func(ctx context.Context, subscriptionID string) (*azure_provider.AzureProvider, error) { + return s.azureProvider, nil + } + + azure_provider.NewAzureClientFunc = func(subscriptionID string) (azure_interface.AzureClienter, error) { + return mockAzureClient, nil + } + + return cmd, nil +} + +func (s *IntegrationTestSuite) setupAzureMocks( + mockAzureClient *azure_mock.MockAzureClienter, + mockPoller *MockPoller, +) { + mockPoller.On("PollUntilDone", mock.Anything, mock.Anything). + Return(armresources.DeploymentsClientCreateOrUpdateResponse{ + DeploymentExtended: testdata.FakeDeployment(), + }, nil) + + mockAzureClient.On("ValidateMachineType", mock.Anything, mock.Anything, mock.Anything). + Return(true, nil) + mockAzureClient.On("GetOrCreateResourceGroup", mock.Anything, mock.Anything, mock.Anything, mock.Anything). + Return(testdata.FakeResourceGroup(), nil) + mockAzureClient.On("DeployTemplate", + mock.Anything, + mock.Anything, + mock.MatchedBy(func(s string) bool { + return strings.HasPrefix(s, "deployment-") || + strings.HasPrefix(s, "machine-") + }), + mock.Anything, + mock.Anything, + mock.Anything, + ).Return(mockPoller, nil) + mockAzureClient.On("GetVirtualMachine", mock.Anything, mock.Anything, mock.Anything). + Return(testdata.FakeVirtualMachine(), nil) + mockAzureClient.On("GetNetworkInterface", mock.Anything, mock.Anything, mock.Anything). + Return(testdata.FakeNetworkInterface(), nil) + mockAzureClient.On("GetPublicIPAddress", mock.Anything, mock.Anything, mock.Anything). + Return(testdata.FakePublicIPAddress("20.30.40.50"), nil) +} + +func (s *IntegrationTestSuite) setupGCPTest() (*cobra.Command, error) { + cmd := gcp.GetGCPCreateDeploymentCmd() + cmd.SetContext(context.Background()) + + mockGCPClient := new(gcp_mock.MockGCPClienter) + s.setupGCPMocks(mockGCPClient) + + var err error + s.gcpProvider, err = gcp_provider.NewGCPProvider( + context.Background(), + viper.GetString("gcp.organization_id"), + viper.GetString("gcp.billing_account_id"), + ) + if err != nil { + return nil, err + } + + s.gcpProvider.SetGCPClient(mockGCPClient) + + gcp_provider.NewGCPProviderFunc = func(ctx context.Context, organizationID string, billingAccountID string) (*gcp_provider.GCPProvider, error) { + return s.gcpProvider, nil + } + + return cmd, nil +} + +func (s *IntegrationTestSuite) setupGCPMocks(mockGCPClient *gcp_mock.MockGCPClienter) { + mockGCPClient.On("IsAPIEnabled", mock.Anything, mock.Anything, mock.Anything). + Return(true, nil) + mockGCPClient.On("ValidateMachineType", mock.Anything, mock.Anything, mock.Anything). + Return(true, nil) + mockGCPClient.On("EnsureProject", mock.Anything, mock.Anything, mock.Anything, mock.Anything). + Return("test-1292-gcp", nil) + mockGCPClient.On("EnableAPI", mock.Anything, mock.Anything, mock.Anything). + Return(nil) + mockGCPClient.On("CreateVPCNetwork", mock.Anything, mock.Anything, mock.Anything). + Return(nil) + mockGCPClient.On("ListAddresses", mock.Anything, mock.Anything, mock.Anything). + Return([]*computepb.Address{testdata.FakeGCPIPAddress()}, nil) + mockGCPClient.On("CreateIP", mock.Anything, mock.Anything, mock.Anything). + Return(nil) + mockGCPClient.On("CreateFirewallRules", mock.Anything, mock.Anything, mock.Anything). + Return(nil) + mockGCPClient.On("CreateVM", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything). + Return(testdata.FakeGCPInstance(), nil) +} + +func (s *IntegrationTestSuite) executeDeployment( + cmd *cobra.Command, + provider models.DeploymentType, +) error { + switch provider { + case models.DeploymentTypeAWS: + return aws_cmd.ExecuteCreateDeployment(cmd, []string{}) + case models.DeploymentTypeAzure: + return azure_cmd.ExecuteCreateDeployment(cmd, []string{}) + case models.DeploymentTypeGCP: + return gcp_cmd.ExecuteCreateDeployment(cmd, []string{}) + default: + return fmt.Errorf("unsupported provider: %s", provider) + } +} + +func (s *IntegrationTestSuite) verifyDeploymentResult(provider models.DeploymentType) { + m := display.GetGlobalModelFunc() + s.NotEmpty(m.Deployment.Name) + s.Equal( + strings.ToLower(string(provider)), + strings.ToLower(string(m.Deployment.DeploymentType)), + ) + s.NotEmpty(m.Deployment.Machines) + s.Equal(s.testSSHPublicKeyPath, m.Deployment.SSHPublicKeyPath) + s.Equal(s.testSSHPrivateKeyPath, m.Deployment.SSHPrivateKeyPath) + + switch provider { + case models.DeploymentTypeAzure: + s.Equal("4a45a76b-5754-461d-84a1-f5e47b0a7198", m.Deployment.Azure.SubscriptionID) + case models.DeploymentTypeGCP: + s.Equal("test-1292-gcp", m.Deployment.GCP.ProjectID) + s.Equal("org-1234567890", m.Deployment.GCP.OrganizationID) + case models.DeploymentTypeAWS: + // Verify that VPCs exist in the configured regions + s.NotEmpty(m.Deployment.AWS.RegionalResources.VPCs) + for region, vpc := range m.Deployment.AWS.RegionalResources.VPCs { + s.NotEmpty( + vpc.VPCID, + "VPC ID should not be empty for region %s", + region, + ) + s.NotEmpty( + vpc.SecurityGroupID, + "Security Group ID should not be empty for region %s", + region, + ) + } + } +} + +// MockPoller implementation for Azure deployment polling type MockPoller struct { mock.Mock } @@ -448,7 +690,3 @@ func (m *MockPoller) Poll(ctx context.Context) (*http.Response, error) { args := m.Called(ctx) return args.Get(0).(*http.Response), args.Error(1) } - -func TestIntegrationSuite(t *testing.T) { - suite.Run(t, new(IntegrationTestSuite)) -}