Cloud Deployment Manager dejará de estar disponible el 31 de diciembre de 2025. Si actualmente usas Deployment Manager, migra a Infrastructure Manager o a una tecnología de implementación alternativa antes del 31 de diciembre de 2025 para asegurarte de que tus servicios continúen sin interrupciones.
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
A partir del 1 de enero de 2020, la comunidad de Python dejará de actualizar, corregir errores o solucionar problemas de seguridad de parches para Python 2.7. Les recomendamos que se aseguren de que sus plantillas de Deployment Manager sean compatibles con Python 3 lo antes posible.
Para obtener una descripción general de los productos afectados por este cambio, incluida la información sobre el uso de las bibliotecas cliente de Google Cloud Python, consulta Asistencia de Python en Google Cloud.
Cómo migrar sus plantillas de Deployment Manager
La sintaxis de Deployment Manager no utiliza funciones específicas de Python 3. En la mayoría de los casos, tus plantillas deberían funcionar con Python 3 sin requerir cambios de código.
Si usas módulos de plantilla, como las secuencias de comandos de ayuda, debes asegurarte de que las secuencias de comandos sean compatibles con Python 3.
Para obtener información sobre cómo transferir el código de Python 2 a Python 3, consulta la guía de transferencia de Python.org.
Si quieres probar si tu plantilla es compatible con Python 3, prueba una implementación de prueba con la plantilla. Si la implementación se realiza correctamente sin advertencias, la plantilla es compatible y no necesita cambios
Si tus plantillas tienen características que son incompatibles con Python 3, tus implementaciones continuarán funcionando hasta junio de 2020. Es posible que veas una de estas advertencias:
La plantilla no es compatible con Python 3: la plantilla se ejecuta con Python 2, pero falla con Python 3. La advertencia muestra el mensaje de error de Python 3 para que puedas depurar el código.
La plantilla produjo resultados diferentes de Python 3 y Python 2: esto podría deberse a que tu implementación no es determinante (por ejemplo, depende de la hora actual o de números aleatorios), o una plantilla podría estar usando un elemento incompatible con Python 3. Si tu plantilla no es determinista por diseño, no es necesario que la modifiques.
Si tu plantilla utiliza una función que es incompatible con Python 3, usa los lineamientos de la guía de portabilidad de Python 3 para actualizar la plantilla.
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-09-03 (UTC)"],[[["\u003cp\u003ePython 2.7 will no longer receive updates, bug fixes, or security patches from the Python community after January 1, 2020, so ensuring Deployment Manager templates are compatible with Python 3 is advised.\u003c/p\u003e\n"],["\u003cp\u003eDeployment Manager templates generally do not require code changes to be compatible with Python 3, unless template modules or helper scripts are used.\u003c/p\u003e\n"],["\u003cp\u003eTesting templates for Python 3 compatibility can be done by attempting a test deployment, which, if successful without warnings, indicates compatibility.\u003c/p\u003e\n"],["\u003cp\u003eTemplates incompatible with Python 3 will continue to function until June 2020, but may produce warnings indicating incompatibility or different results compared to Python 2.\u003c/p\u003e\n"],["\u003cp\u003eThe Python.org porting guide can help users with migration of incompatible features to Python 3 if needed.\u003c/p\u003e\n"]]],[],null,["# Migrate your templates to Python 3\n\n[Starting on January 1, 2020](https://www.python.org/doc/sunset-python-2/),\nthe Python community will no longer update,\nfix bugs, or patch security issues for Python 2.7. We recommend that you make\nsure that your Deployment Manager templates are compatible with Python 3 as\nsoon as possible.\n\nFor an overview of the products affected by this change, including information\nabout using the Google Cloud Python client libraries, see\n[Python support on Google Cloud](/python/docs/python2-sunset).\n\nMigrating your Deployment Manager templates\n-------------------------------------------\n\nThe syntax for Deployment Manager does not use any features specific to\nPython 3. In most cases, your templates should work with Python 3 without\nrequiring code changes.\n\nIf you use [template modules](/deployment-manager/docs/configuration/templates/create-template-modules)\nsuch as helper scripts, you must make sure that the scripts are compatible with\nPython 3.\n\nFor information on porting Python 2 code to Python 3, see the\n[Python.org porting guide](https://docs.python.org/3/howto/pyporting.html).\nIf you want to test whether your template is compatible with\nPython 3, try a test deployment with the template. If the deployment succeeds\nwithout any warnings, your template is compatible, and doesn't need changes.\n\nIf your templates have features that are incompatible with Python 3, your\ndeployments will continue to work until June 2020. You might see one of\nthese warnings:\n\n- The template is incompatible with Python 3: The template runs using Python 2,\n but fails with Python 3. The warning shows the Python 3 error message, so that\n you can debug your code.\n\n- The template produced different results with Python 3 and Python 2: This\n could be because your deployment is non-deterministic (for example, it relies\n on the current time or random numbers), or a template might be using a feature\n incompatible with Python 3. If your template is non-deterministic by design,\n you don't need to change it.\n\n If your template uses a feature that is incompatible with Python 3,\n use the guidelines in the\n [Python 3 porting guide](https://docs.python.org/3/howto/pyporting.html)\n to update the template."]]