Simple examples of usage EDA inside AWS. Repository is a part of bigger project, described on the blog.
As playground is based on AWS you need to have needed priviliges and credentionals in general.
export AWS_ACCESS_KEY_ID="ASIA...."
export AWS_SECRET_ACCESS_KEY="vX0cN..."
export AWS_SESSION_TOKEN="iamm..."
Setting up correct roles isn't part of the articule.
SSH key pair are needed for this playground. To get new one please run the command.
ssh-keygen -t ed25519 -C "local" -f ~/.ssh/id_ed25519_eda
If you already have key pairs or you just generated them, in both cases additional work is needed.
- Change key pair path in
~/.ssh/config
. - Past public key content into
/lib/eda-example-stack.ts
.
const myKeyPair = new ec2.CfnKeyPair(this, "localkeypair", {
publicKeyMaterial:
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJxYZEBNRLXmuign6ZgNbmaSK7cnQAgFpx8cCscoqVed local",
keyName: "localawesomekey",
});
- Init a project, and wait for the output.
make deploy
- If you missing public IP of Bastion host, use:
make print
- Configure your ssh client by adding to
~/.ssh/config
below lines. Remember about adding public IP address of Bastion host.
Host jump
PreferredAuthentications publickey
IdentitiesOnly=yes
IdentityFile ~/.ssh/id_ed25519_eda
User ec2-user
# this one could change
# as its public IP
Hostname 3.126.251.7
Host runner
PreferredAuthentications publickey
IdentitiesOnly=yes
ProxyJump jump
IdentityFile ~/.ssh/id_ed25519_eda
User ec2-user
Hostname 10.192.0.111
Host compute
PreferredAuthentications publickey
IdentitiesOnly=yes
ProxyJump jump
IdentityFile ~/.ssh/id_ed25519_eda
User ec2-user
Hostname 10.192.0.90
- Now you have access to 3 compute nodes.
- bastion is jump station
- runner is a node, that contains ansible, ansible runners, and all deps
- compute is empty RHEL box
Please be aware, that conenction from runner to compute requires setting ssh key pairs between them. Where login with user/password is disabled
That is why the easiest way will be adding key content to ~/.ssh/authorized_keys
manually.
- Also what is important remember to clean your environment
make clean
npm run build
compile typescript to jsnpm run watch
watch for changes and compilenpm run test
perform the jest unit testsnpx cdk deploy
deploy this stack to your default AWS account/regionnpx cdk diff
compare deployed stack with current statenpx cdk synth
emits the synthesized CloudFormation template