Questions tagged [ec2-userdata]
42 questions
0
votes
0 answers
Jenkins plugin install not working in EC2 user data script, but run fine manually
I wrote following script to be rendered via Terraform template for EC2 user data :
#!/bin/bash
yum update -y
yum install wget -y
wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
rpm --import…

learnd
- 77
- 5
0
votes
1 answer
AWS EC2 not executing userdata after launch or restart
Using Terraform I launched windows EC2 instance. We used our own AMI. In terraform I have attached powershell script to userdata while creating the instance. After instance is launched, from AWS console I verified that the instance has the following…

LP13
- 30,567
- 53
- 217
- 400
0
votes
1 answer
Wazuh agent when ran from AWS [Ec2] userdata doesn't work correctly
Wazuh agent fim module is not working when wazuh-agent service is started in the user data script. The service starts and there's nothing wierd in ossec logs but nothing shows up in the dashboard. Fim starts working after I ssh into the instance and…

smaricevic
- 3
- 2
0
votes
0 answers
How to install IIS10 and Dotnet4.6.2 with user data while creating AWS windows server
In AWS, I need to automate AWS windows server 2019 installation using Terraform Script.
Inside that AWS windows server, I need to Enable IIS10 and install ASP .NET 4.6.2.
I need to add user data(using PowerShell script) to Enable IIS10 and install…

Vinay Kumar
- 11
- 3
0
votes
0 answers
How to call long-running User Data Script with parameter from CloudFormation?
I have a PowerShell script, that when runs, installs a large application and start a server. This process takes about 20 minutes to run.
I would like to start this install process when the server is first created to avoid having to RDP into the…

Lacrosse343
- 491
- 1
- 3
- 18
0
votes
1 answer
AWS UserData Script in RedHat 7 EC2 Server
I am loading userdata script using AWC CDK typescript code as below.
let userDataScript = fs.readFileSync(path.resolve("./lib/helpers/bootstrap.sh"), "utf8");
instance.addUserData(userDataScript);
The script runs only partially and doesn't seem…

dossani
- 1,892
- 3
- 14
- 23
0
votes
0 answers
NodeJS not installed in AWS EC2 inside User-data when running
I've tried to install NodeJS in EC2instance - linux as follow inside user-data:
#!/bin/bash yum update -y
curl -o-…

Rowaida
- 17
- 2
0
votes
2 answers
Terraform - EC2 user_data and Sessions Manager (ssm-user)
I am creating an EC2 instance on AWS with Terraform that contains the user_data parameter to install docker and assign it to the user ssm-user.
I don't want to enable the ssh connection (22) and I have only enabled access via Session Manager in…

user1911
- 680
- 1
- 14
- 36
0
votes
1 answer
Terraform aws instance user_data not running
trying to use user_data when running an EC2 instance with Terraform.
resource "aws_instance" "ec2nginx1" {
ami = nonsensitive(data.aws_ssm_parameter.ami.value)
instance_type = var.instance_type
subnet_id = aws_subnet.prisubnet1.id
…
0
votes
1 answer
How to make windows EC2 user data script NOT run when I RDP to EC2?
The user data on Windows EC2 works as expected when EC2 is launched programmatically by Lambda. However, it also executes when I manually start the machine and RDP into it for debugging/troubleshooting purposes. Is there a way to make sure it…

GGG
- 125
- 4
- 12
-1
votes
1 answer
Shell script not working to append the text at end the hosts/file
Trying to append a text at the end of the hosts file but not working through userdata .
Service_start.sh script will execute certain commands and also a shell script (hostnames.sh) once server started. every script is working but not this…

Sathya
- 1
- 1
-2
votes
3 answers
Add user_data in ec2 instance using terraform with file variable
I am trying to create multiple ec2 instance using terraform modules. As every instance will have different user data, I want to do this but it's giving error
data "local_file" "user_data" {
for_each = { for ec2 in var.ec2_instances : ec2.name =>…

Maya Ray
- 523
- 1
- 7
- 21