0
0
GCPcloud~30 mins

SSL certificates management in GCP - Mini Project: Build & Apply

Choose your learning style9 modes available
SSL certificates management
📖 Scenario: You are managing a website hosted on Google Cloud Platform (GCP). To secure your website, you need to create and manage SSL certificates that encrypt data between your users and your site.
🎯 Goal: Build a simple configuration to create and manage an SSL certificate resource in GCP using Infrastructure as Code.
📋 What You'll Learn
Create a resource to hold SSL certificate details
Add a configuration variable for the certificate name
Use the main logic to define the SSL certificate resource with the correct properties
Complete the configuration with the final resource block for deployment
💡 Why This Matters
🌍 Real World
SSL certificates protect websites by encrypting data, ensuring user privacy and security.
💼 Career
Managing SSL certificates is a common task for cloud engineers and infrastructure specialists to secure cloud-hosted applications.
Progress0 / 4 steps
1
Create SSL certificate data structure
Create a dictionary called ssl_certificate_data with these exact entries: 'name': 'my-ssl-cert', 'certificate': '-----BEGIN CERTIFICATE-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A...\n-----END CERTIFICATE-----', and 'private_key': '-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASC...\n-----END PRIVATE KEY-----'.
GCP
Need a hint?

Use a Python dictionary with keys 'name', 'certificate', and 'private_key' and assign the exact string values.

2
Add SSL certificate resource name variable
Create a variable called certificate_name and set it to the value of ssl_certificate_data['name'].
GCP
Need a hint?

Assign the value of the 'name' key from the ssl_certificate_data dictionary to certificate_name.

3
Define the SSL certificate resource
Create a dictionary called ssl_certificate_resource with keys 'name', 'type', and 'properties'. Set 'name' to certificate_name, 'type' to 'compute.v1.sslCertificate', and 'properties' to a dictionary with keys 'certificate' and 'privateKey' set to the corresponding values from ssl_certificate_data.
GCP
Need a hint?

Use a nested dictionary structure to define the resource with the required keys and values.

4
Complete the deployment configuration
Create a list called resources containing the ssl_certificate_resource dictionary as its only element.
GCP
Need a hint?

Wrap the ssl_certificate_resource dictionary inside a list assigned to resources.