SPEAKER: Hi, there.
In this sample, I will demonstrate
how to use the Apigee Maven Config
plugin to push environment configurations like target
servers, key value maps, and organization configurations
like API products, developers, and developer
apps to Apigee using Cloud Build.
Apigee Maven Config plugin is a tool
to create, manage Apigee configurations like KVMs,
target servers, resource files, API products developers, apps,
flow hooks and many more.
Please visit the plugins documentation
to find more information around what the tool can offer.
We will also be using Cloud Build, which
is a fully managed continuous integration delivery
and deployment platform that lets you run fast,
consistent, and reliable automated builds.
Now for this sample, the prerequisites we will need
are, you should have an Apigee X provision and configure
external access for API traffic.
Now as a user, you will need permissions or roles
to push configurations to Apigee,
like an API admin or an admin.
You would also need to have permissions to trigger Cloud
Build in your GCP project.
And finally, you'll need tools like gcloud, unzip, curl
and jq installed.
The sample can be demonstrated using the Cloud Shell
Quickstart tutorial, or following the setup
instructions in the readme.
Now in this video, we will use the Cloud Shell Quickstart.
Click the open in Google Cloud shell
to open the Cloud Shell environment.
Once the environment is loaded, let's follow the instructions
provided in the tutorial.
Now that the Cloud environment is completely loaded
and ready to use, let's go through
the tutorial instructions that we have on the very right.
The first thing that we will have to do
is do the environment setup.
Now to do that, the first thing we will have to ensure
is that we should have an active GCP account selected
in the Cloud Shell.
So let's go through the login process.
Now once the login is complete, let's
navigate to the deploy APC Config directory.
And the next step is where we will
have to update some configurations
in the environmental message file.
So let's click this link here to open the file in the editor.
Now let's go through the file very quickly.
We have two variables that we will have to populate.
One is the project ID, and the other one
is the Apigee environment where we
would want to push the configuration center.
I've updated this particular configuration file.
Now let's go ahead and save this.
Now that we have this file saved, let's source this file.
Click Authorize, and now that we have our prerequisites complete
on the instructions, let's click Start.
Now the first thing that we will have to do
is enable the Cloud Build API.
So let's go ahead and enable that.
After the API is enabled, let's assign the Apigee Org Admin
role to the Cloud Build service account.
So we just copy over the gcloud command, run it,
and that should be it.
And now the final step is to actually trigger
the Cloud Build using the command gcloud builds submit,
and passing a substitution value, which is our Apigee
environment that we had sourced earlier
in the environment file.
Now this is going to take a few minutes.
Now going back to the Cloud Build,
we see that it's complete.
We see a status is successful
Now let's go ahead and make sure that it is completely
configured the way we want it.
So to verify this configuration, let's log
in to the Apigee Console.
So let's click this link.
We should open the Apigee Console.
And let's go back to the instructions.
The instructions says that, navigate to Admin,
Environments, Target Servers.
You should see a target server called SampleTarget created.
Similarly, if you go to Admin, Environments, Key Value Maps,
we should see a key value map called SampleKVM.
So let's go check that out.
So I've gone to Admin, Environments, Target Servers.
Yes, I do see a sample target created.
Now let's look at the key value maps.
Yes, we do see a SampleKVM.
Now for the org entities, we'll have
to go to Publish, API Products to see a sample product.
Similarly, Publish, Developers to see
a sample developer, and then Publish,
Apps to see a sample app.
So let's go verify that.
Now let's go to Publish, API Products.
Yes, I see a sample product created two minutes ago.
Let's go to developers.
We do see a sample developer.
And then let's look at the apps.
That is a sample app.
Now with that, we know that the build
was successful and was able to push all the configurations
to the app environment.
And finally, we have a cleaner script.
So if you would want to clean up all the artifacts
that we just created as part of this example,
please go ahead and run this cleanup script.
That should basically delete all the artifacts
that we just created.
Thanks for watching.
I hope this content was useful to you.
If you have not signed up for Apigee yet, use this link.
And if you have any questions, please
visit the Apigee community.