We are using a bunch of EC2 instances which might scale in the future (around 100 instances), now we are looking towards auto deployments using either Jenkins or AWS Code deploy.
I found that we can use AWS Code deploy plugin with Jenkins, but What are the pros and cons of following?
1) Standalone AWS Code Deploy 2) Jenkins with AWS Code Deploy plugin.
We use both CodeDeploy and Jenkins to manage deployments to our AWS environments.
They each have their roles, and I do not see it as a pro/con analysis. I believe you need BOTH to manage both continuous integration builds (Jenkins) and the process of deploying tested builds to your EC2 environments (CodeDeploy)
Here is our setup:
Jenkins polls our SCM for changed. When a change occurs, the app is built, archived into a ZIP, and registered as a deployable artifact in CodeDeploy. We label the revision with the Jenkins build number - say app_6111.zip. Each build is sent the our code deployment bucket: s3:codedeploy-example-com/app
In CodeDeploy we have an application configured, with deployment groups for each environment eg Testing, Production. Since we use #1, all our builds are always ready for immediately deployment. So with one or two clicks, we deploy revision app_6111.zip to a Testing server, for example.
For us, Jenkins is a swiss army knife of modern devops and continuous integration, testing and deployment. Its the backbone from which we can manage builds, testing and building deployment artifacts. We can integrate with all AWS services such as S3, CodeDeploy, Elastic Beanstalk etc.
To answer your specific questions:
I found that we can use AWS Code deploy plugin with Jenkins, but What are the pros and cons of following?
1) Standalone AWS Code Deploy
A standalone CodeDeploy will not be integrated with your build process. It must be configured to either a static S3 artifact that is manually uploaded, or a Github URL. Github is fine, but there is no concept of a build - it deploys from the master or other branch. You cannot easily roll back to a known build for example. Testing is not integrated. No ability to pipeline tasks/jobs.
2) Jenkins with AWS Code Deploy plugin.
This is the preferred approach IMHO. Use both tools. Build known and tested builds, then register the deployment to CodeDeploy. Life is good.