# Netflix/ICE goto https://console.aws.amazon.com/s3/home?region=us-west-2#
create a bucket: awscostice
add policy more or less like this:
```jsom { "Version": "2008-10-17", "Id": "Policy1335892530063", "Statement": [ { "Sid": "Stmt1335892150622", "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::386209384616:root" }, "Action": [ "s3:GetBucketAcl", "s3:GetBucketPolicy" ], "Resource": "arn:aws:s3:::awscostice" }, { "Sid": "Stmt1335892526596", "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::386209384616:root" }, "Action": "s3:PutObject", "Resource": "arn:aws:s3:::awscostice/*" } ] } ``` Goto: https://console.aws.amazon.com/billing/home#/preferences
last checkbox: awscostice

Create EC2 Instance Amazon Linux
Install Java 8
```bash sudo yum install -y git vim sudo yum remove -y java cd /opt sudo wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u45-b14/jdk-8u45-linux-x64.tar.gz" sudo tar -xzvf jdk-8u45-linux-x64.tar.gz sudo rm -rf jdk-8u45-linux-x64.tar.gz ```
Add to ~/.bashrc and /root/.bashrc
```bash sudo vim ~/.bashrc alias cls='clear' export JAVA_HOME=/opt/jdk1.8.0_45 export JRE_HOME=/opt/jdk1.8.0_45/jre export PATH=$PATH:/opt/jdk1.8.0_45/bin:/opt/jdk1.8.0_45/jre/bin ``` $ source ~/.bashrc
Install Grails 2.4.4 on CentOs
```bash cd opt/ sudo wget https://github.com/grails/grails-core/releases/download/v2.4.4/grails-2.4.4.zip sudo unzip grails-2.4.4.zip sudo rm -rf grails-2.4.4.zip ``` Add to ~/.bashrc and /root/.bashrc
$ sudo vim ~/.bashrc
```bash export GRAILS_HOME=/opt/grails-2.4.4/
export PATH=$PATH:$GRAILS_HOME/bin
``` source ~/.bashrc
You will need get your AWS_ACCOUNT_ID you cab get it here => https://console.aws.amazon.com/billing/home#/account them replace on the properties file where it says YOU_NEED_CHANGE_THIS_AND_PUT_YOUR_AWS_ACCOUNT_ID_HERE Create ice.properties where you downloaded ice from github
```properties ice.processor=true ice.processor.localDir=/mnt/ice_processor ice.work_s3bucketname=awscostice ice.work_s3bucketprefix=aws #ice.startmillis=1364774400000 ice.reader=true ice.reader.localDir=/mnt/ice_reader ice.companyName=CompanyX # s3 bucket name where the billing files are. multiple bucket names are delimited by ",". Ice must have read access to billing s3 bucket. ice.billing_s3bucketname=awscostice # prefix of the billing files. multiple prefixes are delimited by "," ice.billing_s3bucketprefix=, # specify your payer account id here if across-accounts IAM role access is used. multiple account ids are delimited by ",". "ice.billing_payerAccountId=,222222222222" means assumed role access is only used for the second bucket. ice.billing_payerAccountId=,YOU_NEED_CHANGE_THIS_AND_PUT_YOUR_AWS_ACCOUNT_ID_HERE # specify the assumed role name here if you use IAM role access to read from billing s3 bucket. multiple role names are delimited by ",". "ice.billing_accessRoleName=,ice" means assumed role access is only used for the second bucket. ice.billing_accessRoleName=,ice ``` Create Processor/Reader folders ```bash sudo mkdir /mnt/ice_processor sudo mkdir /mnt/ice_reader ``` Get ice from github and build and run ```bash sudo git clone https://github.com/Netflix/ice.git cd ice/ grails wrapper ./grailsw run-app ./grailsw -Dice.s3AccessKeyId=xxx -Dice.s3SecretKey=xxx ``` GOTO http://HOST:8080/ice/dashboard/summary