To correctly set up the rotation_configuration schema from the gitlab_group_access_token Terraform resource, you need to understand the properties and requirements of this schema. The rotation_configuration block is used to configure the rotation of the access token.
Here's a step-by-step guide to help you set it up:
-
Understanding rotation_configuration Properties:
- The
rotation_configuration block typically includes properties like rotation_interval_days and possibly others depending on the GitLab provider version and documentation.
-
Configuring rotation_configuration:
- To enable rotation, you need to specify the
rotation_configuration block within the gitlab_group_access_token resource.
- Inside this block, you will define the rotation settings.
Here's an example configuration snippet that demonstrates how to set up rotation_configuration for a gitlab_group_access_token:
resource "gitlab_group_access_token" "example" {
group = gitlab_group.example.id
name = "example-token"
expires_at = "2024-12-31"
access_level = "developer"
rotation_configuration {
rotation_interval_days = 30 // Rotate the token every 30 days
// Other rotation configuration properties if available
}
}
In this example:
gitlab_group_access_token.example is the resource for creating a group access token.
group, name, expires_at, and access_level are required properties for the access token.
rotation_configuration is a block that configures the rotation of the access token.
rotation_interval_days = 30 specifies that the token should be rotated every 30 days.
Steps to Implement:
-
Check the GitLab Terraform Provider Documentation: Ensure you're using the correct properties within rotation_configuration as per the latest GitLab Terraform provider documentation. The properties and their requirements can change with updates to the provider.
-
Update Your Terraform Configuration: Add the rotation_configuration block to your gitlab_group_access_token resource as shown in the example.
-
Initialize and Apply Terraform Configuration: Run terraform init to ensure your Terraform working directory is initialized, and then terraform apply to create or update the resources according to your configuration.
-
Verify the Access Token Rotation: After applying the configuration, verify that the access token is rotated as per your configuration. You can check this in the GitLab UI or through the GitLab API.
By following these steps and referring to the specific documentation for the GitLab Terraform provider you're using, you should be able to correctly set up the rotation_configuration for your gitlab_group_access_token.