Update a cloud environment
Last updated
Last updated
More information
Snyk privacy policy© 2024 Snyk Limited | All product and company names and logos are trademarks of their respective owners.
You can update the following attributes for a cloud environment:
AWS: Environment name and IAM role ARN (Amazon Resource Name). The new role ARN must have the same AWS account ID as the old role ARN. See Find the role ARN.
Google: Environment name and service account email address. The new service account email must be associated with the same Project ID as the old one.
Azure: Environment name and application ID. The new application ID must be associated with the same subscription and tenant as the old one.
For example, you must update the Snyk IAM role ARN if you change the role's name in the Terraform or CloudFormation template and deploy the changes.
You can update a Snyk Cloud Environment using the following methods:
To update an environment using the Snyk Web UI:
Navigate to your Organization Settings (cog icon) > Cloud environments.
In the Actions column, select the ...
icon for the environment you want to update.
Select Update.
In the General section, enter the updated environment name, credentials, or both.
Select Save changes.
To update an environment using the Snyk API:
First, find the ID of the Cloud environment you want to update. Send a request to the /cloud/environments
endpoint in the following format:
In the output, look for the data.id
property. In the shortened example that follows, the ID is 3b7ccff9-8900-4e54-0000-1234abcd1234
:
To update an environment, send a request to the /cloud/environments/{environment_id}
endpoint in the format that follows for your cloud provider.
data.attributes.options.service_account_email
is required. You can choose to specify the Project ID explicitly with a data.attributes.options.project_id
field, but it cannot be different from the current ProjectProject ID.
data.attributes.options.tenant_id
and data.attributes.options.subscription_id
are required and cannot be different from the current values.
Snyk returns a JSON document containing the updated environment details, for example, the following response showing an AWS environment:
The data.attributes.options
and data.attributes.properties
fields in the JSON output vary depending on the cloud provider and show the updated information.