```ruby
remote_file "#{Chef::Config[:file_cache_path]}/codedeploy-agent.rpm" do
    source "https://s3.amazonaws.com/aws-codedeploy-us-east-1/latest/codedeploy-agent.noarch.rpm"
end

package "codedeploy-agent" do
	action :install
	source "#{Chef::Config[:file_cache_path]}/codedeploy-agent.rpm"
end

service "codedeploy-agent" do
	action [:enable, :start]
end
```

Use AWS installer for installing CodeDeploy agent
user
```ruby
remote_file "#{Chef::Config[:file_cache_path]}/codedeploy-agent-install" do
    source "https://s3.amazonaws.com/aws-codedeploy-us-east-1/latest/install"
    mode 0755
end

bash "install-codedeploy-agent" do
  code <<-EOH
    #{Chef::Config[:file_cache_path]}/codedeploy-agent-install auto
  EOH
end

service "codedeploy-agent" do
	action [:enable, :start]
end
```
assistant