diff --git a/README.md b/README.md index fba2c1a..89a6c2b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # AWS EC2 Auto Deployment with Terraform & Shell Scripts -This project automates the provisioning of an EC2 instance and the deployment of your application on AWS using Terraform and shell scripts. It supports different environments (Dev, Prod) through configuration files and scripts. +This project automates the provisioning of an EC2 instance and the deployment of your application on AWS using Terraform and shell scripts. It supports different environments (Dev, Prod) through configuration files and deployment scripts. --- @@ -9,50 +9,58 @@ This project automates the provisioning of an EC2 instance and the deployment of ``` tech_eazy_devops_git-user-9/ ├── README.md # Project documentation -├── terraform/ # Contains Terraform configurations +├── terraform/ # Terraform configurations │ ├── main.tf # Main Terraform configuration file │ ├── outputs.tf # Defines Terraform outputs (e.g., EC2 public IP) -│ ├── variables.tf # Declares input variables for Terraform -│ ├── dev_config.tfvars # Terraform variable values for the 'dev' environment -│ └── prod_config.tfvars # Terraform variable values for the 'prod' environment -└── scripts/ # Shell scripts for deployment and configuration - ├── deploy.sh # Automates the Terraform apply process for a given environment - ├── dev_script.sh # User-data script for configuring EC2 in the 'dev' environment - └── prod_script.sh # User-data script for configuring EC2 in the 'prod' environment +│ ├── variables.tf # Public variables file for EC2 and other details +│ ├── dev_config.tfvars # Variable values for 'Dev' environment +│ ├── prod_config.tfvars # Variable values for 'Prod' environment +├── scripts/ # Shell scripts for provisioning and deployments +│ ├── deploy.sh # Automates provisioning with Terraform +│ ├── dev_script.sh # Dev-specific configuration script for EC2 +│ ├── prod_script.sh # Production-specific script for EC2 +│ ├── verify_logs.sh # Validates and uploads logs +├── mylogs/ # Application and system logs +│ ├── app/ # Stores runtime application logs +│ │ └── my-app.log # Main application log +│ └── system/ # Tracks provisioning/system logs +│ └── cloud-init.log # Logs of initialization processes +└── .gitignore # Lists files to exclude from version control ``` --- ## ⚙️ **Prerequisites** -Before you begin, ensure you have the following: +Ensure the following tools and resources are configured before deploying: -- **AWS Account** with EC2 access and permissions to create resources -- **IAM User** with programmatic access (access key ID and secret access key) -- **AWS CLI** installed and configured -- **Terraform** installed (version >= 1.0 recommended) -- **Git** (optional, for repository operations) +- **AWS Account** with IAM permissions for creating EC2, S3, and other resources. +- **IAM User** with access keys for programmatic access. +- **AWS CLI** installed and configured on your machine. +- **Terraform** (version >= 1.0 recommended). +- **Git** installed for version control. +- An **EC2 Key Pair** set up in AWS Console for securely accessing instances (see [Key Pair Section](#ec2-key-pair-requirement)). --- ## 🔐 **AWS Credentials Setup** -You must set your AWS credentials in your local environment so Terraform can authenticate with AWS. +Terraform authenticates with AWS using your configured credentials. -### Option 1: Using AWS CLI (Recommended) +### Option 1: AWS CLI (Recommended) ```bash aws configure ``` - -You'll be prompted to input your: +Provide the following inputs: - AWS Access Key ID - AWS Secret Access Key -- Default region name (e.g., `ap-south-1`) +- Default AWS region (e.g., `ap-south-1`) - Default output format (e.g., `json`) -### Option 2: Set environment variables directly +### Option 2: Environment Variables +Set environment variables explicitly: ```bash export AWS_ACCESS_KEY_ID=your_access_key export AWS_SECRET_ACCESS_KEY=your_secret_key @@ -61,67 +69,118 @@ export AWS_DEFAULT_REGION=ap-south-1 --- +## EC2 Key Pair Requirement + +Ensure you have an EC2 Key Pair set up in the AWS Console. Update the key pair's name in these files: + +**`terraform/variables.tf`** +```hcl +variable "key_name" { + default = "your-key-name-here" +} +``` + +**`terraform/dev_config.tfvars`** +```hcl +key_name = "your-key-name-here" +``` + +**`terraform/prod_config.tfvars`** +```hcl +key_name = "your-key-name-here" +``` + +The Key Pair ensures secure SSH access to the instances. + +--- + ## 🚀 **How to Deploy** ### 1️⃣ Clone the Repository - ```bash -git clone https://github.com/git-user-9/tech_eazy_devops_git-user-9.git app -cd app +git clone https://github.com/git-user-9/tech_eazy_devops_git-user-9.git +cd tech_eazy_devops_git-user-9 ``` ### 2️⃣ Run the Deployment Script - ```bash -./scripts/deploy.sh dev # For Dev environment -./scripts/deploy.sh prod # For Prod environment +./scripts/deploy.sh dev # For Development Environment +./scripts/deploy.sh prod # For Production Environment ``` - -The script will: -- Load the corresponding Terraform variable file -- Initialize and apply the Terraform configuration +This will: +- Apply Terraform configurations for selected environment - Output the public IP of the created EC2 instance -- Upload logs to S3 bucket -- Shutdown the instance after 10-15 minutes (configurable) +- Upload logs to S3 automatically +- Terminate the instance after 10-15 minutes if configured ### 3️⃣ Access the Application - -Visit the public IP shown in the terminal: - +Navigate to: ``` -http://:80 +http://:80 ``` --- -## 🛠️ **What Happens Behind the Scenes** +## 🛠️ **Details of Automation** -### Terraform provisions: -- EC2 instance in default VPC -- Security group with ports 22 (SSH) and 80 (HTTP) open +### Terraform Provisions: +- **EC2 Instances** within the default VPC. +- **Security Groups** with HTTP (80) and SSH (22) access. +- **IAM Roles** for instances to access S3. -### User Data (inside shell script): -- Updates the system -- Installs AWS CLI, curl, unzip, Java 21, Git, and Maven -- Clones and builds your application -- Launches the application on port 80 -- Uploads logs to S3 bucket -- Shuts down the instance after 10-15 minutes (configurable) +### Shell Scripts: +- Update operating system packages. +- Install required tools such as Java, Git, Maven, AWS CLI, etc. +- Clone, build, and run the application on Port 80. +- Upload logs to the S3 bucket. --- -## ✅ **Security Notes** +## Note on Pulling Logs from EC2 to Local + +To enable **log pulling from EC2 to your local machine,** follow these steps: + +1. **Uncomment Lines in the Script:** + *This step is only if you want logs to be fetched from s3 to your local directory* + Locate the following lines in your deployment script between **lines 52–59** and uncomment them: + + ```bash + # Wait a while for logs to upload + sleep 100 + cd .. # Save logs at the root level + PRIVATE_KEY_PATH="/Users/default/CS/DevOps/AWS/ssh-key-ec2.pem" # Change this to your SSH private key path and ensure `chmod 400` on your key + echo "Trying to SCP logs to local" + scp -r -i "$PRIVATE_KEY_PATH" ubuntu@$VERIFIER_IP:/mylogs/ . # Pull logs from EC2 to /mylogs/ in your local directory + cd $TERRAFORM_DIR # Return to Terraform directory for destroy commands + ``` + +2. **Specify Your Private Key Path:** + - Replace the placeholder `"/Users/default/CS/DevOps/AWS/ssh-key-ec2.pem"` under the variable `PRIVATE_KEY_PATH` with the actual path to your EC2 key's private key file. + - Before using, ensure the private key has the appropriate permissions by running: + ```bash + chmod 400 /path/to/your/private-key.pem + ``` + +3. **Save the logs locally:** + After successfully setting this up, the script will pull logs from `/mylogs/` on your EC2 instance to a local `/mylogs/` directory at the repository's root level. + +This addition ensures your logs are saved to your local environment automatically. + -- No sensitive keys are stored in the repo -- Make sure your security group is restricted to specific IPs if used in production -- Rotate AWS credentials regularly --- -## 💬 **FAQ** +## 💬 **FAQs** -**Q: Can I deploy to a different AWS region?** -Yes. Modify the `aws_region` value in `terraform/variables.tf`, `dev_config.tfvars` and `prod_config.tfvars` +**Q: How can I deploy in a different region?** +Modify the `aws_region` variable in the `terraform/variables.tf` file and update it in the `.tfvars` files. +**Q: What happens if deployment fails?** +Terraform maintains a state file. Retry by running the deployment script again. + +**Q: Where can I find the logs?** +Logs are stored in the `mylogs/` directory or uploaded to the configured S3 bucket. + +--- diff --git a/mylogs/app/my-app.log b/mylogs/app/my-app.log new file mode 100644 index 0000000..8cd204e --- /dev/null +++ b/mylogs/app/my-app.log @@ -0,0 +1,19 @@ + + . ____ _ __ _ _ + /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ +( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ + \\/ ___)| |_)| | | | | || (_| | ) ) ) ) + ' |____| .__|_| |_|_| |_\__, | / / / / + =========|_|==============|___/=/_/_/_/ + + :: Spring Boot :: (v3.4.6) + +2025-07-08T23:23:28.441Z INFO 4086 --- [techeazy-devops] [ main] c.t.devops.TecheazyDevopsApplication : Starting TecheazyDevopsApplication v0.0.1-SNAPSHOT using Java 21.0.7 with PID 4086 (/home/ubuntu/app/target/techeazy-devops-0.0.1-SNAPSHOT.jar started by root in /home/ubuntu/app) +2025-07-08T23:23:28.445Z INFO 4086 --- [techeazy-devops] [ main] c.t.devops.TecheazyDevopsApplication : No active profile set, falling back to 1 default profile: "default" +2025-07-08T23:23:30.381Z INFO 4086 --- [techeazy-devops] [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port 80 (http) +2025-07-08T23:23:30.411Z INFO 4086 --- [techeazy-devops] [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] +2025-07-08T23:23:30.411Z INFO 4086 --- [techeazy-devops] [ main] o.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.1.41] +2025-07-08T23:23:30.612Z INFO 4086 --- [techeazy-devops] [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext +2025-07-08T23:23:30.615Z INFO 4086 --- [techeazy-devops] [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 2078 ms +2025-07-08T23:23:31.650Z INFO 4086 --- [techeazy-devops] [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port 80 (http) with context path '/' +2025-07-08T23:23:31.676Z INFO 4086 --- [techeazy-devops] [ main] c.t.devops.TecheazyDevopsApplication : Started TecheazyDevopsApplication in 4.078 seconds (process running for 4.942) diff --git a/mylogs/system/cloud-init.log b/mylogs/system/cloud-init.log new file mode 100644 index 0000000..5df6c3e --- /dev/null +++ b/mylogs/system/cloud-init.log @@ -0,0 +1,832 @@ +2025-07-08 23:21:22,477 - log_util.py[DEBUG]: Cloud-init v. 25.1.2-0ubuntu0~24.04.1 running 'init-local' at Tue, 08 Jul 2025 23:21:22 +0000. Up 6.54 seconds. +2025-07-08 23:21:22,478 - main.py[INFO]: PID [1] started cloud-init 'init-local'. +2025-07-08 23:21:22,478 - main.py[DEBUG]: No kernel command line url found. +2025-07-08 23:21:22,478 - main.py[DEBUG]: Closing stdin +2025-07-08 23:21:22,482 - util.py[DEBUG]: Writing to /var/log/cloud-init.log - ab: [640] 0 bytes +2025-07-08 23:21:22,483 - util.py[DEBUG]: Changing the ownership of /var/log/cloud-init.log to 102:4 +2025-07-08 23:21:22,483 - util.py[DEBUG]: Writing to /var/lib/cloud/data/python-version - wb: [644] 4 bytes +2025-07-08 23:21:22,483 - util.py[DEBUG]: Attempting to remove /var/lib/cloud/instance/boot-finished +2025-07-08 23:21:22,483 - handlers.py[DEBUG]: start: init-local/check-cache: attempting to read from cache [check] +2025-07-08 23:21:22,483 - util.py[DEBUG]: Reading from /var/lib/cloud/instance/obj.pkl (quiet=False) +2025-07-08 23:21:22,483 - stages.py[DEBUG]: no cache found +2025-07-08 23:21:22,483 - handlers.py[DEBUG]: finish: init-local/check-cache: SUCCESS: no cache found +2025-07-08 23:21:22,488 - stages.py[DEBUG]: Using distro class +2025-07-08 23:21:22,488 - sources[DEBUG]: Looking for data source in: ['Ec2', 'None'], via packages ['', 'cloudinit.sources'] that matches dependencies ['FILESYSTEM'] +2025-07-08 23:21:22,513 - sources[DEBUG]: Searching for local data source in: ['DataSourceEc2Local'] +2025-07-08 23:21:22,513 - handlers.py[DEBUG]: start: init-local/search-Ec2Local: searching for local data from DataSourceEc2Local +2025-07-08 23:21:22,513 - sources[DEBUG]: Seeing if we can get any data from +2025-07-08 23:21:22,513 - sources[DEBUG]: Update datasource metadata and network config due to events: boot-new-instance +2025-07-08 23:21:22,513 - util.py[DEBUG]: Reading from /sys/hypervisor/uuid (quiet=False) +2025-07-08 23:21:22,513 - util.py[DEBUG]: Reading 37 bytes from /sys/hypervisor/uuid +2025-07-08 23:21:22,514 - dmi.py[DEBUG]: querying dmi data /sys/class/dmi/id/product_serial +2025-07-08 23:21:22,514 - dmi.py[DEBUG]: querying dmi data /sys/class/dmi/id/chassis_asset_tag +2025-07-08 23:21:22,514 - dmi.py[DEBUG]: querying dmi data /sys/class/dmi/id/sys_vendor +2025-07-08 23:21:22,514 - dmi.py[DEBUG]: querying dmi data /sys/class/dmi/id/product_name +2025-07-08 23:21:22,514 - sources[DEBUG]: Detected DataSourceEc2Local +2025-07-08 23:21:22,514 - DataSourceEc2.py[DEBUG]: strict_mode: warn, cloud_name=aws cloud_platform=ec2 +2025-07-08 23:21:22,514 - util.py[DEBUG]: Reading from /sys/class/net/enX0/name_assign_type (quiet=False) +2025-07-08 23:21:22,514 - util.py[DEBUG]: Reading 2 bytes from /sys/class/net/enX0/name_assign_type +2025-07-08 23:21:22,514 - util.py[DEBUG]: Reading from /sys/class/net/enX0/address (quiet=False) +2025-07-08 23:21:22,514 - util.py[DEBUG]: Reading 18 bytes from /sys/class/net/enX0/address +2025-07-08 23:21:22,514 - util.py[DEBUG]: Reading from /sys/class/net/enX0/device/device (quiet=False) +2025-07-08 23:21:22,515 - util.py[DEBUG]: Reading from /sys/class/net/lo/address (quiet=False) +2025-07-08 23:21:22,515 - util.py[DEBUG]: Reading 18 bytes from /sys/class/net/lo/address +2025-07-08 23:21:22,515 - util.py[DEBUG]: Reading from /sys/class/net/lo/device/device (quiet=False) +2025-07-08 23:21:22,515 - util.py[DEBUG]: Reading from /sys/class/net/enX0/carrier (quiet=False) +2025-07-08 23:21:22,515 - net[DEBUG]: Interface has no carrier: enX0 +2025-07-08 23:21:22,515 - util.py[DEBUG]: Reading from /sys/class/net/enX0/dormant (quiet=False) +2025-07-08 23:21:22,515 - util.py[DEBUG]: Reading from /sys/class/net/enX0/operstate (quiet=False) +2025-07-08 23:21:22,515 - util.py[DEBUG]: Reading 5 bytes from /sys/class/net/enX0/operstate +2025-07-08 23:21:22,515 - ephemeral.py[DEBUG]: No connectivity URLs provided. Skipping connectivity check before ephemeral network setup. +2025-07-08 23:21:22,515 - ephemeral.py[DEBUG]: No connectivity to IMDS, attempting DHCP setup. +2025-07-08 23:21:22,515 - subp.py[DEBUG]: Running command ['ip', '--json', 'addr'] with allowed return codes [0] (shell=False, capture=True) +2025-07-08 23:21:22,542 - performance.py[DEBUG]: Running ['ip', '--json', 'addr'] took 0.027 seconds +2025-07-08 23:21:22,542 - ephemeral.py[DEBUG]: No connectivity URLs provided. Skipping connectivity check before ephemeral network setup. +2025-07-08 23:21:22,542 - distros[DEBUG]: Using configured dhcp client priority list: ['dhcpcd', 'dhclient', 'udhcpc'] +2025-07-08 23:21:22,543 - distros[DEBUG]: DHCP client selected: dhcpcd +2025-07-08 23:21:22,543 - dhcp.py[DEBUG]: Performing a dhcp discovery on enX0 +2025-07-08 23:21:22,543 - subp.py[DEBUG]: Running command ['ip', 'link', 'set', 'dev', 'enX0', 'up'] with allowed return codes [0] (shell=False, capture=True) +2025-07-08 23:21:22,545 - util.py[DEBUG]: Reading from /sys/class/net/enX0/type (quiet=False) +2025-07-08 23:21:22,545 - util.py[DEBUG]: Reading 2 bytes from /sys/class/net/enX0/type +2025-07-08 23:21:22,545 - subp.py[DEBUG]: Running command ['dhcpcd', '--ipv4only', '--waitip', '--persistent', '--noarp', '--script=/bin/true', 'enX0'] with allowed return codes [0] (shell=False, capture=True) +2025-07-08 23:21:23,157 - performance.py[DEBUG]: Running ['dhcpcd', '--ipv4only', '--waitip', '--persistent', '--noarp', '--script=/bin/true', 'enX0'] took 0.612 seconds +2025-07-08 23:21:23,157 - subp.py[DEBUG]: Running command ['dhcpcd', '--dumplease', '--ipv4only', 'enX0'] with allowed return codes [0] (shell=False, capture=True) +2025-07-08 23:21:23,162 - dhcp.py[DEBUG]: Parsing dhcpcd lease for interface enX0: 'reason=BOUND\ninterface=enX0\nprotocol=dhcp\nip_address=172.31.0.146\nsubnet_cidr=20\nnetwork_number=172.31.0.0\nsubnet_mask=255.255.240.0\nrouters=172.31.0.1\ndomain_name_servers=172.31.0.2\nhost_name=ip-172-31-0-146\ndomain_name=ap-south-1.compute.internal\ninterface_mtu=9001\nbroadcast_address=172.31.15.255\ndhcp_lease_time=3600\ndhcp_message_type=5\ndhcp_server_identifier=172.31.0.1\n' +2025-07-08 23:21:23,162 - util.py[DEBUG]: Reading from /var/lib/dhcpcd/enX0.lease (quiet=False) +2025-07-08 23:21:23,162 - util.py[DEBUG]: Reading 548 bytes from /var/lib/dhcpcd/enX0.lease +2025-07-08 23:21:23,162 - subp.py[DEBUG]: Running command ['dhcpcd', '--ipv4only', '--waitip', '--persistent', '--noarp', '--script=/bin/true', 'enX0', '-P'] with allowed return codes [0] (shell=False, capture=True) +2025-07-08 23:21:23,164 - util.py[DEBUG]: Reading from /run/dhcpcd/enX0-4.pid (quiet=False) +2025-07-08 23:21:23,164 - util.py[DEBUG]: Reading 4 bytes from /run/dhcpcd/enX0-4.pid +2025-07-08 23:21:23,164 - util.py[DEBUG]: Reading from /proc/444/stat (quiet=True) +2025-07-08 23:21:23,164 - util.py[DEBUG]: Reading 304 bytes from /proc/444/stat +2025-07-08 23:21:23,164 - dhcp.py[DEBUG]: killing dhcpcd with pid=444 gid=443 +2025-07-08 23:21:23,165 - ephemeral.py[DEBUG]: Received dhcp lease on enX0 for 172.31.0.146/255.255.240.0 +2025-07-08 23:21:23,165 - ephemeral.py[DEBUG]: Attempting setup of ephemeral network on enX0 with 172.31.0.146/20 brd 172.31.15.255 +2025-07-08 23:21:23,165 - subp.py[DEBUG]: Running command ['ip', '--json', 'addr'] with allowed return codes [0] (shell=False, capture=True) +2025-07-08 23:21:23,167 - ephemeral.py[DEBUG]: Skip adding ip address: enX0 already has address 172.31.0.146 +2025-07-08 23:21:23,167 - ephemeral.py[DEBUG]: Skip bringing up network link: interface enX0 is already up +2025-07-08 23:21:23,167 - subp.py[DEBUG]: Running command ['ip', 'route', 'show', '0.0.0.0/0'] with allowed return codes [0] (shell=False, capture=True) +2025-07-08 23:21:23,169 - ephemeral.py[DEBUG]: Skip ephemeral route setup. enX0 already has default route: default via 172.31.0.1 dev enX0 proto dhcp src 172.31.0.146 metric 1002 mtu 9001 +2025-07-08 23:21:23,169 - ephemeral.py[DEBUG]: Successfully brought up enX0 for ephemeral ipv4 networking. +2025-07-08 23:21:23,169 - util.py[DEBUG]: Reading from /sys/class/net/enX0/operstate (quiet=False) +2025-07-08 23:21:23,169 - util.py[DEBUG]: Reading 3 bytes from /sys/class/net/enX0/operstate +2025-07-08 23:21:23,169 - ephemeral.py[DEBUG]: Successfully brought up enX0 for ephemeral ipv6 networking. +2025-07-08 23:21:23,172 - DataSourceEc2.py[DEBUG]: Removed the following from metadata urls: ['http://instance-data.:8773'] +2025-07-08 23:21:23,172 - DataSourceEc2.py[DEBUG]: Fetching Ec2 IMDSv2 API Token +2025-07-08 23:21:23,173 - url_helper.py[DEBUG]: [0/1] open 'http://169.254.169.254/latest/api/token' with {'url': 'http://169.254.169.254/latest/api/token', 'stream': False, 'allow_redirects': True, 'method': 'PUT', 'timeout': 50.0, 'headers': {'X-aws-ec2-metadata-token-ttl-seconds': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,186 - url_helper.py[DEBUG]: Read from http://169.254.169.254/latest/api/token (200, 56b) after 1 attempts +2025-07-08 23:21:23,187 - DataSourceEc2.py[DEBUG]: Using metadata source: 'http://169.254.169.254' +2025-07-08 23:21:23,187 - url_helper.py[DEBUG]: [0/1] open 'http://169.254.169.254/2021-03-23/meta-data/instance-id' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/instance-id', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,188 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/instance-id (200, 19b) after 1 attempts +2025-07-08 23:21:23,188 - DataSourceEc2.py[DEBUG]: Found preferred metadata version 2021-03-23 +2025-07-08 23:21:23,189 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/user-data' with {'url': 'http://169.254.169.254/2021-03-23/user-data', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,190 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/user-data (200, 973b) after 1 attempts +2025-07-08 23:21:23,191 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,192 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/ (200, 331b) after 1 attempts +2025-07-08 23:21:23,192 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/block-device-mapping/' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/block-device-mapping/', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,202 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/block-device-mapping/ (200, 30b) after 1 attempts +2025-07-08 23:21:23,202 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/block-device-mapping/ami' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/block-device-mapping/ami', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,205 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/block-device-mapping/ami (200, 4b) after 1 attempts +2025-07-08 23:21:23,205 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/block-device-mapping/ephemeral0' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/block-device-mapping/ephemeral0', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,208 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/block-device-mapping/ephemeral0 (200, 3b) after 1 attempts +2025-07-08 23:21:23,208 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/block-device-mapping/ephemeral1' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/block-device-mapping/ephemeral1', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,210 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/block-device-mapping/ephemeral1 (200, 3b) after 1 attempts +2025-07-08 23:21:23,210 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/block-device-mapping/root' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/block-device-mapping/root', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,212 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/block-device-mapping/root (200, 9b) after 1 attempts +2025-07-08 23:21:23,212 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/events/' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/events/', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,214 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/events/ (200, 12b) after 1 attempts +2025-07-08 23:21:23,214 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/events/maintenance/' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/events/maintenance/', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,217 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/events/maintenance/ (200, 17b) after 1 attempts +2025-07-08 23:21:23,217 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/events/maintenance/history' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/events/maintenance/history', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,219 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/events/maintenance/history (200, 2b) after 1 attempts +2025-07-08 23:21:23,219 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/events/maintenance/scheduled' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/events/maintenance/scheduled', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,220 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/events/maintenance/scheduled (200, 2b) after 1 attempts +2025-07-08 23:21:23,221 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/hibernation/' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/hibernation/', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,222 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/hibernation/ (200, 10b) after 1 attempts +2025-07-08 23:21:23,223 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/hibernation/configured' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/hibernation/configured', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,224 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/hibernation/configured (200, 5b) after 1 attempts +2025-07-08 23:21:23,225 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/iam/' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/iam/', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,226 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/iam/ (200, 26b) after 1 attempts +2025-07-08 23:21:23,226 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/iam/info' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/iam/info', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,228 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/iam/info (200, 217b) after 1 attempts +2025-07-08 23:21:23,228 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/identity-credentials/' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/identity-credentials/', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,233 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/identity-credentials/ (200, 4b) after 1 attempts +2025-07-08 23:21:23,233 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/identity-credentials/ec2/' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/identity-credentials/ec2/', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,234 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/identity-credentials/ec2/ (200, 26b) after 1 attempts +2025-07-08 23:21:23,234 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/identity-credentials/ec2/info' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/identity-credentials/ec2/info', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,236 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/identity-credentials/ec2/info (200, 98b) after 1 attempts +2025-07-08 23:21:23,236 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/metrics/' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/metrics/', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,238 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/metrics/ (200, 7b) after 1 attempts +2025-07-08 23:21:23,239 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/metrics/vhostmd' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/metrics/vhostmd', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,240 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/metrics/vhostmd (200, 38b) after 1 attempts +2025-07-08 23:21:23,241 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/network/' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/network/', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,243 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/network/ (200, 11b) after 1 attempts +2025-07-08 23:21:23,243 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/network/interfaces/' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/network/interfaces/', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,244 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/network/interfaces/ (200, 5b) after 1 attempts +2025-07-08 23:21:23,245 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,246 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/ (200, 18b) after 1 attempts +2025-07-08 23:21:23,246 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/0a:bb:30:76:3f:2f/' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/0a:bb:30:76:3f:2f/', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,248 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/0a:bb:30:76:3f:2f/ (200, 230b) after 1 attempts +2025-07-08 23:21:23,248 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/0a:bb:30:76:3f:2f/ipv4-associations/' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/0a:bb:30:76:3f:2f/ipv4-associations/', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,251 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/0a:bb:30:76:3f:2f/ipv4-associations/ (200, 13b) after 1 attempts +2025-07-08 23:21:23,252 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/0a:bb:30:76:3f:2f/ipv4-associations/13.204.68.197' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/0a:bb:30:76:3f:2f/ipv4-associations/13.204.68.197', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,253 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/0a:bb:30:76:3f:2f/ipv4-associations/13.204.68.197 (200, 12b) after 1 attempts +2025-07-08 23:21:23,254 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/0a:bb:30:76:3f:2f/device-number' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/0a:bb:30:76:3f:2f/device-number', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,255 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/0a:bb:30:76:3f:2f/device-number (200, 1b) after 1 attempts +2025-07-08 23:21:23,255 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/0a:bb:30:76:3f:2f/interface-id' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/0a:bb:30:76:3f:2f/interface-id', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,261 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/0a:bb:30:76:3f:2f/interface-id (200, 21b) after 1 attempts +2025-07-08 23:21:23,262 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/0a:bb:30:76:3f:2f/local-hostname' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/0a:bb:30:76:3f:2f/local-hostname', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,263 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/0a:bb:30:76:3f:2f/local-hostname (200, 43b) after 1 attempts +2025-07-08 23:21:23,264 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/0a:bb:30:76:3f:2f/local-ipv4s' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/0a:bb:30:76:3f:2f/local-ipv4s', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,265 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/0a:bb:30:76:3f:2f/local-ipv4s (200, 12b) after 1 attempts +2025-07-08 23:21:23,265 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/0a:bb:30:76:3f:2f/mac' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/0a:bb:30:76:3f:2f/mac', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,267 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/0a:bb:30:76:3f:2f/mac (200, 17b) after 1 attempts +2025-07-08 23:21:23,267 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/0a:bb:30:76:3f:2f/owner-id' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/0a:bb:30:76:3f:2f/owner-id', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,268 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/0a:bb:30:76:3f:2f/owner-id (200, 12b) after 1 attempts +2025-07-08 23:21:23,269 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/0a:bb:30:76:3f:2f/public-hostname' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/0a:bb:30:76:3f:2f/public-hostname', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,271 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/0a:bb:30:76:3f:2f/public-hostname (200, 50b) after 1 attempts +2025-07-08 23:21:23,271 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/0a:bb:30:76:3f:2f/public-ipv4s' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/0a:bb:30:76:3f:2f/public-ipv4s', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,273 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/0a:bb:30:76:3f:2f/public-ipv4s (200, 13b) after 1 attempts +2025-07-08 23:21:23,273 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/0a:bb:30:76:3f:2f/security-group-ids' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/0a:bb:30:76:3f:2f/security-group-ids', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,274 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/0a:bb:30:76:3f:2f/security-group-ids (200, 20b) after 1 attempts +2025-07-08 23:21:23,275 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/0a:bb:30:76:3f:2f/security-groups' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/0a:bb:30:76:3f:2f/security-groups', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,276 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/0a:bb:30:76:3f:2f/security-groups (200, 10b) after 1 attempts +2025-07-08 23:21:23,277 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/0a:bb:30:76:3f:2f/subnet-id' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/0a:bb:30:76:3f:2f/subnet-id', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,279 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/0a:bb:30:76:3f:2f/subnet-id (200, 24b) after 1 attempts +2025-07-08 23:21:23,279 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/0a:bb:30:76:3f:2f/subnet-ipv4-cidr-block' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/0a:bb:30:76:3f:2f/subnet-ipv4-cidr-block', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,280 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/0a:bb:30:76:3f:2f/subnet-ipv4-cidr-block (200, 13b) after 1 attempts +2025-07-08 23:21:23,281 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/0a:bb:30:76:3f:2f/vpc-id' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/0a:bb:30:76:3f:2f/vpc-id', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,283 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/0a:bb:30:76:3f:2f/vpc-id (200, 21b) after 1 attempts +2025-07-08 23:21:23,283 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/0a:bb:30:76:3f:2f/vpc-ipv4-cidr-block' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/0a:bb:30:76:3f:2f/vpc-ipv4-cidr-block', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,284 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/0a:bb:30:76:3f:2f/vpc-ipv4-cidr-block (200, 13b) after 1 attempts +2025-07-08 23:21:23,285 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/0a:bb:30:76:3f:2f/vpc-ipv4-cidr-blocks' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/0a:bb:30:76:3f:2f/vpc-ipv4-cidr-blocks', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,286 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/network/interfaces/macs/0a:bb:30:76:3f:2f/vpc-ipv4-cidr-blocks (200, 13b) after 1 attempts +2025-07-08 23:21:23,287 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/placement/' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/placement/', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,288 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/placement/ (200, 45b) after 1 attempts +2025-07-08 23:21:23,288 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/placement/availability-zone' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/placement/availability-zone', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,290 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/placement/availability-zone (200, 11b) after 1 attempts +2025-07-08 23:21:23,290 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/placement/availability-zone-id' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/placement/availability-zone-id', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,292 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/placement/availability-zone-id (200, 8b) after 1 attempts +2025-07-08 23:21:23,292 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/placement/region' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/placement/region', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,294 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/placement/region (200, 10b) after 1 attempts +2025-07-08 23:21:23,295 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/public-keys/' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/public-keys/', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,296 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/public-keys/ (200, 13b) after 1 attempts +2025-07-08 23:21:23,296 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/public-keys/0/openssh-key' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/public-keys/0/openssh-key', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,297 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/public-keys/0/openssh-key (200, 93b) after 1 attempts +2025-07-08 23:21:23,298 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/services/' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/services/', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,299 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/services/ (200, 16b) after 1 attempts +2025-07-08 23:21:23,299 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/services/domain' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/services/domain', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,300 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/services/domain (200, 13b) after 1 attempts +2025-07-08 23:21:23,301 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/services/partition' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/services/partition', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,302 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/services/partition (200, 3b) after 1 attempts +2025-07-08 23:21:23,302 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/ami-id' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/ami-id', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,304 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/ami-id (200, 21b) after 1 attempts +2025-07-08 23:21:23,304 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/ami-launch-index' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/ami-launch-index', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,306 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/ami-launch-index (200, 1b) after 1 attempts +2025-07-08 23:21:23,307 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/ami-manifest-path' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/ami-manifest-path', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,308 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/ami-manifest-path (200, 9b) after 1 attempts +2025-07-08 23:21:23,308 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/hostname' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/hostname', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,310 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/hostname (200, 43b) after 1 attempts +2025-07-08 23:21:23,310 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/instance-action' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/instance-action', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,312 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/instance-action (200, 4b) after 1 attempts +2025-07-08 23:21:23,312 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/instance-id' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/instance-id', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,314 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/instance-id (200, 19b) after 1 attempts +2025-07-08 23:21:23,314 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/instance-life-cycle' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/instance-life-cycle', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,315 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/instance-life-cycle (200, 9b) after 1 attempts +2025-07-08 23:21:23,315 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/instance-type' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/instance-type', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,317 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/instance-type (200, 8b) after 1 attempts +2025-07-08 23:21:23,317 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/local-hostname' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/local-hostname', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,319 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/local-hostname (200, 43b) after 1 attempts +2025-07-08 23:21:23,319 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/local-ipv4' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/local-ipv4', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,321 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/local-ipv4 (200, 12b) after 1 attempts +2025-07-08 23:21:23,321 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/mac' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/mac', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,322 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/mac (200, 17b) after 1 attempts +2025-07-08 23:21:23,322 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/profile' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/profile', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,324 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/profile (200, 11b) after 1 attempts +2025-07-08 23:21:23,324 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/public-hostname' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/public-hostname', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,325 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/public-hostname (200, 50b) after 1 attempts +2025-07-08 23:21:23,325 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/public-ipv4' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/public-ipv4', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,327 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/public-ipv4 (200, 13b) after 1 attempts +2025-07-08 23:21:23,327 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/reservation-id' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/reservation-id', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,328 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/reservation-id (200, 19b) after 1 attempts +2025-07-08 23:21:23,329 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/meta-data/security-groups' with {'url': 'http://169.254.169.254/2021-03-23/meta-data/security-groups', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,330 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/meta-data/security-groups (200, 10b) after 1 attempts +2025-07-08 23:21:23,330 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/dynamic/instance-identity' with {'url': 'http://169.254.169.254/2021-03-23/dynamic/instance-identity', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,332 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/dynamic/instance-identity (200, 32b) after 1 attempts +2025-07-08 23:21:23,332 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/dynamic/instance-identity/document' with {'url': 'http://169.254.169.254/2021-03-23/dynamic/instance-identity/document', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,333 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/dynamic/instance-identity/document (200, 478b) after 1 attempts +2025-07-08 23:21:23,333 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/dynamic/instance-identity/pkcs7' with {'url': 'http://169.254.169.254/2021-03-23/dynamic/instance-identity/pkcs7', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,335 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/dynamic/instance-identity/pkcs7 (200, 1171b) after 1 attempts +2025-07-08 23:21:23,335 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/dynamic/instance-identity/rsa2048' with {'url': 'http://169.254.169.254/2021-03-23/dynamic/instance-identity/rsa2048', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,336 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/dynamic/instance-identity/rsa2048 (200, 1495b) after 1 attempts +2025-07-08 23:21:23,337 - url_helper.py[DEBUG]: [0/6] open 'http://169.254.169.254/2021-03-23/dynamic/instance-identity/signature' with {'url': 'http://169.254.169.254/2021-03-23/dynamic/instance-identity/signature', 'stream': False, 'allow_redirects': True, 'method': 'GET', 'timeout': 5.0, 'headers': {'X-aws-ec2-metadata-token': 'REDACTED', 'User-Agent': 'Cloud-Init/25.1.2-0ubuntu0~24.04.1'}} configuration +2025-07-08 23:21:23,347 - url_helper.py[DEBUG]: Read from http://169.254.169.254/2021-03-23/dynamic/instance-identity/signature (200, 174b) after 1 attempts +2025-07-08 23:21:23,347 - DataSourceEc2.py[DEBUG]: Crawled metadata service using link-local ipv6 +2025-07-08 23:21:23,347 - subp.py[DEBUG]: Running command ['ip', '-family', 'inet', 'link', 'set', 'dev', 'enX0', 'down'] with allowed return codes [0] (shell=False, capture=True) +2025-07-08 23:21:23,349 - subp.py[DEBUG]: Running command ['ip', '-family', 'inet', 'addr', 'del', '172.31.0.146/20', 'dev', 'enX0'] with allowed return codes [0] (shell=False, capture=True) +2025-07-08 23:21:23,352 - util.py[DEBUG]: Writing to /run/cloud-init/cloud-id-aws - wb: [644] 4 bytes +2025-07-08 23:21:23,353 - util.py[DEBUG]: Creating symbolic link from '/run/cloud-init/cloud-id' => '/run/cloud-init/cloud-id-aws' +2025-07-08 23:21:23,353 - atomic_helper.py[DEBUG]: Atomically writing to file /run/cloud-init/instance-data-sensitive.json (via temporary file /run/cloud-init/tmpqymkexef) - w: [600] 14676 bytes/chars +2025-07-08 23:21:23,353 - atomic_helper.py[DEBUG]: Atomically writing to file /run/cloud-init/instance-data.json (via temporary file /run/cloud-init/tmpas60h_ke) - w: [644] 8121 bytes/chars +2025-07-08 23:21:23,354 - performance.py[DEBUG]: Getting metadata took 0.840 seconds +2025-07-08 23:21:23,354 - handlers.py[DEBUG]: finish: init-local/search-Ec2Local: SUCCESS: found local data from DataSourceEc2Local +2025-07-08 23:21:23,354 - util.py[DEBUG]: Attempting to remove /var/lib/cloud/instance +2025-07-08 23:21:23,354 - stages.py[INFO]: Loaded datasource DataSourceEc2Local - DataSourceEc2Local +2025-07-08 23:21:23,354 - util.py[DEBUG]: Reading from /etc/cloud/cloud.cfg (quiet=False) +2025-07-08 23:21:23,354 - util.py[DEBUG]: Reading 3718 bytes from /etc/cloud/cloud.cfg +2025-07-08 23:21:23,355 - util.py[DEBUG]: Attempting to load yaml from string of length 3718 with allowed root types (,) +2025-07-08 23:21:23,362 - util.py[DEBUG]: Reading from /etc/cloud/cloud.cfg.d/90_dpkg.cfg (quiet=False) +2025-07-08 23:21:23,362 - util.py[DEBUG]: Reading 343 bytes from /etc/cloud/cloud.cfg.d/90_dpkg.cfg +2025-07-08 23:21:23,362 - util.py[DEBUG]: Attempting to load yaml from string of length 343 with allowed root types (,) +2025-07-08 23:21:23,363 - util.py[DEBUG]: Reading from /etc/cloud/cloud.cfg.d/90-cpc-grub.cfg (quiet=False) +2025-07-08 23:21:23,363 - util.py[DEBUG]: Reading 108 bytes from /etc/cloud/cloud.cfg.d/90-cpc-grub.cfg +2025-07-08 23:21:23,363 - util.py[DEBUG]: Attempting to load yaml from string of length 108 with allowed root types (,) +2025-07-08 23:21:23,363 - util.py[DEBUG]: Reading from /etc/cloud/cloud.cfg.d/05_logging.cfg (quiet=False) +2025-07-08 23:21:23,363 - util.py[DEBUG]: Reading 2071 bytes from /etc/cloud/cloud.cfg.d/05_logging.cfg +2025-07-08 23:21:23,363 - util.py[DEBUG]: Attempting to load yaml from string of length 2071 with allowed root types (,) +2025-07-08 23:21:23,365 - util.py[DEBUG]: Reading from /run/cloud-init/cloud.cfg (quiet=False) +2025-07-08 23:21:23,365 - util.py[DEBUG]: Reading 31 bytes from /run/cloud-init/cloud.cfg +2025-07-08 23:21:23,365 - util.py[DEBUG]: Attempting to load yaml from string of length 31 with allowed root types (,) +2025-07-08 23:21:23,366 - util.py[DEBUG]: Attempting to load yaml from string of length 0 with allowed root types (,) +2025-07-08 23:21:23,366 - util.py[DEBUG]: loaded blob returned None, returning default. +2025-07-08 23:21:23,366 - util.py[DEBUG]: Attempting to remove /var/lib/cloud/instance +2025-07-08 23:21:23,366 - util.py[DEBUG]: Creating symbolic link from '/var/lib/cloud/instance' => '/var/lib/cloud/instances/i-0745d4f0ad28383fa' +2025-07-08 23:21:23,367 - util.py[DEBUG]: Reading from /var/lib/cloud/instances/i-0745d4f0ad28383fa/datasource (quiet=False) +2025-07-08 23:21:23,367 - util.py[DEBUG]: Writing to /var/lib/cloud/instances/i-0745d4f0ad28383fa/datasource - wb: [644] 39 bytes +2025-07-08 23:21:23,367 - util.py[DEBUG]: Writing to /var/lib/cloud/data/previous-datasource - wb: [644] 39 bytes +2025-07-08 23:21:23,368 - util.py[DEBUG]: Reading from /var/lib/cloud/data/instance-id (quiet=False) +2025-07-08 23:21:23,368 - stages.py[DEBUG]: previous iid found to be NO_PREVIOUS_INSTANCE_ID +2025-07-08 23:21:23,368 - util.py[DEBUG]: Writing to /var/lib/cloud/data/instance-id - wb: [644] 20 bytes +2025-07-08 23:21:23,368 - util.py[DEBUG]: Writing to /run/cloud-init/.instance-id - wb: [644] 20 bytes +2025-07-08 23:21:23,368 - util.py[DEBUG]: Writing to /var/lib/cloud/data/previous-instance-id - wb: [644] 24 bytes +2025-07-08 23:21:23,369 - util.py[DEBUG]: Writing to /var/lib/cloud/instance/obj.pkl - wb: [400] 13322 bytes +2025-07-08 23:21:23,369 - main.py[DEBUG]: [local] init will now be targeting instance id: i-0745d4f0ad28383fa. new=True +2025-07-08 23:21:23,369 - util.py[DEBUG]: Reading from /etc/cloud/cloud.cfg (quiet=False) +2025-07-08 23:21:23,369 - util.py[DEBUG]: Reading 3718 bytes from /etc/cloud/cloud.cfg +2025-07-08 23:21:23,369 - util.py[DEBUG]: Attempting to load yaml from string of length 3718 with allowed root types (,) +2025-07-08 23:21:23,376 - util.py[DEBUG]: Reading from /etc/cloud/cloud.cfg.d/90_dpkg.cfg (quiet=False) +2025-07-08 23:21:23,376 - util.py[DEBUG]: Reading 343 bytes from /etc/cloud/cloud.cfg.d/90_dpkg.cfg +2025-07-08 23:21:23,376 - util.py[DEBUG]: Attempting to load yaml from string of length 343 with allowed root types (,) +2025-07-08 23:21:23,376 - util.py[DEBUG]: Reading from /etc/cloud/cloud.cfg.d/90-cpc-grub.cfg (quiet=False) +2025-07-08 23:21:23,377 - util.py[DEBUG]: Reading 108 bytes from /etc/cloud/cloud.cfg.d/90-cpc-grub.cfg +2025-07-08 23:21:23,377 - util.py[DEBUG]: Attempting to load yaml from string of length 108 with allowed root types (,) +2025-07-08 23:21:23,377 - util.py[DEBUG]: Reading from /etc/cloud/cloud.cfg.d/05_logging.cfg (quiet=False) +2025-07-08 23:21:23,377 - util.py[DEBUG]: Reading 2071 bytes from /etc/cloud/cloud.cfg.d/05_logging.cfg +2025-07-08 23:21:23,377 - util.py[DEBUG]: Attempting to load yaml from string of length 2071 with allowed root types (,) +2025-07-08 23:21:23,379 - util.py[DEBUG]: Reading from /run/cloud-init/cloud.cfg (quiet=False) +2025-07-08 23:21:23,379 - util.py[DEBUG]: Reading 31 bytes from /run/cloud-init/cloud.cfg +2025-07-08 23:21:23,379 - util.py[DEBUG]: Attempting to load yaml from string of length 31 with allowed root types (,) +2025-07-08 23:21:23,379 - util.py[DEBUG]: Attempting to load yaml from string of length 0 with allowed root types (,) +2025-07-08 23:21:23,379 - util.py[DEBUG]: loaded blob returned None, returning default. +2025-07-08 23:21:23,380 - stages.py[DEBUG]: Using distro class +2025-07-08 23:21:23,380 - cc_set_hostname.py[DEBUG]: Setting the hostname to ip-172-31-0-146.ap-south-1.compute.internal (ip-172-31-0-146) +2025-07-08 23:21:23,380 - util.py[DEBUG]: Reading from /etc/hostname (quiet=False) +2025-07-08 23:21:23,380 - util.py[DEBUG]: Reading 7 bytes from /etc/hostname +2025-07-08 23:21:23,380 - util.py[DEBUG]: Writing to /etc/hostname - wb: [644] 16 bytes +2025-07-08 23:21:23,381 - distros[DEBUG]: Non-persistently setting the system hostname to ip-172-31-0-146 +2025-07-08 23:21:23,381 - subp.py[DEBUG]: Running command ['hostname', 'ip-172-31-0-146'] with allowed return codes [0] (shell=False, capture=True) +2025-07-08 23:21:23,384 - atomic_helper.py[DEBUG]: Atomically writing to file /var/lib/cloud/data/set-hostname (via temporary file /var/lib/cloud/data/tmp39kij_qe) - w: [644] 91 bytes/chars +2025-07-08 23:21:23,385 - util.py[DEBUG]: Reading from /sys/class/net/enX0/address (quiet=False) +2025-07-08 23:21:23,385 - util.py[DEBUG]: Reading 18 bytes from /sys/class/net/enX0/address +2025-07-08 23:21:23,385 - util.py[DEBUG]: Reading from /sys/class/net/lo/address (quiet=False) +2025-07-08 23:21:23,385 - util.py[DEBUG]: Reading 18 bytes from /sys/class/net/lo/address +2025-07-08 23:21:23,386 - util.py[DEBUG]: Reading from /sys/class/net/enX0/name_assign_type (quiet=False) +2025-07-08 23:21:23,386 - util.py[DEBUG]: Reading 2 bytes from /sys/class/net/enX0/name_assign_type +2025-07-08 23:21:23,386 - util.py[DEBUG]: Reading from /sys/class/net/enX0/address (quiet=False) +2025-07-08 23:21:23,386 - util.py[DEBUG]: Reading 18 bytes from /sys/class/net/enX0/address +2025-07-08 23:21:23,386 - util.py[DEBUG]: Reading from /sys/class/net/enX0/device/device (quiet=False) +2025-07-08 23:21:23,386 - util.py[DEBUG]: Reading from /sys/class/net/lo/address (quiet=False) +2025-07-08 23:21:23,386 - util.py[DEBUG]: Reading 18 bytes from /sys/class/net/lo/address +2025-07-08 23:21:23,386 - util.py[DEBUG]: Reading from /sys/class/net/lo/device/device (quiet=False) +2025-07-08 23:21:23,386 - util.py[DEBUG]: Reading from /sys/class/net/enX0/carrier (quiet=False) +2025-07-08 23:21:23,386 - net[DEBUG]: Interface has no carrier: enX0 +2025-07-08 23:21:23,386 - util.py[DEBUG]: Reading from /sys/class/net/enX0/dormant (quiet=False) +2025-07-08 23:21:23,386 - util.py[DEBUG]: Reading from /sys/class/net/enX0/operstate (quiet=False) +2025-07-08 23:21:23,386 - util.py[DEBUG]: Reading 5 bytes from /sys/class/net/enX0/operstate +2025-07-08 23:21:23,386 - util.py[DEBUG]: Reading from /sys/class/net/enX0/addr_assign_type (quiet=False) +2025-07-08 23:21:23,386 - util.py[DEBUG]: Reading 2 bytes from /sys/class/net/enX0/addr_assign_type +2025-07-08 23:21:23,387 - util.py[DEBUG]: Reading from /sys/class/net/enX0/uevent (quiet=False) +2025-07-08 23:21:23,387 - util.py[DEBUG]: Reading 25 bytes from /sys/class/net/enX0/uevent +2025-07-08 23:21:23,387 - util.py[DEBUG]: Reading from /sys/class/net/enX0/address (quiet=False) +2025-07-08 23:21:23,387 - util.py[DEBUG]: Reading 18 bytes from /sys/class/net/enX0/address +2025-07-08 23:21:23,387 - net[DEBUG]: ovs-vsctl not in PATH; not detecting Open vSwitch interfaces +2025-07-08 23:21:23,387 - util.py[DEBUG]: Reading from /sys/class/net/enX0/device/device (quiet=False) +2025-07-08 23:21:23,387 - util.py[DEBUG]: Reading from /sys/class/net/lo/addr_assign_type (quiet=False) +2025-07-08 23:21:23,387 - util.py[DEBUG]: Reading 2 bytes from /sys/class/net/lo/addr_assign_type +2025-07-08 23:21:23,387 - util.py[DEBUG]: Reading from /sys/class/net/lo/uevent (quiet=False) +2025-07-08 23:21:23,387 - util.py[DEBUG]: Reading 23 bytes from /sys/class/net/lo/uevent +2025-07-08 23:21:23,387 - util.py[DEBUG]: Reading from /sys/class/net/lo/address (quiet=False) +2025-07-08 23:21:23,387 - util.py[DEBUG]: Reading 18 bytes from /sys/class/net/lo/address +2025-07-08 23:21:23,387 - util.py[DEBUG]: Reading from /sys/class/net/lo/device/device (quiet=False) +2025-07-08 23:21:23,387 - util.py[DEBUG]: Reading from /sys/class/net/enX0/type (quiet=False) +2025-07-08 23:21:23,387 - util.py[DEBUG]: Reading 2 bytes from /sys/class/net/enX0/type +2025-07-08 23:21:23,387 - util.py[DEBUG]: Reading from /sys/class/net/lo/type (quiet=False) +2025-07-08 23:21:23,387 - util.py[DEBUG]: Reading 4 bytes from /sys/class/net/lo/type +2025-07-08 23:21:23,388 - distros[DEBUG]: Selected renderer 'netplan' from priority list: ['netplan', 'eni', 'sysconfig'] +2025-07-08 23:21:23,389 - util.py[DEBUG]: Reading from /sys/class/net/enX0/address (quiet=False) +2025-07-08 23:21:23,389 - util.py[DEBUG]: Reading 18 bytes from /sys/class/net/enX0/address +2025-07-08 23:21:23,389 - util.py[DEBUG]: Reading from /sys/class/net/lo/address (quiet=False) +2025-07-08 23:21:23,389 - util.py[DEBUG]: Reading 18 bytes from /sys/class/net/lo/address +2025-07-08 23:21:23,389 - atomic_helper.py[DEBUG]: Atomically writing to file /var/lib/cloud/instance/network-config.json (via temporary file /var/lib/cloud/instance/tmphnimb6g7) - w: [600] 171 bytes/chars +2025-07-08 23:21:23,389 - util.py[DEBUG]: Creating symbolic link from '/run/cloud-init/network-config.json' => '/var/lib/cloud/instance/network-config.json' +2025-07-08 23:21:23,389 - util.py[DEBUG]: Reading from /usr/lib/python3/dist-packages/cloudinit/config/schemas/schema-network-config-v2.json (quiet=False) +2025-07-08 23:21:23,392 - util.py[DEBUG]: Reading 17906 bytes from /usr/lib/python3/dist-packages/cloudinit/config/schemas/schema-network-config-v2.json +2025-07-08 23:21:23,392 - schema.py[DEBUG]: Validating network-config with netplan API +2025-07-08 23:21:23,393 - util.py[DEBUG]: Writing to /run/cloud-init/tmp/tmpnehh1daj/etc/netplan/network-config.yaml - wb: [600] 202 bytes +2025-07-08 23:21:23,394 - util.py[DEBUG]: Reading from /sys/class/net/enX0/device/device (quiet=False) +2025-07-08 23:21:23,394 - util.py[DEBUG]: Reading from /sys/class/net/enX0/addr_assign_type (quiet=False) +2025-07-08 23:21:23,394 - util.py[DEBUG]: Reading 2 bytes from /sys/class/net/enX0/addr_assign_type +2025-07-08 23:21:23,394 - util.py[DEBUG]: Reading from /sys/class/net/enX0/uevent (quiet=False) +2025-07-08 23:21:23,394 - util.py[DEBUG]: Reading 25 bytes from /sys/class/net/enX0/uevent +2025-07-08 23:21:23,394 - util.py[DEBUG]: Reading from /sys/class/net/enX0/address (quiet=False) +2025-07-08 23:21:23,394 - util.py[DEBUG]: Reading 18 bytes from /sys/class/net/enX0/address +2025-07-08 23:21:23,394 - util.py[DEBUG]: Reading from /sys/class/net/enX0/device/device (quiet=False) +2025-07-08 23:21:23,394 - util.py[DEBUG]: Reading from /sys/class/net/lo/addr_assign_type (quiet=False) +2025-07-08 23:21:23,394 - util.py[DEBUG]: Reading 2 bytes from /sys/class/net/lo/addr_assign_type +2025-07-08 23:21:23,394 - util.py[DEBUG]: Reading from /sys/class/net/lo/uevent (quiet=False) +2025-07-08 23:21:23,395 - util.py[DEBUG]: Reading 23 bytes from /sys/class/net/lo/uevent +2025-07-08 23:21:23,395 - util.py[DEBUG]: Reading from /sys/class/net/lo/address (quiet=False) +2025-07-08 23:21:23,395 - util.py[DEBUG]: Reading 18 bytes from /sys/class/net/lo/address +2025-07-08 23:21:23,395 - util.py[DEBUG]: Reading from /sys/class/net/lo/device/device (quiet=False) +2025-07-08 23:21:23,395 - util.py[DEBUG]: Reading from /sys/class/net/enX0/type (quiet=False) +2025-07-08 23:21:23,395 - util.py[DEBUG]: Reading 2 bytes from /sys/class/net/enX0/type +2025-07-08 23:21:23,395 - util.py[DEBUG]: Reading from /sys/class/net/lo/type (quiet=False) +2025-07-08 23:21:23,395 - util.py[DEBUG]: Reading 4 bytes from /sys/class/net/lo/type +2025-07-08 23:21:23,395 - networking.py[DEBUG]: net: all expected physical devices present +2025-07-08 23:21:23,395 - stages.py[DEBUG]: applying net config names for {'version': 2, 'ethernets': {'enX0': {'dhcp4': True, 'dhcp6': False, 'match': {'macaddress': '0a:bb:30:76:3f:2f'}, 'set-name': 'enX0'}}} +2025-07-08 23:21:23,395 - util.py[DEBUG]: Reading from /sys/class/net/enX0/device/device (quiet=False) +2025-07-08 23:21:23,395 - util.py[DEBUG]: Reading from /sys/class/net/enX0/addr_assign_type (quiet=False) +2025-07-08 23:21:23,395 - util.py[DEBUG]: Reading 2 bytes from /sys/class/net/enX0/addr_assign_type +2025-07-08 23:21:23,395 - util.py[DEBUG]: Reading from /sys/class/net/enX0/uevent (quiet=False) +2025-07-08 23:21:23,395 - util.py[DEBUG]: Reading 25 bytes from /sys/class/net/enX0/uevent +2025-07-08 23:21:23,395 - util.py[DEBUG]: Reading from /sys/class/net/enX0/address (quiet=False) +2025-07-08 23:21:23,395 - util.py[DEBUG]: Reading 18 bytes from /sys/class/net/enX0/address +2025-07-08 23:21:23,395 - util.py[DEBUG]: Reading from /sys/class/net/enX0/device/device (quiet=False) +2025-07-08 23:21:23,395 - util.py[DEBUG]: Reading from /sys/class/net/lo/addr_assign_type (quiet=False) +2025-07-08 23:21:23,395 - util.py[DEBUG]: Reading 2 bytes from /sys/class/net/lo/addr_assign_type +2025-07-08 23:21:23,395 - util.py[DEBUG]: Reading from /sys/class/net/lo/uevent (quiet=False) +2025-07-08 23:21:23,395 - util.py[DEBUG]: Reading 23 bytes from /sys/class/net/lo/uevent +2025-07-08 23:21:23,395 - util.py[DEBUG]: Reading from /sys/class/net/lo/address (quiet=False) +2025-07-08 23:21:23,395 - util.py[DEBUG]: Reading 18 bytes from /sys/class/net/lo/address +2025-07-08 23:21:23,395 - util.py[DEBUG]: Reading from /sys/class/net/lo/device/device (quiet=False) +2025-07-08 23:21:23,395 - util.py[DEBUG]: Reading from /sys/class/net/enX0/operstate (quiet=False) +2025-07-08 23:21:23,396 - util.py[DEBUG]: Reading 5 bytes from /sys/class/net/enX0/operstate +2025-07-08 23:21:23,396 - util.py[DEBUG]: Reading from /sys/class/net/lo/operstate (quiet=False) +2025-07-08 23:21:23,396 - util.py[DEBUG]: Reading 8 bytes from /sys/class/net/lo/operstate +2025-07-08 23:21:23,396 - subp.py[DEBUG]: Running command ['ip', '-6', 'addr', 'show', 'permanent', 'scope', 'global'] with allowed return codes [0] (shell=False, capture=True) +2025-07-08 23:21:23,397 - subp.py[DEBUG]: Running command ['ip', '-4', 'addr', 'show'] with allowed return codes [0] (shell=False, capture=True) +2025-07-08 23:21:23,400 - net[DEBUG]: Detected interfaces {'enX0': {'downable': True, 'device_id': None, 'driver': 'vif', 'mac': '0a:bb:30:76:3f:2f', 'name': 'enX0', 'up': False}, 'lo': {'downable': False, 'device_id': None, 'driver': None, 'mac': '00:00:00:00:00:00', 'name': 'lo', 'up': True}} +2025-07-08 23:21:23,400 - net[DEBUG]: no work necessary for renaming of [['0a:bb:30:76:3f:2f', 'enX0', 'vif', None]] +2025-07-08 23:21:23,400 - stages.py[INFO]: Applying network configuration from ds bringup=False: {'version': 2, 'ethernets': {'enX0': {'dhcp4': True, 'dhcp6': False, 'match': {'macaddress': '0a:bb:30:76:3f:2f'}, 'set-name': 'enX0'}}} +2025-07-08 23:21:23,401 - util.py[DEBUG]: Writing to /run/cloud-init/sem/apply_network_config.once - wb: [644] 24 bytes +2025-07-08 23:21:23,401 - distros[DEBUG]: Selected renderer 'netplan' from priority list: ['netplan', 'eni', 'sysconfig'] +2025-07-08 23:21:23,401 - network_state.py[DEBUG]: Passthrough netplan v2 config +2025-07-08 23:21:23,402 - netplan.py[DEBUG]: V2 to V2 passthrough +2025-07-08 23:21:23,402 - netplan.py[DEBUG]: Rendered netplan config using netplan python API +2025-07-08 23:21:23,403 - subp.py[DEBUG]: Running command ['netplan', 'generate'] with allowed return codes [0] (shell=False, capture=True) +2025-07-08 23:21:23,973 - performance.py[DEBUG]: Running ['netplan', 'generate'] took 0.571 seconds +2025-07-08 23:21:23,973 - subp.py[DEBUG]: Running command ['udevadm', 'test-builtin', 'net_setup_link', '/sys/class/net/enX0'] with allowed return codes [0] (shell=False, capture=True) +2025-07-08 23:21:23,978 - subp.py[DEBUG]: Running command ['udevadm', 'test-builtin', 'net_setup_link', '/sys/class/net/lo'] with allowed return codes [0] (shell=False, capture=True) +2025-07-08 23:21:23,981 - distros[DEBUG]: Not bringing up newly configured network interfaces +2025-07-08 23:21:23,981 - main.py[DEBUG]: [local] Exiting. datasource DataSourceEc2Local not in local mode. +2025-07-08 23:21:23,981 - util.py[DEBUG]: Reading from /proc/uptime (quiet=False) +2025-07-08 23:21:23,981 - util.py[DEBUG]: Reading 10 bytes from /proc/uptime +2025-07-08 23:21:23,981 - atomic_helper.py[DEBUG]: Atomically writing to file /var/lib/cloud/data/status.json (via temporary file /var/lib/cloud/data/tmppl4klmhi) - w: [644] 499 bytes/chars +2025-07-08 23:21:23,982 - performance.py[DEBUG]: cloud-init stage: 'init-local' took 1.541 seconds +2025-07-08 23:21:23,982 - handlers.py[DEBUG]: finish: init-local: SUCCESS: searching for local datasources +2025-07-08 23:21:25,834 - log_util.py[DEBUG]: Cloud-init v. 25.1.2-0ubuntu0~24.04.1 running 'init' at Tue, 08 Jul 2025 23:21:25 +0000. Up 9.89 seconds. +2025-07-08 23:21:25,834 - main.py[INFO]: PID [1] started cloud-init 'init'. +2025-07-08 23:21:25,834 - main.py[DEBUG]: No kernel command line url found. +2025-07-08 23:21:25,834 - main.py[DEBUG]: Closing stdin +2025-07-08 23:21:25,835 - util.py[DEBUG]: Writing to /var/log/cloud-init.log - ab: [640] 0 bytes +2025-07-08 23:21:25,835 - util.py[DEBUG]: Changing the ownership of /var/log/cloud-init.log to 102:4 +2025-07-08 23:21:25,835 - util.py[DEBUG]: Reading from /var/lib/cloud/data/python-version (quiet=False) +2025-07-08 23:21:25,835 - util.py[DEBUG]: Reading 4 bytes from /var/lib/cloud/data/python-version +2025-07-08 23:21:25,836 - subp.py[DEBUG]: Running command ['ip', '--json', 'addr'] with allowed return codes [0] (shell=False, capture=True) +2025-07-08 23:21:25,837 - subp.py[DEBUG]: Running command ['ip', '-o', 'route', 'list'] with allowed return codes [0] (shell=False, capture=True) +2025-07-08 23:21:25,838 - subp.py[DEBUG]: Running command ['ip', '--oneline', '-6', 'route', 'list', 'table', 'all'] with allowed return codes [0, 1] (shell=False, capture=True) +2025-07-08 23:21:25,842 - handlers.py[DEBUG]: start: init-network/check-cache: attempting to read from cache [trust] +2025-07-08 23:21:25,842 - util.py[DEBUG]: Reading from /var/lib/cloud/instance/obj.pkl (quiet=False) +2025-07-08 23:21:25,844 - util.py[DEBUG]: Reading 13322 bytes from /var/lib/cloud/instance/obj.pkl +2025-07-08 23:21:25,883 - util.py[DEBUG]: Reading from /run/cloud-init/.instance-id (quiet=False) +2025-07-08 23:21:25,883 - util.py[DEBUG]: Reading 20 bytes from /run/cloud-init/.instance-id +2025-07-08 23:21:25,883 - stages.py[DEBUG]: restored from cache with run check: DataSourceEc2Local +2025-07-08 23:21:25,883 - handlers.py[DEBUG]: finish: init-network/check-cache: SUCCESS: restored from cache with run check: DataSourceEc2Local +2025-07-08 23:21:25,883 - util.py[DEBUG]: Reading from /etc/cloud/cloud.cfg (quiet=False) +2025-07-08 23:21:25,883 - util.py[DEBUG]: Reading 3718 bytes from /etc/cloud/cloud.cfg +2025-07-08 23:21:25,883 - util.py[DEBUG]: Attempting to load yaml from string of length 3718 with allowed root types (,) +2025-07-08 23:21:25,888 - util.py[DEBUG]: Reading from /etc/cloud/cloud.cfg.d/90_dpkg.cfg (quiet=False) +2025-07-08 23:21:25,889 - util.py[DEBUG]: Reading 343 bytes from /etc/cloud/cloud.cfg.d/90_dpkg.cfg +2025-07-08 23:21:25,889 - util.py[DEBUG]: Attempting to load yaml from string of length 343 with allowed root types (,) +2025-07-08 23:21:25,889 - util.py[DEBUG]: Reading from /etc/cloud/cloud.cfg.d/90-cpc-grub.cfg (quiet=False) +2025-07-08 23:21:25,890 - util.py[DEBUG]: Reading 108 bytes from /etc/cloud/cloud.cfg.d/90-cpc-grub.cfg +2025-07-08 23:21:25,890 - util.py[DEBUG]: Attempting to load yaml from string of length 108 with allowed root types (,) +2025-07-08 23:21:25,890 - util.py[DEBUG]: Reading from /etc/cloud/cloud.cfg.d/05_logging.cfg (quiet=False) +2025-07-08 23:21:25,890 - util.py[DEBUG]: Reading 2071 bytes from /etc/cloud/cloud.cfg.d/05_logging.cfg +2025-07-08 23:21:25,890 - util.py[DEBUG]: Attempting to load yaml from string of length 2071 with allowed root types (,) +2025-07-08 23:21:25,891 - util.py[DEBUG]: Reading from /run/cloud-init/cloud.cfg (quiet=False) +2025-07-08 23:21:25,891 - util.py[DEBUG]: Reading 31 bytes from /run/cloud-init/cloud.cfg +2025-07-08 23:21:25,891 - util.py[DEBUG]: Attempting to load yaml from string of length 31 with allowed root types (,) +2025-07-08 23:21:25,891 - util.py[DEBUG]: Attempting to load yaml from string of length 0 with allowed root types (,) +2025-07-08 23:21:25,892 - util.py[DEBUG]: loaded blob returned None, returning default. +2025-07-08 23:21:25,892 - stages.py[INFO]: Instance link already exists, not recreating it. +2025-07-08 23:21:25,892 - util.py[DEBUG]: Reading from /var/lib/cloud/instances/i-0745d4f0ad28383fa/datasource (quiet=False) +2025-07-08 23:21:25,892 - util.py[DEBUG]: Reading 39 bytes from /var/lib/cloud/instances/i-0745d4f0ad28383fa/datasource +2025-07-08 23:21:25,892 - util.py[DEBUG]: Writing to /var/lib/cloud/instances/i-0745d4f0ad28383fa/datasource - wb: [644] 39 bytes +2025-07-08 23:21:25,893 - util.py[DEBUG]: Writing to /var/lib/cloud/data/previous-datasource - wb: [644] 39 bytes +2025-07-08 23:21:25,893 - util.py[DEBUG]: Reading from /var/lib/cloud/data/instance-id (quiet=False) +2025-07-08 23:21:25,893 - util.py[DEBUG]: Reading 20 bytes from /var/lib/cloud/data/instance-id +2025-07-08 23:21:25,893 - stages.py[DEBUG]: previous iid found to be i-0745d4f0ad28383fa +2025-07-08 23:21:25,893 - util.py[DEBUG]: Writing to /var/lib/cloud/data/instance-id - wb: [644] 20 bytes +2025-07-08 23:21:25,893 - util.py[DEBUG]: Writing to /run/cloud-init/.instance-id - wb: [644] 20 bytes +2025-07-08 23:21:25,893 - util.py[DEBUG]: Writing to /var/lib/cloud/data/previous-instance-id - wb: [644] 20 bytes +2025-07-08 23:21:25,894 - util.py[DEBUG]: Writing to /var/lib/cloud/instance/obj.pkl - wb: [400] 13511 bytes +2025-07-08 23:21:25,894 - stages.py[INFO]: Not re-loading configuration, instance id and datasource have not changed. +2025-07-08 23:21:25,894 - main.py[DEBUG]: [net] init will now be targeting instance id: i-0745d4f0ad28383fa. new=False +2025-07-08 23:21:25,895 - util.py[DEBUG]: Reading from /sys/class/net/enX0/address (quiet=False) +2025-07-08 23:21:25,895 - util.py[DEBUG]: Reading 18 bytes from /sys/class/net/enX0/address +2025-07-08 23:21:25,895 - util.py[DEBUG]: Reading from /sys/class/net/lo/address (quiet=False) +2025-07-08 23:21:25,895 - util.py[DEBUG]: Reading 18 bytes from /sys/class/net/lo/address +2025-07-08 23:21:25,895 - util.py[DEBUG]: Reading from /sys/class/net/enX0/addr_assign_type (quiet=False) +2025-07-08 23:21:25,895 - util.py[DEBUG]: Reading 2 bytes from /sys/class/net/enX0/addr_assign_type +2025-07-08 23:21:25,895 - util.py[DEBUG]: Reading from /sys/class/net/enX0/uevent (quiet=False) +2025-07-08 23:21:25,895 - util.py[DEBUG]: Reading 25 bytes from /sys/class/net/enX0/uevent +2025-07-08 23:21:25,895 - util.py[DEBUG]: Reading from /sys/class/net/enX0/address (quiet=False) +2025-07-08 23:21:25,895 - util.py[DEBUG]: Reading 18 bytes from /sys/class/net/enX0/address +2025-07-08 23:21:25,895 - net[DEBUG]: ovs-vsctl not in PATH; not detecting Open vSwitch interfaces +2025-07-08 23:21:25,896 - util.py[DEBUG]: Reading from /sys/class/net/enX0/device/device (quiet=False) +2025-07-08 23:21:25,896 - util.py[DEBUG]: Reading from /sys/class/net/lo/addr_assign_type (quiet=False) +2025-07-08 23:21:25,896 - util.py[DEBUG]: Reading 2 bytes from /sys/class/net/lo/addr_assign_type +2025-07-08 23:21:25,896 - util.py[DEBUG]: Reading from /sys/class/net/lo/uevent (quiet=False) +2025-07-08 23:21:25,896 - util.py[DEBUG]: Reading 23 bytes from /sys/class/net/lo/uevent +2025-07-08 23:21:25,896 - util.py[DEBUG]: Reading from /sys/class/net/lo/address (quiet=False) +2025-07-08 23:21:25,896 - util.py[DEBUG]: Reading 18 bytes from /sys/class/net/lo/address +2025-07-08 23:21:25,896 - util.py[DEBUG]: Reading from /sys/class/net/lo/device/device (quiet=False) +2025-07-08 23:21:25,896 - util.py[DEBUG]: Reading from /sys/class/net/enX0/type (quiet=False) +2025-07-08 23:21:25,896 - util.py[DEBUG]: Reading 2 bytes from /sys/class/net/enX0/type +2025-07-08 23:21:25,896 - util.py[DEBUG]: Reading from /sys/class/net/lo/type (quiet=False) +2025-07-08 23:21:25,896 - util.py[DEBUG]: Reading 4 bytes from /sys/class/net/lo/type +2025-07-08 23:21:25,896 - distros[DEBUG]: Selected renderer 'netplan' from priority list: ['netplan', 'eni', 'sysconfig'] +2025-07-08 23:21:25,896 - util.py[DEBUG]: Reading from /var/lib/cloud/hotplug.enabled (quiet=False) +2025-07-08 23:21:25,896 - util.py[DEBUG]: File not found: /var/lib/cloud/hotplug.enabled +2025-07-08 23:21:25,897 - stages.py[DEBUG]: Allowed events: {: {, }} +2025-07-08 23:21:25,897 - stages.py[DEBUG]: Event Denied: scopes=['network'] EventType=boot-legacy +2025-07-08 23:21:25,897 - stages.py[DEBUG]: No network config applied. Neither a new instance nor datasource network update allowed +2025-07-08 23:21:25,897 - stages.py[DEBUG]: applying net config names for {'version': 2, 'ethernets': {'enX0': {'dhcp4': True, 'dhcp6': False, 'match': {'macaddress': '0a:bb:30:76:3f:2f'}, 'set-name': 'enX0'}}} +2025-07-08 23:21:25,897 - stages.py[DEBUG]: Using distro class +2025-07-08 23:21:25,897 - util.py[DEBUG]: Reading from /sys/class/net/enX0/device/device (quiet=False) +2025-07-08 23:21:25,897 - util.py[DEBUG]: Reading from /sys/class/net/enX0/addr_assign_type (quiet=False) +2025-07-08 23:21:25,897 - util.py[DEBUG]: Reading 2 bytes from /sys/class/net/enX0/addr_assign_type +2025-07-08 23:21:25,897 - util.py[DEBUG]: Reading from /sys/class/net/enX0/uevent (quiet=False) +2025-07-08 23:21:25,897 - util.py[DEBUG]: Reading 25 bytes from /sys/class/net/enX0/uevent +2025-07-08 23:21:25,897 - util.py[DEBUG]: Reading from /sys/class/net/enX0/address (quiet=False) +2025-07-08 23:21:25,897 - util.py[DEBUG]: Reading 18 bytes from /sys/class/net/enX0/address +2025-07-08 23:21:25,897 - util.py[DEBUG]: Reading from /sys/class/net/enX0/device/device (quiet=False) +2025-07-08 23:21:25,897 - util.py[DEBUG]: Reading from /sys/class/net/lo/addr_assign_type (quiet=False) +2025-07-08 23:21:25,897 - util.py[DEBUG]: Reading 2 bytes from /sys/class/net/lo/addr_assign_type +2025-07-08 23:21:25,897 - util.py[DEBUG]: Reading from /sys/class/net/lo/uevent (quiet=False) +2025-07-08 23:21:25,897 - util.py[DEBUG]: Reading 23 bytes from /sys/class/net/lo/uevent +2025-07-08 23:21:25,898 - util.py[DEBUG]: Reading from /sys/class/net/lo/address (quiet=False) +2025-07-08 23:21:25,898 - util.py[DEBUG]: Reading 18 bytes from /sys/class/net/lo/address +2025-07-08 23:21:25,898 - util.py[DEBUG]: Reading from /sys/class/net/lo/device/device (quiet=False) +2025-07-08 23:21:25,898 - util.py[DEBUG]: Reading from /sys/class/net/enX0/operstate (quiet=False) +2025-07-08 23:21:25,898 - util.py[DEBUG]: Reading 3 bytes from /sys/class/net/enX0/operstate +2025-07-08 23:21:25,898 - util.py[DEBUG]: Reading from /sys/class/net/lo/operstate (quiet=False) +2025-07-08 23:21:25,898 - util.py[DEBUG]: Reading 8 bytes from /sys/class/net/lo/operstate +2025-07-08 23:21:25,898 - subp.py[DEBUG]: Running command ['ip', '-6', 'addr', 'show', 'permanent', 'scope', 'global'] with allowed return codes [0] (shell=False, capture=True) +2025-07-08 23:21:25,899 - subp.py[DEBUG]: Running command ['ip', '-4', 'addr', 'show'] with allowed return codes [0] (shell=False, capture=True) +2025-07-08 23:21:25,900 - net[DEBUG]: Detected interfaces {'enX0': {'downable': False, 'device_id': None, 'driver': 'vif', 'mac': '0a:bb:30:76:3f:2f', 'name': 'enX0', 'up': True}, 'lo': {'downable': False, 'device_id': None, 'driver': None, 'mac': '00:00:00:00:00:00', 'name': 'lo', 'up': True}} +2025-07-08 23:21:25,900 - net[DEBUG]: no work necessary for renaming of [['0a:bb:30:76:3f:2f', 'enX0', 'vif', None]] +2025-07-08 23:21:25,901 - handlers.py[DEBUG]: start: init-network/setup-datasource: setting up datasource +2025-07-08 23:21:25,901 - handlers.py[DEBUG]: finish: init-network/setup-datasource: SUCCESS: setting up datasource +2025-07-08 23:21:25,901 - util.py[DEBUG]: Writing to /var/lib/cloud/instances/i-0745d4f0ad28383fa/user-data.txt - wb: [600] 973 bytes +2025-07-08 23:21:25,903 - util.py[DEBUG]: Writing to /var/lib/cloud/instances/i-0745d4f0ad28383fa/user-data.txt.i - wb: [600] 1279 bytes +2025-07-08 23:21:25,903 - util.py[DEBUG]: Writing to /var/lib/cloud/instances/i-0745d4f0ad28383fa/vendor-data.txt - wb: [600] 0 bytes +2025-07-08 23:21:25,904 - util.py[DEBUG]: Writing to /var/lib/cloud/instances/i-0745d4f0ad28383fa/vendor-data.txt.i - wb: [600] 308 bytes +2025-07-08 23:21:25,904 - util.py[DEBUG]: Writing to /var/lib/cloud/instances/i-0745d4f0ad28383fa/vendor-data2.txt - wb: [600] 0 bytes +2025-07-08 23:21:25,905 - util.py[DEBUG]: Writing to /var/lib/cloud/instances/i-0745d4f0ad28383fa/vendor-data2.txt.i - wb: [600] 308 bytes +2025-07-08 23:21:25,905 - util.py[DEBUG]: Reading from /var/lib/cloud/data/set-hostname (quiet=False) +2025-07-08 23:21:25,905 - util.py[DEBUG]: Reading 91 bytes from /var/lib/cloud/data/set-hostname +2025-07-08 23:21:25,905 - cc_set_hostname.py[DEBUG]: No hostname changes. Skipping set_hostname +2025-07-08 23:21:25,905 - util.py[DEBUG]: Writing to /var/lib/cloud/instances/i-0745d4f0ad28383fa/sem/consume_data - wb: [644] 24 bytes +2025-07-08 23:21:25,906 - helpers.py[DEBUG]: Running consume_data using lock () +2025-07-08 23:21:25,906 - handlers.py[DEBUG]: start: init-network/consume-user-data: reading and applying user-data +2025-07-08 23:21:25,906 - launch_index.py[DEBUG]: Discarding 0 multipart messages which do not match launch index 0 +2025-07-08 23:21:25,906 - stages.py[DEBUG]: Added default handler for {'text/cloud-config', 'text/cloud-config-jsonp'} from CloudConfigPartHandler: [['text/cloud-config', 'text/cloud-config-jsonp']] +2025-07-08 23:21:25,906 - stages.py[DEBUG]: Added default handler for {'text/x-shellscript'} from ShellScriptPartHandler: [['text/x-shellscript']] +2025-07-08 23:21:25,906 - stages.py[DEBUG]: Added default handler for {'text/x-shellscript-per-boot'} from ShellScriptByFreqPartHandler: [['text/x-shellscript-per-boot']] +2025-07-08 23:21:25,906 - stages.py[DEBUG]: Added default handler for {'text/x-shellscript-per-instance'} from ShellScriptByFreqPartHandler: [['text/x-shellscript-per-instance']] +2025-07-08 23:21:25,906 - stages.py[DEBUG]: Added default handler for {'text/x-shellscript-per-once'} from ShellScriptByFreqPartHandler: [['text/x-shellscript-per-once']] +2025-07-08 23:21:25,906 - stages.py[DEBUG]: Added default handler for {'text/cloud-boothook'} from BootHookPartHandler: [['text/cloud-boothook']] +2025-07-08 23:21:25,906 - stages.py[DEBUG]: Added default handler for {'text/jinja2'} from JinjaTemplatePartHandler: [['text/jinja2']] +2025-07-08 23:21:25,906 - handlers[DEBUG]: Calling handler CloudConfigPartHandler: [['text/cloud-config', 'text/cloud-config-jsonp']] (__begin__, None, 3) with frequency once-per-instance +2025-07-08 23:21:25,906 - handlers[DEBUG]: Calling handler ShellScriptPartHandler: [['text/x-shellscript']] (__begin__, None, 2) with frequency once-per-instance +2025-07-08 23:21:25,906 - handlers[DEBUG]: Calling handler ShellScriptByFreqPartHandler: [['text/x-shellscript-per-boot']] (__begin__, None, 2) with frequency once-per-instance +2025-07-08 23:21:25,906 - handlers[DEBUG]: Calling handler ShellScriptByFreqPartHandler: [['text/x-shellscript-per-instance']] (__begin__, None, 2) with frequency once-per-instance +2025-07-08 23:21:25,907 - handlers[DEBUG]: Calling handler ShellScriptByFreqPartHandler: [['text/x-shellscript-per-once']] (__begin__, None, 2) with frequency once-per-instance +2025-07-08 23:21:25,907 - handlers[DEBUG]: Calling handler BootHookPartHandler: [['text/cloud-boothook']] (__begin__, None, 2) with frequency once-per-instance +2025-07-08 23:21:25,907 - handlers[DEBUG]: Calling handler JinjaTemplatePartHandler: [['text/jinja2']] (__begin__, None, 3) with frequency once-per-instance +2025-07-08 23:21:25,907 - handlers[DEBUG]: {'MIME-Version': '1.0', 'Content-Type': 'text/x-shellscript', 'Content-Disposition': 'attachment; filename="part-001"'} +2025-07-08 23:21:25,907 - handlers[DEBUG]: Calling handler ShellScriptPartHandler: [['text/x-shellscript']] (text/x-shellscript, part-001, 2) with frequency once-per-instance +2025-07-08 23:21:25,907 - util.py[DEBUG]: Writing to /var/lib/cloud/instance/scripts/part-001 - wb: [700] 973 bytes +2025-07-08 23:21:25,907 - handlers[DEBUG]: Calling handler CloudConfigPartHandler: [['text/cloud-config', 'text/cloud-config-jsonp']] (__end__, None, 3) with frequency once-per-instance +2025-07-08 23:21:25,907 - util.py[DEBUG]: Writing to /var/lib/cloud/instances/i-0745d4f0ad28383fa/cloud-config.txt - wb: [600] 0 bytes +2025-07-08 23:21:25,907 - handlers[DEBUG]: Calling handler ShellScriptPartHandler: [['text/x-shellscript']] (__end__, None, 2) with frequency once-per-instance +2025-07-08 23:21:25,907 - handlers[DEBUG]: Calling handler ShellScriptByFreqPartHandler: [['text/x-shellscript-per-boot']] (__end__, None, 2) with frequency once-per-instance +2025-07-08 23:21:25,907 - handlers[DEBUG]: Calling handler ShellScriptByFreqPartHandler: [['text/x-shellscript-per-instance']] (__end__, None, 2) with frequency once-per-instance +2025-07-08 23:21:25,907 - handlers[DEBUG]: Calling handler ShellScriptByFreqPartHandler: [['text/x-shellscript-per-once']] (__end__, None, 2) with frequency once-per-instance +2025-07-08 23:21:25,907 - handlers[DEBUG]: Calling handler BootHookPartHandler: [['text/cloud-boothook']] (__end__, None, 2) with frequency once-per-instance +2025-07-08 23:21:25,907 - handlers[DEBUG]: Calling handler JinjaTemplatePartHandler: [['text/jinja2']] (__end__, None, 3) with frequency once-per-instance +2025-07-08 23:21:25,907 - handlers.py[DEBUG]: finish: init-network/consume-user-data: SUCCESS: reading and applying user-data +2025-07-08 23:21:25,907 - handlers.py[DEBUG]: start: init-network/consume-vendor-data: reading and applying vendor-data +2025-07-08 23:21:25,908 - stages.py[DEBUG]: no vendordata from datasource +2025-07-08 23:21:25,908 - handlers.py[DEBUG]: finish: init-network/consume-vendor-data: SUCCESS: reading and applying vendor-data +2025-07-08 23:21:25,908 - handlers.py[DEBUG]: start: init-network/consume-vendor-data2: reading and applying vendor-data2 +2025-07-08 23:21:25,908 - stages.py[DEBUG]: no vendordata2 from datasource +2025-07-08 23:21:25,908 - handlers.py[DEBUG]: finish: init-network/consume-vendor-data2: SUCCESS: reading and applying vendor-data2 +2025-07-08 23:21:25,908 - util.py[DEBUG]: Reading from /etc/cloud/cloud.cfg (quiet=False) +2025-07-08 23:21:25,908 - util.py[DEBUG]: Reading 3718 bytes from /etc/cloud/cloud.cfg +2025-07-08 23:21:25,908 - util.py[DEBUG]: Attempting to load yaml from string of length 3718 with allowed root types (,) +2025-07-08 23:21:25,913 - util.py[DEBUG]: Reading from /etc/cloud/cloud.cfg.d/90_dpkg.cfg (quiet=False) +2025-07-08 23:21:25,913 - util.py[DEBUG]: Reading 343 bytes from /etc/cloud/cloud.cfg.d/90_dpkg.cfg +2025-07-08 23:21:25,913 - util.py[DEBUG]: Attempting to load yaml from string of length 343 with allowed root types (,) +2025-07-08 23:21:25,914 - util.py[DEBUG]: Reading from /etc/cloud/cloud.cfg.d/90-cpc-grub.cfg (quiet=False) +2025-07-08 23:21:25,914 - util.py[DEBUG]: Reading 108 bytes from /etc/cloud/cloud.cfg.d/90-cpc-grub.cfg +2025-07-08 23:21:25,914 - util.py[DEBUG]: Attempting to load yaml from string of length 108 with allowed root types (,) +2025-07-08 23:21:25,914 - util.py[DEBUG]: Reading from /etc/cloud/cloud.cfg.d/05_logging.cfg (quiet=False) +2025-07-08 23:21:25,914 - util.py[DEBUG]: Reading 2071 bytes from /etc/cloud/cloud.cfg.d/05_logging.cfg +2025-07-08 23:21:25,914 - util.py[DEBUG]: Attempting to load yaml from string of length 2071 with allowed root types (,) +2025-07-08 23:21:25,915 - util.py[DEBUG]: Reading from /run/cloud-init/cloud.cfg (quiet=False) +2025-07-08 23:21:25,916 - util.py[DEBUG]: Reading 31 bytes from /run/cloud-init/cloud.cfg +2025-07-08 23:21:25,916 - util.py[DEBUG]: Attempting to load yaml from string of length 31 with allowed root types (,) +2025-07-08 23:21:25,916 - util.py[DEBUG]: Attempting to load yaml from string of length 0 with allowed root types (,) +2025-07-08 23:21:25,916 - util.py[DEBUG]: loaded blob returned None, returning default. +2025-07-08 23:21:25,916 - util.py[DEBUG]: Reading from /var/lib/cloud/instance/cloud-config.txt (quiet=False) +2025-07-08 23:21:25,916 - util.py[DEBUG]: Reading 0 bytes from /var/lib/cloud/instance/cloud-config.txt +2025-07-08 23:21:25,916 - util.py[DEBUG]: Attempting to load yaml from string of length 0 with allowed root types (,) +2025-07-08 23:21:25,916 - util.py[DEBUG]: loaded blob returned None, returning default. +2025-07-08 23:21:25,917 - atomic_helper.py[DEBUG]: Atomically writing to file /run/cloud-init/combined-cloud-config.json (via temporary file /run/cloud-init/tmp1m2icrzr) - w: [600] 5609 bytes/chars +2025-07-08 23:21:25,917 - util.py[DEBUG]: Reading from /run/cloud-init/instance-data-sensitive.json (quiet=False) +2025-07-08 23:21:25,917 - util.py[DEBUG]: Reading 14676 bytes from /run/cloud-init/instance-data-sensitive.json +2025-07-08 23:21:25,917 - atomic_helper.py[DEBUG]: Atomically writing to file /run/cloud-init/instance-data-sensitive.json (via temporary file /run/cloud-init/tmp7hdggafk) - w: [600] 16907 bytes/chars +2025-07-08 23:21:25,918 - main.py[DEBUG]: Skipping user-data validation. No user-data found. +2025-07-08 23:21:25,918 - util.py[DEBUG]: Reading from /var/lib/cloud/instance/cloud-config.txt (quiet=False) +2025-07-08 23:21:25,918 - util.py[DEBUG]: Reading 0 bytes from /var/lib/cloud/instance/cloud-config.txt +2025-07-08 23:21:25,918 - util.py[DEBUG]: Attempting to load yaml from string of length 0 with allowed root types (,) +2025-07-08 23:21:25,918 - util.py[DEBUG]: loaded blob returned None, returning default. +2025-07-08 23:21:25,919 - handlers.py[DEBUG]: start: init-network/activate-datasource: activating datasource +2025-07-08 23:21:25,919 - util.py[DEBUG]: Writing to /var/lib/cloud/instance/obj.pkl - wb: [400] 16906 bytes +2025-07-08 23:21:25,920 - handlers.py[DEBUG]: finish: init-network/activate-datasource: SUCCESS: activating datasource +2025-07-08 23:21:25,920 - main.py[DEBUG]: no di_report found in config. +2025-07-08 23:21:25,939 - stages.py[DEBUG]: Using distro class +2025-07-08 23:21:25,940 - modules.py[INFO]: Skipping modules 'bootcmd,write_files,disk_setup,update_etc_hosts,ca_certs,rsyslog' because no applicable config is provided. +2025-07-08 23:21:25,940 - modules.py[DEBUG]: Running module seed_random () with frequency once-per-instance +2025-07-08 23:21:25,940 - handlers.py[DEBUG]: start: init-network/config-seed_random: running config-seed_random with frequency once-per-instance +2025-07-08 23:21:25,940 - util.py[DEBUG]: Writing to /var/lib/cloud/instances/i-0745d4f0ad28383fa/sem/config_seed_random - wb: [644] 24 bytes +2025-07-08 23:21:25,941 - helpers.py[DEBUG]: Running config-seed_random using lock () +2025-07-08 23:21:25,941 - cc_seed_random.py[DEBUG]: no command provided +2025-07-08 23:21:25,941 - handlers.py[DEBUG]: finish: init-network/config-seed_random: SUCCESS: config-seed_random ran successfully and took 0.000 seconds +2025-07-08 23:21:25,941 - modules.py[DEBUG]: Running module growpart () with frequency always +2025-07-08 23:21:25,941 - handlers.py[DEBUG]: start: init-network/config-growpart: running config-growpart with frequency always +2025-07-08 23:21:25,941 - helpers.py[DEBUG]: Running config-growpart using lock () +2025-07-08 23:21:25,941 - cc_growpart.py[DEBUG]: No 'growpart' entry in cfg. Using default: {'mode': 'auto', 'devices': ['/'], 'ignore_growroot_disabled': False} +2025-07-08 23:21:25,941 - subp.py[DEBUG]: Running command ['growpart', '--help'] with allowed return codes [0] (shell=False, capture=True) +2025-07-08 23:21:25,945 - util.py[DEBUG]: Reading from /proc/517/mountinfo (quiet=False) +2025-07-08 23:21:25,945 - util.py[DEBUG]: Reading 2555 bytes from /proc/517/mountinfo +2025-07-08 23:21:25,945 - cc_growpart.py[DEBUG]: growpart found fs=ext4 +2025-07-08 23:21:25,945 - util.py[DEBUG]: Reading from /sys/class/block/xvda1/partition (quiet=False) +2025-07-08 23:21:25,945 - util.py[DEBUG]: Reading 2 bytes from /sys/class/block/xvda1/partition +2025-07-08 23:21:25,945 - util.py[DEBUG]: Reading from /sys/devices/vbd-768/block/xvda/dev (quiet=False) +2025-07-08 23:21:25,946 - util.py[DEBUG]: Reading 6 bytes from /sys/devices/vbd-768/block/xvda/dev +2025-07-08 23:21:25,946 - util.py[DEBUG]: Reading from /proc/517/mountinfo (quiet=False) +2025-07-08 23:21:25,946 - util.py[DEBUG]: Reading 2555 bytes from /proc/517/mountinfo +2025-07-08 23:21:25,946 - util.py[DEBUG]: Reading from /proc/517/mountinfo (quiet=False) +2025-07-08 23:21:25,946 - util.py[DEBUG]: Reading 2555 bytes from /proc/517/mountinfo +2025-07-08 23:21:25,946 - subp.py[DEBUG]: Running command ['growpart', '--dry-run', '/dev/xvda', '1'] with allowed return codes [0] (shell=False, capture=True) +2025-07-08 23:21:26,038 - performance.py[DEBUG]: Running ['growpart', '--dry-run', '/dev/xvda', '1'] took 0.091 seconds +2025-07-08 23:21:26,038 - performance.py[DEBUG]: Resizing devices took 0.093 seconds +2025-07-08 23:21:26,038 - cc_growpart.py[DEBUG]: '/' NOCHANGE: no change necessary (/dev/xvda, 1) +2025-07-08 23:21:26,038 - handlers.py[DEBUG]: finish: init-network/config-growpart: SUCCESS: config-growpart ran successfully and took 0.097 seconds +2025-07-08 23:21:26,038 - modules.py[DEBUG]: Running module resizefs () with frequency always +2025-07-08 23:21:26,038 - handlers.py[DEBUG]: start: init-network/config-resizefs: running config-resizefs with frequency always +2025-07-08 23:21:26,038 - helpers.py[DEBUG]: Running config-resizefs using lock () +2025-07-08 23:21:26,038 - util.py[DEBUG]: Reading from /proc/517/mountinfo (quiet=False) +2025-07-08 23:21:26,038 - util.py[DEBUG]: Reading 2555 bytes from /proc/517/mountinfo +2025-07-08 23:21:26,038 - cc_resizefs.py[DEBUG]: resize_info: dev=/dev/root mnt_point=/ path=/ +2025-07-08 23:21:26,039 - cc_resizefs.py[DEBUG]: Resizing / (ext4) using resize2fs /dev/root +2025-07-08 23:21:26,039 - subp.py[DEBUG]: Running command ('resize2fs', '/dev/root') with allowed return codes [0] (shell=False, capture=True) +2025-07-08 23:21:26,051 - performance.py[DEBUG]: Running ('resize2fs', '/dev/root') took 0.012 seconds +2025-07-08 23:21:26,051 - cc_resizefs.py[DEBUG]: Resized root filesystem (type=ext4, val=True) +2025-07-08 23:21:26,051 - handlers.py[DEBUG]: finish: init-network/config-resizefs: SUCCESS: config-resizefs ran successfully and took 0.012 seconds +2025-07-08 23:21:26,051 - modules.py[DEBUG]: Running module mounts () with frequency once-per-instance +2025-07-08 23:21:26,051 - handlers.py[DEBUG]: start: init-network/config-mounts: running config-mounts with frequency once-per-instance +2025-07-08 23:21:26,051 - util.py[DEBUG]: Writing to /var/lib/cloud/instances/i-0745d4f0ad28383fa/sem/config_mounts - wb: [644] 24 bytes +2025-07-08 23:21:26,051 - helpers.py[DEBUG]: Running config-mounts using lock () +2025-07-08 23:21:26,051 - cc_mounts.py[DEBUG]: mounts configuration is [] +2025-07-08 23:21:26,051 - util.py[DEBUG]: Reading from /etc/fstab (quiet=False) +2025-07-08 23:21:26,051 - util.py[DEBUG]: Reading 146 bytes from /etc/fstab +2025-07-08 23:21:26,051 - cc_mounts.py[DEBUG]: Attempting to determine the real name of ephemeral0 +2025-07-08 23:21:26,052 - cc_mounts.py[DEBUG]: changed ephemeral0 => None +2025-07-08 23:21:26,052 - cc_mounts.py[DEBUG]: Ignoring nonexistent default named mount ephemeral0 +2025-07-08 23:21:26,052 - cc_mounts.py[DEBUG]: Attempting to determine the real name of swap +2025-07-08 23:21:26,052 - DataSourceEc2.py[DEBUG]: Unable to convert swap to a device +2025-07-08 23:21:26,052 - cc_mounts.py[DEBUG]: changed swap => None +2025-07-08 23:21:26,052 - cc_mounts.py[DEBUG]: Ignoring nonexistent default named mount swap +2025-07-08 23:21:26,052 - cc_mounts.py[DEBUG]: no need to setup swap +2025-07-08 23:21:26,052 - cc_mounts.py[DEBUG]: No modifications to fstab needed +2025-07-08 23:21:26,052 - handlers.py[DEBUG]: finish: init-network/config-mounts: SUCCESS: config-mounts ran successfully and took 0.001 seconds +2025-07-08 23:21:26,052 - modules.py[DEBUG]: Running module set_hostname () with frequency once-per-instance +2025-07-08 23:21:26,052 - handlers.py[DEBUG]: start: init-network/config-set_hostname: running config-set_hostname with frequency once-per-instance +2025-07-08 23:21:26,052 - util.py[DEBUG]: Writing to /var/lib/cloud/instances/i-0745d4f0ad28383fa/sem/config_set_hostname - wb: [644] 24 bytes +2025-07-08 23:21:26,052 - helpers.py[DEBUG]: Running config-set_hostname using lock () +2025-07-08 23:21:26,053 - util.py[DEBUG]: Reading from /var/lib/cloud/data/set-hostname (quiet=False) +2025-07-08 23:21:26,053 - util.py[DEBUG]: Reading 91 bytes from /var/lib/cloud/data/set-hostname +2025-07-08 23:21:26,053 - cc_set_hostname.py[DEBUG]: No hostname changes. Skipping set_hostname +2025-07-08 23:21:26,053 - handlers.py[DEBUG]: finish: init-network/config-set_hostname: SUCCESS: config-set_hostname ran successfully and took 0.001 seconds +2025-07-08 23:21:26,053 - modules.py[DEBUG]: Running module update_hostname () with frequency always +2025-07-08 23:21:26,053 - handlers.py[DEBUG]: start: init-network/config-update_hostname: running config-update_hostname with frequency always +2025-07-08 23:21:26,053 - helpers.py[DEBUG]: Running config-update_hostname using lock () +2025-07-08 23:21:26,053 - cc_update_hostname.py[DEBUG]: Updating hostname to ip-172-31-0-146.ap-south-1.compute.internal (ip-172-31-0-146) +2025-07-08 23:21:26,053 - util.py[DEBUG]: Reading from /etc/hostname (quiet=False) +2025-07-08 23:21:26,054 - util.py[DEBUG]: Reading 16 bytes from /etc/hostname +2025-07-08 23:21:26,054 - distros[DEBUG]: Attempting to update hostname to ip-172-31-0-146 in 1 files +2025-07-08 23:21:26,054 - util.py[DEBUG]: Reading from /var/lib/cloud/data/previous-hostname (quiet=False) +2025-07-08 23:21:26,054 - util.py[DEBUG]: Writing to /var/lib/cloud/data/previous-hostname - wb: [644] 16 bytes +2025-07-08 23:21:26,054 - handlers.py[DEBUG]: finish: init-network/config-update_hostname: SUCCESS: config-update_hostname ran successfully and took 0.001 seconds +2025-07-08 23:21:26,054 - modules.py[DEBUG]: Running module users_groups () with frequency once-per-instance +2025-07-08 23:21:26,054 - handlers.py[DEBUG]: start: init-network/config-users_groups: running config-users_groups with frequency once-per-instance +2025-07-08 23:21:26,054 - util.py[DEBUG]: Writing to /var/lib/cloud/instances/i-0745d4f0ad28383fa/sem/config_users_groups - wb: [644] 24 bytes +2025-07-08 23:21:26,054 - helpers.py[DEBUG]: Running config-users_groups using lock () +2025-07-08 23:21:26,056 - util.py[DEBUG]: Reading from /etc/os-release (quiet=True) +2025-07-08 23:21:26,056 - util.py[DEBUG]: Reading 400 bytes from /etc/os-release +2025-07-08 23:21:26,056 - util.py[DEBUG]: Reading from /etc/system-image/channel.ini (quiet=True) +2025-07-08 23:21:26,056 - util.py[DEBUG]: Reading 0 bytes from /etc/system-image/channel.ini +2025-07-08 23:21:26,056 - distros[DEBUG]: Adding user ubuntu +2025-07-08 23:21:26,056 - subp.py[DEBUG]: Running command ['useradd', 'ubuntu', '--comment', 'Ubuntu', '--groups', 'adm,cdrom,dip,lxd,sudo', '--shell', '/bin/bash', '-m'] with allowed return codes [0] (shell=False, capture=True) +2025-07-08 23:21:26,116 - performance.py[DEBUG]: Running ['useradd', 'ubuntu', '--comment', 'Ubuntu', '--groups', 'adm,cdrom,dip,lxd,sudo', '--shell', '/bin/bash', '-m'] took 0.060 seconds +2025-07-08 23:21:26,116 - subp.py[DEBUG]: Running command ['passwd', '-l', 'ubuntu'] with allowed return codes [0] (shell=False, capture=True) +2025-07-08 23:21:26,138 - performance.py[DEBUG]: Running ['passwd', '-l', 'ubuntu'] took 0.021 seconds +2025-07-08 23:21:26,138 - util.py[DEBUG]: Reading from /etc/sudoers (quiet=False) +2025-07-08 23:21:26,138 - util.py[DEBUG]: Reading 1800 bytes from /etc/sudoers +2025-07-08 23:21:26,139 - util.py[DEBUG]: Writing to /etc/sudoers.d/90-cloud-init-users - wb: [440] 141 bytes +2025-07-08 23:21:26,140 - handlers.py[DEBUG]: finish: init-network/config-users_groups: SUCCESS: config-users_groups ran successfully and took 0.086 seconds +2025-07-08 23:21:26,140 - modules.py[DEBUG]: Running module ssh () with frequency once-per-instance +2025-07-08 23:21:26,140 - handlers.py[DEBUG]: start: init-network/config-ssh: running config-ssh with frequency once-per-instance +2025-07-08 23:21:26,140 - util.py[DEBUG]: Writing to /var/lib/cloud/instances/i-0745d4f0ad28383fa/sem/config_ssh - wb: [644] 24 bytes +2025-07-08 23:21:26,140 - helpers.py[DEBUG]: Running config-ssh using lock () +2025-07-08 23:21:26,140 - util.py[DEBUG]: Reading from /proc/sys/crypto/fips_enabled (quiet=False) +2025-07-08 23:21:26,141 - subp.py[DEBUG]: Running command ['ssh-keygen', '-t', 'rsa', '-N', '', '-f', '/etc/ssh/ssh_host_rsa_key'] with allowed return codes [0] (shell=False, capture=True) +2025-07-08 23:21:26,858 - performance.py[DEBUG]: Running ['ssh-keygen', '-t', 'rsa', '-N', '', '-f', '/etc/ssh/ssh_host_rsa_key'] took 0.717 seconds +2025-07-08 23:21:26,859 - subp.py[DEBUG]: Running command ['ssh-keygen', '-t', 'ecdsa', '-N', '', '-f', '/etc/ssh/ssh_host_ecdsa_key'] with allowed return codes [0] (shell=False, capture=True) +2025-07-08 23:21:26,864 - subp.py[DEBUG]: Running command ['ssh-keygen', '-t', 'ed25519', '-N', '', '-f', '/etc/ssh/ssh_host_ed25519_key'] with allowed return codes [0] (shell=False, capture=True) +2025-07-08 23:21:26,869 - util.py[DEBUG]: Reading from /etc/ssh/ssh_host_ed25519_key.pub (quiet=False) +2025-07-08 23:21:26,869 - util.py[DEBUG]: Reading 102 bytes from /etc/ssh/ssh_host_ed25519_key.pub +2025-07-08 23:21:26,869 - util.py[DEBUG]: Reading from /etc/ssh/ssh_host_rsa_key.pub (quiet=False) +2025-07-08 23:21:26,869 - util.py[DEBUG]: Reading 574 bytes from /etc/ssh/ssh_host_rsa_key.pub +2025-07-08 23:21:26,869 - util.py[DEBUG]: Reading from /etc/ssh/ssh_host_ecdsa_key.pub (quiet=False) +2025-07-08 23:21:26,869 - util.py[DEBUG]: Reading 182 bytes from /etc/ssh/ssh_host_ecdsa_key.pub +2025-07-08 23:21:26,869 - util.py[DEBUG]: Reading from /etc/ssh/sshd_config (quiet=False) +2025-07-08 23:21:26,869 - util.py[DEBUG]: Reading 3517 bytes from /etc/ssh/sshd_config +2025-07-08 23:21:26,870 - util.py[DEBUG]: Changing the ownership of /home/ubuntu/.ssh to 1000:1000 +2025-07-08 23:21:26,870 - util.py[DEBUG]: Writing to /home/ubuntu/.ssh/authorized_keys - wb: [600] 0 bytes +2025-07-08 23:21:26,871 - util.py[DEBUG]: Changing the ownership of /home/ubuntu/.ssh/authorized_keys to 1000:1000 +2025-07-08 23:21:26,871 - util.py[DEBUG]: Reading from /home/ubuntu/.ssh/authorized_keys (quiet=False) +2025-07-08 23:21:26,871 - util.py[DEBUG]: Reading 0 bytes from /home/ubuntu/.ssh/authorized_keys +2025-07-08 23:21:26,871 - util.py[DEBUG]: Writing to /home/ubuntu/.ssh/authorized_keys - wb: [600] 93 bytes +2025-07-08 23:21:26,872 - util.py[DEBUG]: Reading from /etc/ssh/sshd_config (quiet=False) +2025-07-08 23:21:26,872 - util.py[DEBUG]: Reading 3517 bytes from /etc/ssh/sshd_config +2025-07-08 23:21:26,872 - util.py[DEBUG]: Writing to /root/.ssh/authorized_keys - wb: [600] 0 bytes +2025-07-08 23:21:26,872 - util.py[DEBUG]: Changing the ownership of /root/.ssh/authorized_keys to 0:0 +2025-07-08 23:21:26,872 - util.py[DEBUG]: Reading from /root/.ssh/authorized_keys (quiet=False) +2025-07-08 23:21:26,873 - util.py[DEBUG]: Reading 0 bytes from /root/.ssh/authorized_keys +2025-07-08 23:21:26,873 - util.py[DEBUG]: Writing to /root/.ssh/authorized_keys - wb: [600] 257 bytes +2025-07-08 23:21:26,873 - handlers.py[DEBUG]: finish: init-network/config-ssh: SUCCESS: config-ssh ran successfully and took 0.733 seconds +2025-07-08 23:21:26,873 - modules.py[DEBUG]: Running module set_passwords () with frequency once-per-instance +2025-07-08 23:21:26,873 - handlers.py[DEBUG]: start: init-network/config-set_passwords: running config-set_passwords with frequency once-per-instance +2025-07-08 23:21:26,873 - util.py[DEBUG]: Writing to /var/lib/cloud/instances/i-0745d4f0ad28383fa/sem/config_set_passwords - wb: [644] 24 bytes +2025-07-08 23:21:26,873 - helpers.py[DEBUG]: Running config-set_passwords using lock () +2025-07-08 23:21:26,874 - cc_set_passwords.py[DEBUG]: Leaving SSH config 'PasswordAuthentication' unchanged. ssh_pwauth=None +2025-07-08 23:21:26,874 - handlers.py[DEBUG]: finish: init-network/config-set_passwords: SUCCESS: config-set_passwords ran successfully and took 0.000 seconds +2025-07-08 23:21:26,874 - main.py[DEBUG]: Ran 9 modules with 0 failures +2025-07-08 23:21:26,874 - util.py[DEBUG]: Reading from /proc/uptime (quiet=False) +2025-07-08 23:21:26,874 - util.py[DEBUG]: Reading 11 bytes from /proc/uptime +2025-07-08 23:21:26,875 - atomic_helper.py[DEBUG]: Atomically writing to file /var/lib/cloud/data/status.json (via temporary file /var/lib/cloud/data/tmp9dge9t6e) - w: [644] 500 bytes/chars +2025-07-08 23:21:26,875 - performance.py[DEBUG]: cloud-init stage: 'init-network' took 1.081 seconds +2025-07-08 23:21:26,875 - handlers.py[DEBUG]: finish: init-network: SUCCESS: searching for network datasources +2025-07-08 23:21:29,088 - log_util.py[DEBUG]: Cloud-init v. 25.1.2-0ubuntu0~24.04.1 running 'modules:config' at Tue, 08 Jul 2025 23:21:29 +0000. Up 13.09 seconds. +2025-07-08 23:21:29,088 - main.py[INFO]: PID [1] started cloud-init 'modules:config'. +2025-07-08 23:21:29,151 - stages.py[DEBUG]: Using distro class +2025-07-08 23:21:29,152 - modules.py[INFO]: Skipping modules 'wireguard,snap,ubuntu_autoinstall,keyboard,apt_pipelining,ubuntu_pro,ntp,timezone,disable_ec2_metadata,runcmd' because no applicable config is provided. +2025-07-08 23:21:29,152 - modules.py[DEBUG]: Running module ssh_import_id () with frequency once-per-instance +2025-07-08 23:21:29,152 - handlers.py[DEBUG]: start: modules-config/config-ssh_import_id: running config-ssh_import_id with frequency once-per-instance +2025-07-08 23:21:29,157 - util.py[DEBUG]: Writing to /var/lib/cloud/instances/i-0745d4f0ad28383fa/sem/config_ssh_import_id - wb: [644] 24 bytes +2025-07-08 23:21:29,157 - helpers.py[DEBUG]: Running config-ssh_import_id using lock () +2025-07-08 23:21:29,157 - cc_ssh_import_id.py[DEBUG]: Skipping module named ssh_import_id, no 'ssh_import_id' directives found. +2025-07-08 23:21:29,157 - handlers.py[DEBUG]: finish: modules-config/config-ssh_import_id: SUCCESS: config-ssh_import_id ran successfully and took 0.005 seconds +2025-07-08 23:21:29,157 - modules.py[DEBUG]: Running module locale () with frequency once-per-instance +2025-07-08 23:21:29,157 - handlers.py[DEBUG]: start: modules-config/config-locale: running config-locale with frequency once-per-instance +2025-07-08 23:21:29,157 - util.py[DEBUG]: Writing to /var/lib/cloud/instances/i-0745d4f0ad28383fa/sem/config_locale - wb: [644] 24 bytes +2025-07-08 23:21:29,160 - helpers.py[DEBUG]: Running config-locale using lock () +2025-07-08 23:21:29,160 - util.py[DEBUG]: Reading from /etc/default/locale (quiet=False) +2025-07-08 23:21:29,160 - util.py[DEBUG]: Reading 13 bytes from /etc/default/locale +2025-07-08 23:21:29,160 - cc_locale.py[DEBUG]: Setting locale to C.UTF-8 +2025-07-08 23:21:29,160 - debian.py[DEBUG]: System locale set to C.UTF-8 via /etc/default/locale +2025-07-08 23:21:29,160 - debian.py[DEBUG]: System has 'LANG=C.UTF-8' requested 'C.UTF-8', skipping regeneration. +2025-07-08 23:21:29,161 - handlers.py[DEBUG]: finish: modules-config/config-locale: SUCCESS: config-locale ran successfully and took 0.003 seconds +2025-07-08 23:21:29,161 - modules.py[DEBUG]: Running module grub_dpkg () with frequency once-per-instance +2025-07-08 23:21:29,161 - handlers.py[DEBUG]: start: modules-config/config-grub_dpkg: running config-grub_dpkg with frequency once-per-instance +2025-07-08 23:21:29,161 - util.py[DEBUG]: Writing to /var/lib/cloud/instances/i-0745d4f0ad28383fa/sem/config_grub_dpkg - wb: [644] 24 bytes +2025-07-08 23:21:29,161 - helpers.py[DEBUG]: Running config-grub_dpkg using lock () +2025-07-08 23:21:29,161 - cc_grub_dpkg.py[DEBUG]: grub_dpkg disabled by config grub_dpkg/enabled=False +2025-07-08 23:21:29,162 - handlers.py[DEBUG]: finish: modules-config/config-grub_dpkg: SUCCESS: config-grub_dpkg ran successfully and took 0.000 seconds +2025-07-08 23:21:29,162 - modules.py[DEBUG]: Running module apt_configure () with frequency once-per-instance +2025-07-08 23:21:29,162 - handlers.py[DEBUG]: start: modules-config/config-apt_configure: running config-apt_configure with frequency once-per-instance +2025-07-08 23:21:29,162 - util.py[DEBUG]: Writing to /var/lib/cloud/instances/i-0745d4f0ad28383fa/sem/config_apt_configure - wb: [644] 24 bytes +2025-07-08 23:21:29,165 - helpers.py[DEBUG]: Running config-apt_configure using lock () +2025-07-08 23:21:29,165 - cc_apt_configure.py[DEBUG]: debconf_selections was not set in config +2025-07-08 23:21:29,169 - util.py[DEBUG]: Reading from /etc/os-release (quiet=True) +2025-07-08 23:21:29,169 - util.py[DEBUG]: Reading 400 bytes from /etc/os-release +2025-07-08 23:21:29,170 - util.py[DEBUG]: Reading from /etc/system-image/channel.ini (quiet=True) +2025-07-08 23:21:29,170 - util.py[DEBUG]: Reading 0 bytes from /etc/system-image/channel.ini +2025-07-08 23:21:29,170 - cc_apt_configure.py[DEBUG]: handling apt config: {} +2025-07-08 23:21:29,170 - subp.py[DEBUG]: Running command ['lsb_release', '--all'] with allowed return codes [0] (shell=False, capture=True) +2025-07-08 23:21:29,205 - performance.py[DEBUG]: Running ['lsb_release', '--all'] took 0.035 seconds +2025-07-08 23:21:29,205 - subp.py[DEBUG]: Running command ['dpkg', '--print-architecture'] with allowed return codes [0] (shell=False, capture=True) +2025-07-08 23:21:29,213 - cc_apt_configure.py[DEBUG]: got primary mirror: None +2025-07-08 23:21:29,213 - cc_apt_configure.py[DEBUG]: got security mirror: None +2025-07-08 23:21:29,214 - util.py[DEBUG]: search for mirror in candidates: '['http://ap-south-1.ec2.archive.ubuntu.com/ubuntu/', 'http://ap-south-1b.clouds.archive.ubuntu.com/ubuntu/', 'http://ap-south-1.clouds.archive.ubuntu.com/ubuntu/']' +2025-07-08 23:21:29,230 - performance.py[DEBUG]: Resolving URL took 0.016 seconds +2025-07-08 23:21:29,230 - util.py[DEBUG]: found working mirror: 'http://ap-south-1.ec2.archive.ubuntu.com/ubuntu/' +2025-07-08 23:21:29,230 - util.py[DEBUG]: search for mirror in candidates: '[]' +2025-07-08 23:21:29,230 - distros[DEBUG]: filtered distro mirror info: {'primary': 'http://ap-south-1.ec2.archive.ubuntu.com/ubuntu/', 'security': 'http://security.ubuntu.com/ubuntu'} +2025-07-08 23:21:29,230 - cc_apt_configure.py[DEBUG]: Apt Mirror info: {'primary': 'http://ap-south-1.ec2.archive.ubuntu.com/ubuntu/', 'security': 'http://security.ubuntu.com/ubuntu', 'PRIMARY': 'http://ap-south-1.ec2.archive.ubuntu.com/ubuntu/', 'SECURITY': 'http://security.ubuntu.com/ubuntu', 'MIRROR': 'http://ap-south-1.ec2.archive.ubuntu.com/ubuntu/'} +2025-07-08 23:21:29,238 - cc_apt_configure.py[INFO]: No custom template provided, fall back to builtin +2025-07-08 23:21:29,238 - util.py[DEBUG]: Reading from /etc/cloud/templates/sources.list.ubuntu.deb822.tmpl (quiet=False) +2025-07-08 23:21:29,246 - util.py[DEBUG]: Reading 3091 bytes from /etc/cloud/templates/sources.list.ubuntu.deb822.tmpl +2025-07-08 23:21:29,256 - util.py[DEBUG]: Writing to /etc/apt/sources.list.d/ubuntu.sources - wb: [644] 3004 bytes +2025-07-08 23:21:29,257 - util.py[DEBUG]: Reading from /etc/apt/sources.list (quiet=False) +2025-07-08 23:21:29,257 - util.py[DEBUG]: Reading 270 bytes from /etc/apt/sources.list +2025-07-08 23:21:29,258 - cc_apt_configure.py[DEBUG]: Renaming apt list /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_noble-updates_restricted_dep11_Components-amd64.yml.gz to /var/lib/apt/lists/ap-south-1.ec2.archive.ubuntu.com_ubuntu_dists_noble-updates_restricted_dep11_Components-amd64.yml.gz +2025-07-08 23:21:29,258 - cc_apt_configure.py[DEBUG]: Renaming apt list /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_noble-updates_main_binary-amd64_Packages to /var/lib/apt/lists/ap-south-1.ec2.archive.ubuntu.com_ubuntu_dists_noble-updates_main_binary-amd64_Packages +2025-07-08 23:21:29,258 - cc_apt_configure.py[DEBUG]: Renaming apt list /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_noble-updates_main_cnf_Commands-amd64 to /var/lib/apt/lists/ap-south-1.ec2.archive.ubuntu.com_ubuntu_dists_noble-updates_main_cnf_Commands-amd64 +2025-07-08 23:21:29,258 - cc_apt_configure.py[DEBUG]: Renaming apt list /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_noble_main_dep11_Components-amd64.yml.gz to /var/lib/apt/lists/ap-south-1.ec2.archive.ubuntu.com_ubuntu_dists_noble_main_dep11_Components-amd64.yml.gz +2025-07-08 23:21:29,258 - cc_apt_configure.py[DEBUG]: Renaming apt list /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_noble-updates_restricted_binary-amd64_Packages to /var/lib/apt/lists/ap-south-1.ec2.archive.ubuntu.com_ubuntu_dists_noble-updates_restricted_binary-amd64_Packages +2025-07-08 23:21:29,259 - cc_apt_configure.py[DEBUG]: Renaming apt list /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_noble_main_cnf_Commands-amd64 to /var/lib/apt/lists/ap-south-1.ec2.archive.ubuntu.com_ubuntu_dists_noble_main_cnf_Commands-amd64 +2025-07-08 23:21:29,259 - cc_apt_configure.py[DEBUG]: Renaming apt list /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_noble-updates_main_dep11_Components-amd64.yml.gz to /var/lib/apt/lists/ap-south-1.ec2.archive.ubuntu.com_ubuntu_dists_noble-updates_main_dep11_Components-amd64.yml.gz +2025-07-08 23:21:29,259 - cc_apt_configure.py[DEBUG]: Renaming apt list /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_noble-updates_InRelease to /var/lib/apt/lists/ap-south-1.ec2.archive.ubuntu.com_ubuntu_dists_noble-updates_InRelease +2025-07-08 23:21:29,259 - cc_apt_configure.py[DEBUG]: Renaming apt list /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_noble_main_binary-amd64_Packages to /var/lib/apt/lists/ap-south-1.ec2.archive.ubuntu.com_ubuntu_dists_noble_main_binary-amd64_Packages +2025-07-08 23:21:29,259 - cc_apt_configure.py[DEBUG]: Renaming apt list /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_noble_InRelease to /var/lib/apt/lists/ap-south-1.ec2.archive.ubuntu.com_ubuntu_dists_noble_InRelease +2025-07-08 23:21:29,259 - cc_apt_configure.py[DEBUG]: Renaming apt list /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_noble_restricted_i18n_Translation-en to /var/lib/apt/lists/ap-south-1.ec2.archive.ubuntu.com_ubuntu_dists_noble_restricted_i18n_Translation-en +2025-07-08 23:21:29,259 - cc_apt_configure.py[DEBUG]: Renaming apt list /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_noble_restricted_binary-amd64_Packages to /var/lib/apt/lists/ap-south-1.ec2.archive.ubuntu.com_ubuntu_dists_noble_restricted_binary-amd64_Packages +2025-07-08 23:21:29,259 - cc_apt_configure.py[DEBUG]: Renaming apt list /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_noble_main_i18n_Translation-en to /var/lib/apt/lists/ap-south-1.ec2.archive.ubuntu.com_ubuntu_dists_noble_main_i18n_Translation-en +2025-07-08 23:21:29,259 - cc_apt_configure.py[DEBUG]: Renaming apt list /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_noble-updates_restricted_i18n_Translation-en to /var/lib/apt/lists/ap-south-1.ec2.archive.ubuntu.com_ubuntu_dists_noble-updates_restricted_i18n_Translation-en +2025-07-08 23:21:29,259 - cc_apt_configure.py[DEBUG]: Renaming apt list /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_noble_restricted_cnf_Commands-amd64 to /var/lib/apt/lists/ap-south-1.ec2.archive.ubuntu.com_ubuntu_dists_noble_restricted_cnf_Commands-amd64 +2025-07-08 23:21:29,259 - cc_apt_configure.py[DEBUG]: Renaming apt list /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_noble-updates_restricted_cnf_Commands-amd64 to /var/lib/apt/lists/ap-south-1.ec2.archive.ubuntu.com_ubuntu_dists_noble-updates_restricted_cnf_Commands-amd64 +2025-07-08 23:21:29,259 - cc_apt_configure.py[DEBUG]: Renaming apt list /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_noble-updates_main_i18n_Translation-en to /var/lib/apt/lists/ap-south-1.ec2.archive.ubuntu.com_ubuntu_dists_noble-updates_main_i18n_Translation-en +2025-07-08 23:21:29,259 - handlers.py[DEBUG]: finish: modules-config/config-apt_configure: SUCCESS: config-apt_configure ran successfully and took 0.097 seconds +2025-07-08 23:21:29,259 - modules.py[DEBUG]: Running module byobu () with frequency once-per-instance +2025-07-08 23:21:29,259 - handlers.py[DEBUG]: start: modules-config/config-byobu: running config-byobu with frequency once-per-instance +2025-07-08 23:21:29,259 - util.py[DEBUG]: Writing to /var/lib/cloud/instances/i-0745d4f0ad28383fa/sem/config_byobu - wb: [644] 23 bytes +2025-07-08 23:21:29,260 - helpers.py[DEBUG]: Running config-byobu using lock () +2025-07-08 23:21:29,260 - cc_byobu.py[DEBUG]: Skipping module named byobu, no 'byobu' values found +2025-07-08 23:21:29,260 - handlers.py[DEBUG]: finish: modules-config/config-byobu: SUCCESS: config-byobu ran successfully and took 0.000 seconds +2025-07-08 23:21:29,260 - main.py[DEBUG]: Ran 5 modules with 0 failures +2025-07-08 23:21:29,260 - util.py[DEBUG]: Reading from /proc/uptime (quiet=False) +2025-07-08 23:21:29,260 - util.py[DEBUG]: Reading 11 bytes from /proc/uptime +2025-07-08 23:21:29,260 - atomic_helper.py[DEBUG]: Atomically writing to file /var/lib/cloud/data/status.json (via temporary file /var/lib/cloud/data/tmp40phwfqo) - w: [644] 502 bytes/chars +2025-07-08 23:21:29,260 - performance.py[DEBUG]: cloud-init stage: 'modules-config' took 0.314 seconds +2025-07-08 23:21:29,260 - handlers.py[DEBUG]: finish: modules-config: SUCCESS: running modules for config +2025-07-08 23:21:34,275 - log_util.py[DEBUG]: Cloud-init v. 25.1.2-0ubuntu0~24.04.1 running 'modules:final' at Tue, 08 Jul 2025 23:21:34 +0000. Up 18.28 seconds. +2025-07-08 23:21:34,275 - main.py[INFO]: PID [1] started cloud-init 'modules:final'. +2025-07-08 23:21:34,307 - stages.py[DEBUG]: Using distro class +2025-07-08 23:21:34,308 - modules.py[INFO]: Skipping modules 'package_update_upgrade_install,fan,landscape,lxd,ubuntu_drivers,write_files_deferred,puppet,chef,ansible,mcollective,salt_minion,phone_home,power_state_change' because no applicable config is provided. +2025-07-08 23:21:34,311 - modules.py[DEBUG]: Running module reset_rmc () with frequency once-per-instance +2025-07-08 23:21:34,311 - handlers.py[DEBUG]: start: modules-final/config-reset_rmc: running config-reset_rmc with frequency once-per-instance +2025-07-08 23:21:34,311 - util.py[DEBUG]: Writing to /var/lib/cloud/instances/i-0745d4f0ad28383fa/sem/config_reset_rmc - wb: [644] 24 bytes +2025-07-08 23:21:34,311 - helpers.py[DEBUG]: Running config-reset_rmc using lock () +2025-07-08 23:21:34,312 - cc_reset_rmc.py[DEBUG]: module disabled, RSCT_PATH not present +2025-07-08 23:21:34,313 - handlers.py[DEBUG]: finish: modules-final/config-reset_rmc: SUCCESS: config-reset_rmc ran successfully and took 0.002 seconds +2025-07-08 23:21:34,313 - modules.py[DEBUG]: Running module scripts_vendor () with frequency once-per-instance +2025-07-08 23:21:34,313 - handlers.py[DEBUG]: start: modules-final/config-scripts_vendor: running config-scripts_vendor with frequency once-per-instance +2025-07-08 23:21:34,313 - util.py[DEBUG]: Writing to /var/lib/cloud/instances/i-0745d4f0ad28383fa/sem/config_scripts_vendor - wb: [644] 23 bytes +2025-07-08 23:21:34,314 - helpers.py[DEBUG]: Running config-scripts_vendor using lock () +2025-07-08 23:21:34,315 - handlers.py[DEBUG]: finish: modules-final/config-scripts_vendor: SUCCESS: config-scripts_vendor ran successfully and took 0.002 seconds +2025-07-08 23:21:34,315 - modules.py[DEBUG]: Running module scripts_per_once () with frequency once +2025-07-08 23:21:34,315 - handlers.py[DEBUG]: start: modules-final/config-scripts_per_once: running config-scripts_per_once with frequency once +2025-07-08 23:21:34,315 - util.py[DEBUG]: Writing to /var/lib/cloud/sem/config_scripts_per_once.once - wb: [644] 24 bytes +2025-07-08 23:21:34,315 - helpers.py[DEBUG]: Running config-scripts_per_once using lock () +2025-07-08 23:21:34,315 - handlers.py[DEBUG]: finish: modules-final/config-scripts_per_once: SUCCESS: config-scripts_per_once ran successfully and took 0.000 seconds +2025-07-08 23:21:34,315 - modules.py[DEBUG]: Running module scripts_per_boot () with frequency always +2025-07-08 23:21:34,315 - handlers.py[DEBUG]: start: modules-final/config-scripts_per_boot: running config-scripts_per_boot with frequency always +2025-07-08 23:21:34,315 - helpers.py[DEBUG]: Running config-scripts_per_boot using lock () +2025-07-08 23:21:34,315 - handlers.py[DEBUG]: finish: modules-final/config-scripts_per_boot: SUCCESS: config-scripts_per_boot ran successfully and took 0.000 seconds +2025-07-08 23:21:34,315 - modules.py[DEBUG]: Running module scripts_per_instance () with frequency once-per-instance +2025-07-08 23:21:34,315 - handlers.py[DEBUG]: start: modules-final/config-scripts_per_instance: running config-scripts_per_instance with frequency once-per-instance +2025-07-08 23:21:34,316 - util.py[DEBUG]: Writing to /var/lib/cloud/instances/i-0745d4f0ad28383fa/sem/config_scripts_per_instance - wb: [644] 24 bytes +2025-07-08 23:21:34,317 - helpers.py[DEBUG]: Running config-scripts_per_instance using lock () +2025-07-08 23:21:34,317 - handlers.py[DEBUG]: finish: modules-final/config-scripts_per_instance: SUCCESS: config-scripts_per_instance ran successfully and took 0.001 seconds +2025-07-08 23:21:34,317 - modules.py[DEBUG]: Running module scripts_user () with frequency once-per-instance +2025-07-08 23:21:34,317 - handlers.py[DEBUG]: start: modules-final/config-scripts_user: running config-scripts_user with frequency once-per-instance +2025-07-08 23:21:34,317 - util.py[DEBUG]: Writing to /var/lib/cloud/instances/i-0745d4f0ad28383fa/sem/config_scripts_user - wb: [644] 24 bytes +2025-07-08 23:21:34,317 - helpers.py[DEBUG]: Running config-scripts_user using lock () +2025-07-08 23:21:34,317 - subp.py[DEBUG]: Running command ['/var/lib/cloud/instance/scripts/part-001'] with allowed return codes [0] (shell=False, capture=False) diff --git a/scripts/deploy.sh b/scripts/deploy.sh index afee34e..6bc4823 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -1,7 +1,5 @@ #!/bin/bash -set -e - # Check for environment argument if [ -z "$1" ]; then echo "[Error] Usage: $0 " @@ -26,18 +24,49 @@ terraform init echo "[+] Applying configuration for environment: $ENV" terraform apply -var-file="$CONFIG_FILE" -auto-approve -echo "[+] Waiting for app to deploy..." -sleep 180 +echo "[+] Waiting 200 seconds for app to deploy in ec2 instance" +sleep 200 # Get the public IP from Terraform output RAW_INSTANCE_IP=$(terraform output -raw instance_public_ip) +echo -e "\n" echo "[+] Testing app on http://$RAW_INSTANCE_IP:80" +echo -e "\n" + +echo -e "\n" curl "http://$RAW_INSTANCE_IP:80" +echo -e "\n" +echo -e "\n" echo "[+] Instance Public IP: $RAW_INSTANCE_IP" +echo "[+] Deploying Log Verification EC2 instance..." +terraform apply -var-file="$CONFIG_FILE" -target=aws_instance.log_verifier -auto-approve +VERIFIER_IP=$(terraform output -raw verifier_instance_public_ip) + + +echo "Verified Public IP: $VERIFIER_IP" + + +# #To verify and pull logs from ec2 to local. +# echo "Wait 2min for verifier ec2 (read only) to pull the logs from s3 to local environment" +# sleep 120 +# cd .. # to save logs at root level +# PRIVATE_KEY_PATH="/Users/default/CS/DevOps/AWS/ssh-key-ec2.pem" #change this to your ssh private key path, also make sure to use `chmod 400` on your key before using +# echo "trying to scp logs to local" +# scp -r -i "$PRIVATE_KEY_PATH" -o StrictHostKeyChecking=no ubuntu@$VERIFIER_IP:/mylogs/ . #to pull logs from readonly ec2 to your local directory /mylogs/ +# cd $TERRAFORM_DIR # to run destroy need to go to terraform directory + +echo -e "\n" +echo "[+] Using curl on app at http://$RAW_INSTANCE_IP:80" +echo -e "\n" +curl "http://$RAW_INSTANCE_IP:80" +echo -e "\n" +echo -e "\n" -# sleep 650 +echo "Terraform destroy will run after 2 minutes..." +echo "You can press ctrl+c and do it earlier as well" +sleep 120 -# terraform destroy -var-file="$CONFIG_FILE" -auto-approve \ No newline at end of file +terraform destroy -var-file="$CONFIG_FILE" -auto-approve \ No newline at end of file diff --git a/scripts/dev_script.sh b/scripts/dev_script.sh index 1178ac9..457f362 100755 --- a/scripts/dev_script.sh +++ b/scripts/dev_script.sh @@ -1,9 +1,9 @@ #!/bin/bash -set -e + # Update system and install dependencies apt-get update -y -apt-get install -y unzip curl git openjdk-21-jdk maven +apt-get install -y unzip git openjdk-21-jdk maven # Install AWS CLI v2 curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" @@ -26,12 +26,12 @@ mvn clean package # Run the Java app nohup java -jar target/*.jar --server.port=80 > /var/log/my-app.log 2>&1 & -# Wait for the app to start -sleep 30 +# Wait for app to run +sleep 5 # Upload Logs to S3 -aws s3 cp /var/log/cloud-init.log s3://${s3_bucket_name}/system/ -aws s3 cp /var/log/my-app.log s3://${s3_bucket_name}/app/ +sudo aws s3 cp /var/log/cloud-init.log s3://${s3_bucket_name}/system/ +sudo aws s3 cp /var/log/my-app.log s3://${s3_bucket_name}/app/ # Shutdown after timeout sudo shutdown -h +${shutdown_minutes} diff --git a/scripts/prod_script.sh b/scripts/prod_script.sh index 1178ac9..00ac8a4 100755 --- a/scripts/prod_script.sh +++ b/scripts/prod_script.sh @@ -1,9 +1,8 @@ #!/bin/bash -set -e # Update system and install dependencies apt-get update -y -apt-get install -y unzip curl git openjdk-21-jdk maven +apt-get install -y unzip git openjdk-21-jdk maven # Install AWS CLI v2 curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" @@ -27,7 +26,7 @@ mvn clean package nohup java -jar target/*.jar --server.port=80 > /var/log/my-app.log 2>&1 & # Wait for the app to start -sleep 30 +sleep 5 # Upload Logs to S3 aws s3 cp /var/log/cloud-init.log s3://${s3_bucket_name}/system/ diff --git a/scripts/verify_logs_script.sh b/scripts/verify_logs_script.sh new file mode 100644 index 0000000..6efd8ae --- /dev/null +++ b/scripts/verify_logs_script.sh @@ -0,0 +1,59 @@ +#!/bin/bash + +# Install AWS CLI and dependencies +apt-get update -y +apt-get install -y unzip curl + +curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" +unzip awscliv2.zip +sudo ./aws/install + +# Create directories for logs +# cd /home/ubuntu +# mkdir -p /mylogs/app +# mkdir -p /mylogs/system +mkdir -p /mylogs + + + +# Retrieve logs from S3 +echo "Fetching logs from S3 Bucket: ${s3_bucket_name}" +# sudo aws s3 sync s3://techeazy-logs-dev-unique123ss /mylogs +# sudo aws s3 sync s3://${s3_bucket_name} /mylogs/ + +echo "Waiting for logs to appear in S3 bucket: ${s3_bucket_name}" +sleep 100 +MAX_RETRIES=20 +RETRY_DELAY=30 # seconds + +for ((i=1; i<=MAX_RETRIES; i++)); do + echo "Attempt $i: Syncing logs from S3..." + if sudo aws s3 sync s3://${s3_bucket_name} /mylogs; then + echo "Logs synced successfully on attempt $i" + break + else + echo "Attempt $i failed. Waiting $RETRY_DELAY seconds before retrying..." + sleep $RETRY_DELAY + fi +done + + + + +# Final check if logs were synced +if [ "$(ls -A /mylogs/app 2>/dev/null)" ]; then + echo "Logs found and downloaded." +else + echo "ERROR: No logs found in /mylogs after $MAX_RETRIES attempts." >&2 + exit 1 +fi + + +# aws s3 cp s3://${s3_bucket_name}/system/ /mylogs/app/ --recursive +# aws s3 cp s3://${s3_bucket_name}/system/ /mylogs/system/ --recursive +# aws s3 cp s3://techeazy-logs-dev-unique123ss/app/ /mylogs/app/ --recursive + + +# Shutdown instance after fetching logs +echo "Verifier complete. Shutting down in ${fetch_timeout} minutes." +sudo shutdown -h +${fetch_timeout} \ No newline at end of file diff --git a/terraform/.terraform.lock.hcl b/terraform/.terraform.lock.hcl deleted file mode 100644 index 44dfbc7..0000000 --- a/terraform/.terraform.lock.hcl +++ /dev/null @@ -1,24 +0,0 @@ -# This file is maintained automatically by "terraform init". -# Manual edits may be lost in future updates. - -provider "registry.terraform.io/hashicorp/aws" { - version = "6.0.0" - hashes = [ - "h1:dbRRZ1NzH1QV/+83xT/X3MLYaZobMXt8DNwbqnJojpo=", - "zh:16b1bb786719b7ebcddba3ab751b976ebf4006f7144afeebcb83f0c5f41f8eb9", - "zh:1fbc08b817b9eaf45a2b72ccba59f4ea19e7fcf017be29f5a9552b623eccc5bc", - "zh:304f58f3333dbe846cfbdfc2227e6ed77041ceea33b6183972f3f8ab51bd065f", - "zh:4cd447b5c24f14553bd6e1a0e4fea3c7d7b218cbb2316a3d93f1c5cb562c181b", - "zh:589472b56be8277558616075fc5480fcd812ba6dc70e8979375fc6d8750f83ef", - "zh:5d78484ba43c26f1ef6067c4150550b06fd39c5d4bfb790f92c4a6f7d9d0201b", - "zh:5f470ce664bffb22ace736643d2abe7ad45858022b652143bcd02d71d38d4e42", - "zh:7a9cbb947aaab8c885096bce5da22838ca482196cf7d04ffb8bdf7fd28003e47", - "zh:854df3e4c50675e727705a0eaa4f8d42ccd7df6a5efa2456f0205a9901ace019", - "zh:87162c0f47b1260f5969679dccb246cb528f27f01229d02fd30a8e2f9869ba2c", - "zh:9a145404d506b52078cd7060e6cbb83f8fc7953f3f63a5e7137d41f69d6317a3", - "zh:9b12af85486a96aedd8d7984b0ff811a4b42e3d88dad1a3fb4c0b580d04fa425", - "zh:a4eab2649f5afe06cc406ce2aaf9fd44dcf311123f48d344c255e93454c08921", - "zh:bea09141c6186a3e133413ae3a2e3d1aaf4f43466a6a468827287527edf21710", - "zh:d7ea2a35ff55ddfe639ab3b04331556b772a8698eca01f5d74151615d9f336db", - ] -} diff --git a/terraform/dev_config.tfvars b/terraform/dev_config.tfvars index 89708a6..6c1006c 100644 --- a/terraform/dev_config.tfvars +++ b/terraform/dev_config.tfvars @@ -1,7 +1,9 @@ -instance_type = "t2.micro" -key_name = "ssh-key-ec2" -stage = "Dev" -shutdown_minutes = 10 -s3_bucket_name = "techeazy-logs-dev-unique123ss" # Change this! -aws_region = "ap-south-1" -repo_url = "https://github.com/techeazy-consulting/techeazy-devops" +instance_type = "t2.micro" +key_name = "ssh-key-ec2" #change this to your key-pair name +ami_id = "ami-0f918f7e67a3323f0" +stage = "Dev" +shutdown_minutes = 30 +s3_bucket_name = "techeazy-logs-dev-unique123ss" # Change this! +aws_region = "ap-south-1" +repo_url = "https://github.com/techeazy-consulting/techeazy-devops" +verifier_lifetime = 25 diff --git a/terraform/ec2.tf b/terraform/ec2.tf index b65cfde..b2ffb07 100644 --- a/terraform/ec2.tf +++ b/terraform/ec2.tf @@ -31,6 +31,7 @@ resource "aws_security_group" "web_sg" { } # EC2 Instance +# Application EC2 Instance resource "aws_instance" "app" { ami = var.ami_id instance_type = var.instance_type @@ -38,7 +39,6 @@ resource "aws_instance" "app" { vpc_security_group_ids = [aws_security_group.web_sg.id] iam_instance_profile = aws_iam_instance_profile.ec2_instance_profile_b.name - user_data = templatefile("${path.module}/../scripts/${lower(var.stage)}_script.sh", { s3_bucket_name = var.s3_bucket_name aws_region = var.aws_region @@ -51,3 +51,27 @@ resource "aws_instance" "app" { Stage = var.stage } } + +# Log Verifier EC2 Instance +resource "aws_instance" "log_verifier" { + ami = var.ami_id + instance_type = var.instance_type + key_name = var.key_name + vpc_security_group_ids = [aws_security_group.web_sg.id] + iam_instance_profile = aws_iam_instance_profile.ec2_instance_profile_a.name + + # Instantiate verifier script after app finishes + user_data = templatefile("${path.module}/../scripts/verify_logs_script.sh", { + s3_bucket_name = var.s3_bucket_name + aws_region = var.aws_region + fetch_timeout = var.verifier_lifetime + # local_copy_path = "/mylogs" + }) + + tags = { + Name = "TecheazyVerifier-${var.stage}" + Stage = var.stage + } + + depends_on = [aws_instance.app] # Wait until app deployment is complete +} diff --git a/terraform/iam.tf b/terraform/iam.tf index 2322785..4cf62b7 100644 --- a/terraform/iam.tf +++ b/terraform/iam.tf @@ -1,4 +1,5 @@ # Role A: Read-Only Access to S3 + resource "aws_iam_role" "role_a_readonly" { name = "readonly_s3_role" @@ -6,16 +7,15 @@ resource "aws_iam_role" "role_a_readonly" { Version = "2012-10-17", Statement = [ { - Effect = "Allow", - Principal = { - AWS = "arn:aws:iam::${data.aws_caller_identity.current.account_id}:role/uploadonly_s3_role" - }, - Action = "sts:AssumeRole" + Effect = "Allow", + Principal = { Service = "ec2.amazonaws.com" }, + Action = "sts:AssumeRole" } ] }) } + resource "aws_iam_policy" "readonly_policy" { name = "readonly_s3_policy" description = "Allows read-only access to S3" @@ -67,7 +67,7 @@ resource "aws_iam_policy" "uploadonly_policy" { }, { Effect = "Deny", - Action = ["s3:GetBucket"], + Action = ["s3:GetObject", "s3:ListBucket"], Resource = ["arn:aws:s3:::*"] }, { diff --git a/terraform/outputs.tf b/terraform/outputs.tf index 928110c..5ba2475 100644 --- a/terraform/outputs.tf +++ b/terraform/outputs.tf @@ -6,13 +6,18 @@ output "s3_log_bucket" { value = aws_s3_bucket.log_s3_bucket.id } -output "iam_role_a_arn" { - description = "ARN of IAM Role A (read access to S3)" - value = aws_iam_role.role_a_readonly.arn +output "verifier_instance_public_ip" { + value = aws_instance.log_verifier.public_ip } -output "iam_role_b_arn" { - description = "ARN of IAM Role B (attached to EC2 instance)" - value = aws_iam_role.role_b_uploader.arn -} +# output "iam_role_a_arn" { +# description = "ARN of IAM Role A (read access to S3)" +# value = aws_iam_role.role_a_readonly.arn +# } + +# output "iam_role_b_arn" { +# description = "ARN of IAM Role B (attached to EC2 instance)" +# value = aws_iam_role.role_b_uploader.arn +# } + diff --git a/terraform/prod_config.tfvars b/terraform/prod_config.tfvars index d316391..252807a 100644 --- a/terraform/prod_config.tfvars +++ b/terraform/prod_config.tfvars @@ -1,7 +1,9 @@ -instance_type = "t2.micro" -key_name = "ssh-key-ec2" -stage = "Prod" -shutdown_minutes = 15 -s3_bucket_name = "techeazy-logs-prod-unique123sss" # Change this! -aws_region = "ap-south-1" -repo_url = "https://github.com/techeazy-consulting/techeazy-devops" +instance_type = "t2.micro" +key_name = "ssh-key-ec2" #change this to your key-pair name +ami_id = "ami-0f918f7e67a3323f0" +stage = "prod" +shutdown_minutes = 25 +s3_bucket_name = "techeazy-logs-dev-unique123ss" # Change this! +aws_region = "ap-south-1" +repo_url = "https://github.com/techeazy-consulting/techeazy-devops" +verifier_lifetime = 25 diff --git a/terraform/variables.tf b/terraform/variables.tf index 208015a..299cc7f 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -26,14 +26,19 @@ variable "repo_url" { variable "s3_bucket_name" { description = "S3 bucket name for logs (must be globally unique)" type = string - default = "techeazy-logs-bucket-39u2390423" + default = "techeazy-logs-dev-unique123ss" validation { condition = length(var.s3_bucket_name) > 0 error_message = "S3 bucket name cannot be empty." } } variable "shutdown_minutes" { - description = "Auto-shutdown timer in minutes" + description = "Shutdown timer for main instance" type = number - default = 10 + default = 25 +} +variable "verifier_lifetime" { + description = "Shutdown timer for verifier instance" + type = number + default = 25 }