AWS devopsagent documentation change
Summary
Fixed indentation in CloudFormation templates and replaced non-breaking spaces with regular spaces in 'AWS DevOpsAgent'
Security assessment
The changes are purely cosmetic: correcting inconsistent indentation in YAML code and replacing non-breaking spaces ( ) with standard spaces. No security configurations were modified (security group rules remain unchanged, IAM permissions are identical). The SSH access rule still uses the same IP restriction logic, and no new security features or vulnerabilities are addressed.
Diff
diff --git a/devopsagent/latest/userguide/getting-started-with-aws-devops-agent-creating-a-test-environment.md b/devopsagent/latest/userguide/getting-started-with-aws-devops-agent-creating-a-test-environment.md index e341d9754..fbde9ef88 100644 --- a//devopsagent/latest/userguide/getting-started-with-aws-devops-agent-creating-a-test-environment.md +++ b//devopsagent/latest/userguide/getting-started-with-aws-devops-agent-creating-a-test-environment.md @@ -110,4 +110,4 @@ We'll use CloudFormation to create our test resources, which allows AWS DevOps A - MyIP: - Type: String - Description: Your current IP address for SSH access (find at https://whatismyipaddress.com) - Default: '0.0.0.0/0' + MyIP: + Type: String + Description: Your current IP address for SSH access (find at https://whatismyipaddress.com) + Default: '0.0.0.0/0' @@ -115,115 +115,115 @@ We'll use CloudFormation to create our test resources, which allows AWS DevOps A - # Security Group for SSH access - TestSecurityGroup: - Type: AWS::EC2::SecurityGroup - Properties: - GroupName: AWS-DevOpsAgent-test-sg - GroupDescription: AWS DevOps Agent beta testing security group - SecurityGroupIngress: - - IpProtocol: tcp - FromPort: 22 - ToPort: 22 - CidrIp: !Ref MyIP - Description: SSH access from your IP - Tags: - - Key: Name - Value: AWS-DevOpsAgent-Test-SG - - Key: Purpose - Value: AWS-DevOpsAgent-Testing - # Key Pair for SSH access - TestKeyPair: - Type: AWS::EC2::KeyPair - Properties: - KeyName: AWS-DevOpsAgent-test-key - KeyType: rsa - Tags: - - Key: Name - Value: AWS-DevOpsAgent-Test-Key - - Key: Purpose - Value: AWS-DevOpsAgent-Testing - # EC2 Instance for CPU testing - TestInstance: - Type: AWS::EC2::Instance - Properties: - InstanceType: t3.micro - ImageId: '{{resolve:ssm:/aws/service/ami-amazon-linux-latest/al2023-ami-kernel-6.1-x86_64}}' - KeyName: !Ref TestKeyPair - SecurityGroupIds: - - !Ref TestSecurityGroup - UserData: - Fn::Base64: !Sub | - #!/bin/bash - yum update -y - yum install -y htop - - # Create the CPU stress test script - cat > /home/ec2-user/cpu-stress-test.sh << 'EOF' - #!/bin/bash - echo "Starting AWS DevOpsAgent CPU Stress Test" - echo "Time: $(date)" - echo "Instance: $(curl -s http://169.254.169.254/latest/meta-data/instance-id)" - echo "" - - # Get number of CPU cores - CORES=$(nproc) - echo "CPU Cores: $CORES" - echo "" - - echo "Starting stress test (5 minutes)..." - echo "This will generate >70% CPU usage to trigger CloudWatch alarm" - echo "" - - # Create CPU load using yes command - echo "Starting CPU load processes..." - for i in $(seq 1 $CORES); do - (yes > /dev/null) & - CPU_PID=$! - echo "Started CPU load process $i (PID: $CPU_PID)" - echo $CPU_PID >> /tmp/cpu_test_pids - done - - # Auto-cleanup after 5 minutes - (sleep 300 && echo "Stopping CPU load processes..." && kill $(cat /tmp/cpu_test_pids 2>/dev/null) 2>/dev/null && rm -f /tmp/cpu_test_pids) & - - echo "" - echo "CPU load processes started for 5 minutes" - echo "Check CloudWatch for alarm trigger in 3-5 minutes" - EOF - - chmod +x /home/ec2-user/cpu-stress-test.sh - chown ec2-user:ec2-user /home/ec2-user/cpu-stress-test.sh - - # Create auto-shutdown script (safety mechanism) - cat > /home/ec2-user/auto-shutdown.sh << 'SHUTDOWN_EOF' - #!/bin/bash - echo "Auto-shutdown scheduled for 2 hours from now: $(date)" - sleep 7200 - echo "Auto-shutdown executing at: $(date)" - sudo shutdown -h now - SHUTDOWN_EOF - - chmod +x /home/ec2-user/auto-shutdown.sh - nohup /home/ec2-user/auto-shutdown.sh > /home/ec2-user/auto-shutdown.log 2>&1 & - - echo "AWS DevOpsAgent test setup completed at $(date)" > /home/ec2-user/setup-complete.txt - Tags: - - Key: Name - Value: AWS-DevOpsAgent-Test-Instance - - Key: Purpose - Value: AWS-DevOpsAgent-Testing - # CloudWatch Alarm for CPU utilization - CPUAlarm: - Type: AWS::CloudWatch::Alarm - Properties: - AlarmName: AWS-DevOpsAgent-EC2-CPU-Test - AlarmDescription: AWS-DevOpsAgent beta test - EC2 CPU utilization alarm - MetricName: CPUUtilization - Namespace: AWS/EC2 - Statistic: Average - Period: 60 - EvaluationPeriods: 1 - Threshold: 70 - ComparisonOperator: GreaterThanThreshold - Dimensions: - - Name: InstanceId - Value: !Ref TestInstance - TreatMissingData: notBreaching + # Security Group for SSH access + TestSecurityGroup: + Type: AWS::EC2::SecurityGroup + Properties: + GroupName: AWS-DevOpsAgent-test-sg + GroupDescription: AWS DevOps Agent beta testing security group + SecurityGroupIngress: + - IpProtocol: tcp + FromPort: 22 + ToPort: 22 + CidrIp: !Ref MyIP + Description: SSH access from your IP + Tags: + - Key: Name + Value: AWS-DevOpsAgent-Test-SG + - Key: Purpose + Value: AWS-DevOpsAgent-Testing + # Key Pair for SSH access + TestKeyPair: + Type: AWS::EC2::KeyPair + Properties: + KeyName: AWS-DevOpsAgent-test-key + KeyType: rsa + Tags: + - Key: Name + Value: AWS-DevOpsAgent-Test-Key + - Key: Purpose + Value: AWS-DevOpsAgent-Testing + # EC2 Instance for CPU testing + TestInstance: + Type: AWS::EC2::Instance + Properties: + InstanceType: t3.micro + ImageId: '{{resolve:ssm:/aws/service/ami-amazon-linux-latest/al2023-ami-kernel-6.1-x86_64}}' + KeyName: !Ref TestKeyPair + SecurityGroupIds: + - !Ref TestSecurityGroup + UserData: + Fn::Base64: !Sub | + #!/bin/bash + yum update -y + yum install -y htop + + # Create the CPU stress test script + cat > /home/ec2-user/cpu-stress-test.sh << 'EOF' + #!/bin/bash + echo "Starting AWS DevOpsAgent CPU Stress Test" + echo "Time: $(date)" + echo "Instance: $(curl -s http://169.254.169.254/latest/meta-data/instance-id)" + echo "" + + # Get number of CPU cores + CORES=$(nproc) + echo "CPU Cores: $CORES" + echo "" + + echo "Starting stress test (5 minutes)..." + echo "This will generate >70% CPU usage to trigger CloudWatch alarm" + echo "" + + # Create CPU load using yes command + echo "Starting CPU load processes..." + for i in $(seq 1 $CORES); do + (yes > /dev/null) & + CPU_PID=$! + echo "Started CPU load process $i (PID: $CPU_PID)" + echo $CPU_PID >> /tmp/cpu_test_pids + done + + # Auto-cleanup after 5 minutes + (sleep 300 && echo "Stopping CPU load processes..." && kill $(cat /tmp/cpu_test_pids 2>/dev/null) 2>/dev/null && rm -f /tmp/cpu_test_pids) &