[MUSIC] Hello and welcome. In this demonstration, I will show you how you can use run command. So let's get started. As you can see I am currently inside the OCI console in phoenix region, and currently I'm logged in as my tenancy administrator. So let me first go to Identity and security. I'll go to identity, I'll click on domains, Click on default, and if I click on groups, and I should be able to see the compute admins group. Now let me return back to identity. Go to policies, click on create policy, give it a name. I'll use the same as the description, and select the root compartment. In the policy builder, show manual editor. And now here I'll specify a policy that will allow the users to issue commands, cancel commands, and view the command output for the instances in a particular compartment. So this is basically the policy statement. Allow group computeadmins to manage instance-agent-command-family in tenancy. So I'll click on create. So that's done. Now I will return to identity, click on domains. I'll go to the default domain, click on dynamic groups. So let me create a dynamic group that is going to include the instance that I want to allow commands to run on. Click on create dynamic group. I will call it demodg. Demodg, and here I'll open up the rule builder, And I'll specify the value of the instance OCID. Now, if I just open a duplicate tab, Let me show you the instance that is currently running. So this is the instance that I'm going to use, instance-runcommand for this particular demonstration. So I'll go to this instance. I'll copy the OCID and I will put it here. Click on add rule, click on create. So the name of the dynamic group is demodg. Let me just copy this. So now I will return back to identity, click on policies, click on runcommand policy, click on edit policy statements. Add another statement. So here I am allowing access to the dynamic group. Allow dynamic-group demodg that we created to use instance-agent-command-execution-family in tenancy where request.instanc.id=target.instance.id. So let me click on save changes. You see that currently I'm logged in as the tenancy administrator. So let me sign out. And sign in as the computeadmin. So I will use the computeadmin user, which is a member of computeadims. So let me sign in. Let me go to the compute instances. So the next thing that I need to do is, go to this particular instance, go to a Oracle Cloud Agent and ensure that the plugin is running. So the Compute Instance Run Command plugin is currently enabled and is running. So now we will go and connect to this particular instance. So I'll just ssh. So there you go, we are now connected. So let me now go ahead and run a particular command. So basically I need to allow the OCI run user to run all commands as sudo. For that I'm going to add this particular line to the configuration file. And then I'm going to validate that the syntax in the configuration file is correct. So if the syntax is correct, I get to see this particular message passed OK. Now let me add the configuration file to /etc/sudoers.d/. All right, so I'm done. Now let me minimize this and scroll down. Under resources, let me go to run command. Now let me click on create command. I will just give it a name, Runcommanddemo, I'm okay with the default time out, 3600 seconds. And then when it comes to adding the script I can paste the script directly here. I can select a file, I can import from an Object Storage Bucket, or import from an Object Storage URL. So I am going to provide a very simple command that is going to install the apache web server and going to display a test page. So let me just paste the script over here. You see sudo yum, install httpd. And then I'm starting the service. Now when it comes to output, I can output as text, I can output to an Object Storage Bucket, and I can also output to an Object Storage URL. So let me click on create command. So you see that currently the delivery status is visible and the execution status is accepted. So now you see that the delivery status is acknowledged, and the execution status is accepted, and there you go. You see that the run command demo has now executed successfully. So their delivery status is acknowledged and the execution status has succeeded. So if I just go ahead and open the public IP of this particular instance, I should be able to see the test page. This is a test page. So now I know that it's working correctly. And if I click on view command details, this is the response, and you can see the output. So this concludes our demonstration on run command. Thanks for watching.