Skip to content

update_network_migration_definition

update_network_migration_definition(
    network_migration_definition_id: NetworkMigrationDefinitionID,
    *,
    config_overrides: Optional[mgnClientConfig] = None,
    name: Optional[NetworkMigrationDefinitionName] = None,
    description: Optional[NetworkMigrationDefinitionDescription] = None,
    source_configurations: Optional[SourceConfigurationList] = None,
    target_s3_configuration: Optional[TargetS3ConfigurationUpdate] = None,
    target_network: Optional[TargetNetworkUpdate] = None,
    target_deployment: Optional[TargetDeployment] = None,
    vpc_provisioning_strategy: Optional[VpcProvisioningStrategy] = None,
    cidr_mappings: Optional[CidrMappingsList] = None,
    scope_tags: Optional[ScopeTagsMap] = None,
) -> NetworkMigrationDefinition

Updates an existing network migration definition with new source or target configurations.

Parameters:

  • network_migration_definition_id (NetworkMigrationDefinitionID) –

    The unique identifier of the network migration definition to update.

  • name (Optional[NetworkMigrationDefinitionName], default: None ) –

    The updated name of the network migration definition.

  • description (Optional[NetworkMigrationDefinitionDescription], default: None ) –

    The updated description of the network migration definition.

  • source_configurations (Optional[SourceConfigurationList], default: None ) –

    The updated list of source configurations.

  • target_s3_configuration (Optional[TargetS3ConfigurationUpdate], default: None ) –

    The updated S3 configuration for storing the target network artifacts.

  • target_network (Optional[TargetNetworkUpdate], default: None ) –

    The updated target network configuration.

  • target_deployment (Optional[TargetDeployment], default: None ) –

    The updated target deployment configuration.

  • vpc_provisioning_strategy (Optional[VpcProvisioningStrategy], default: None ) –

    Updates whether the migration creates new target VPCs or uses existing ones. Set to USE_EXISTING to migrate into existing VPCs in the target account, or to CREATE_NEW to provision new target VPCs.

  • cidr_mappings (Optional[CidrMappingsList], default: None ) –

    The updated list of CIDR mappings that map original source CIDR ranges to updated target CIDR ranges. CIDR mappings can be provided only when vpcProvisioningStrategy is set to USE_EXISTING.

  • scope_tags (Optional[ScopeTagsMap], default: None ) –

    The updated scope tags for the network migration definition.

Raises:

Examples:

Sample UpdateNetworkMigrationDefinition call

>>> client.update_network_migration_definition(network_migration_definition_id='nmd-01234567891234567', name='network1', description='network 1 description', source_configurations=[{'sourceEnvironment': 'NSX', 'sourceS3Configuration': {'s3Bucket': 'source_bucket', 's3Key': 'source_key', 's3BucketOwner': '012345678901'}}], target_s3_configuration={'s3Bucket': 'target_bucket', 's3BucketOwner': '012345678901'}, target_network={'topology': 'ISOLATED_VPC', 'inboundCidr': '192.168.1.0/24'})
Source code in docs_src/capo_mgn/_services/mgn.py
def update_network_migration_definition(
    self,
    network_migration_definition_id: "capo_mgn.types.network_migration_definition_id.NetworkMigrationDefinitionID",
    *,
    config_overrides: Optional[mgnClientConfig] = None,
    name: Optional[
        "capo_mgn.types.network_migration_definition_name.NetworkMigrationDefinitionName"
    ] = None,
    description: Optional[
        "capo_mgn.types.network_migration_definition_description.NetworkMigrationDefinitionDescription"
    ] = None,
    source_configurations: Optional[
        "capo_mgn.types.source_configuration_list.SourceConfigurationList"
    ] = None,
    target_s3_configuration: Optional[
        "capo_mgn.types.target_s3_configuration_update.TargetS3ConfigurationUpdate"
    ] = None,
    target_network: Optional[
        "capo_mgn.types.target_network_update.TargetNetworkUpdate"
    ] = None,
    target_deployment: Optional[
        "capo_mgn.types.target_deployment.TargetDeployment"
    ] = None,
    vpc_provisioning_strategy: Optional[
        "capo_mgn.types.vpc_provisioning_strategy.VpcProvisioningStrategy"
    ] = None,
    cidr_mappings: Optional[
        "capo_mgn.types.cidr_mappings_list.CidrMappingsList"
    ] = None,
    scope_tags: Optional["capo_mgn.types.scope_tags_map.ScopeTagsMap"] = None,
) -> "capo_mgn.types.network_migration_definition.NetworkMigrationDefinition":
    """<p>Updates an existing network migration definition with new source or target configurations.</p>

    Args:
        network_migration_definition_id: <p>The unique identifier of the network migration definition to update.</p>
        name: <p>The updated name of the network migration definition.</p>
        description: <p>The updated description of the network migration definition.</p>
        source_configurations: <p>The updated list of source configurations.</p>
        target_s3_configuration: <p>The updated S3 configuration for storing the target network artifacts.</p>
        target_network: <p>The updated target network configuration.</p>
        target_deployment: <p>The updated target deployment configuration.</p>
        vpc_provisioning_strategy: <p>Updates whether the migration creates new target VPCs or uses existing ones. Set to <code>USE_EXISTING</code> to migrate into existing VPCs in the target account, or to <code>CREATE_NEW</code> to provision new target VPCs.</p>
        cidr_mappings: <p>The updated list of CIDR mappings that map original source CIDR ranges to updated target CIDR ranges. CIDR mappings can be provided only when <code>vpcProvisioningStrategy</code> is set to <code>USE_EXISTING</code>.</p>
        scope_tags: <p>The updated scope tags for the network migration definition.</p>

    Raises:
        capo_mgn.errors.access_denied_exception.AccessDeniedException: <p>Operation denied due to a file permission or access check error.</p>
        capo_mgn.errors.resource_not_found_exception.ResourceNotFoundException: <p>Resource not found exception.</p>
        capo_mgn.errors.validation_exception.ValidationException: <p>Validate exception.</p>
        capo_mgn.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Sample UpdateNetworkMigrationDefinition call

        >>> client.update_network_migration_definition(network_migration_definition_id='nmd-01234567891234567', name='network1', description='network 1 description', source_configurations=[{'sourceEnvironment': 'NSX', 'sourceS3Configuration': {'s3Bucket': 'source_bucket', 's3Key': 'source_key', 's3BucketOwner': '012345678901'}}], target_s3_configuration={'s3Bucket': 'target_bucket', 's3BucketOwner': '012345678901'}, target_network={'topology': 'ISOLATED_VPC', 'inboundCidr': '192.168.1.0/24'})
    """

    def _handler(
        req: "OperationRequest[capo_mgn.types.update_network_migration_definition_request.UpdateNetworkMigrationDefinitionRequest]",
    ) -> OperationResponse[
        "capo_mgn.types.network_migration_definition.NetworkMigrationDefinition"
    ]:
        import capo_mgn._operations.application_migration_service.update_network_migration_definition

        output, http_response = (
            capo_mgn._operations.application_migration_service.update_network_migration_definition.update_network_migration_definition(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_mgn.types.update_network_migration_definition_request.UpdateNetworkMigrationDefinitionRequest",
    ) -> dict[str, Any]:
        import capo_mgn.types.update_network_migration_definition_request

        return capo_mgn.types.update_network_migration_definition_request.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_mgn.types.network_migration_definition.NetworkMigrationDefinition",
    ) -> dict[str, Any]:
        import capo_mgn.types.network_migration_definition

        return capo_mgn.types.network_migration_definition.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "UpdateNetworkMigrationDefinition",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_mgn.types.update_network_migration_definition_request.UpdateNetworkMigrationDefinitionRequest = {
        "network_migration_definition_id": network_migration_definition_id
    }
    if name is not None:
        input_["name"] = name
    if description is not None:
        input_["description"] = description
    if source_configurations is not None:
        input_["source_configurations"] = source_configurations
    if target_s3_configuration is not None:
        input_["target_s3_configuration"] = target_s3_configuration
    if target_network is not None:
        input_["target_network"] = target_network
    if target_deployment is not None:
        input_["target_deployment"] = target_deployment
    if vpc_provisioning_strategy is not None:
        input_["vpc_provisioning_strategy"] = vpc_provisioning_strategy
    if cidr_mappings is not None:
        input_["cidr_mappings"] = cidr_mappings
    if scope_tags is not None:
        input_["scope_tags"] = scope_tags

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output